I've got a small problem that might be of general interest.
I'm updating an older console based utility. It takes a number of files as input, interacts with the user a little, then spits out a processed file and exits. Instead of forcing the user to type in path and filename, I'm now using the WinAPI call GetOpenFileName.
This has worked for me in several QuickWin and mixed QuickWin/WinAPI programs. In this console application, however, the first occurrence of the dialog appears without the focus and behind the console window. After shifting focus and selecting a file, the program proceeds and subsequent instances of the dialog appear with focus as desired.
How can I force the first occurrence to have focus when GetOpenFileName is called?