Programmatically determining arguments to a WinAPI function