- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I've written a dll which includes a routine that is a do-all file input routine, that accepts command-line arguments, converts wildcards for multiple files and finally prompts if necessary, using the system32 routine GetOpenFilename. I patterned my GetOpenFilename attempt after the example in the samples folders. I assign a null to the argument hwndOwner.
My problem is that this .dll routine can be called by quickwin applications. It has been my experience that in this case, the window manager gets confused after the GetOpenFilename dialog box is closed. Window focus seems to be lost in never-never land. As the comment text indicates in the example, I've tried using :
For QuickWin
! and Standard Graphics projects,
! use GETHWNDQQ(QWIN$FRAMEWINDOW)
Unfortunately, my routine being in a dll and called by a quickwin application seems to prevent me from using the GETHWNDQQ subroutine successfully. It always returns a zero value. I've experimented with putting the entire GetOpenFilename routine into the quickwin application, with success. However, I'd really like to write the routines into a dll library for efficiency reasons. How can I determine the proper hwindOwner to pass to the system routine from within a dll being called by a quickwin application?
Thanks in advance for your help on this subject,
Jack M. O'Leary
I've written a dll which includes a routine that is a do-all file input routine, that accepts command-line arguments, converts wildcards for multiple files and finally prompts if necessary, using the system32 routine GetOpenFilename. I patterned my GetOpenFilename attempt after the example in the samples folders. I assign a null to the argument hwndOwner.
My problem is that this .dll routine can be called by quickwin applications. It has been my experience that in this case, the window manager gets confused after the GetOpenFilename dialog box is closed. Window focus seems to be lost in never-never land. As the comment text indicates in the example, I've tried using :
For QuickWin
! and Standard Graphics projects,
! use GETHWNDQQ(QWIN$FRAMEWINDOW)
Unfortunately, my routine being in a dll and called by a quickwin application seems to prevent me from using the GETHWNDQQ subroutine successfully. It always returns a zero value. I've experimented with putting the entire GetOpenFilename routine into the quickwin application, with success. However, I'd really like to write the routines into a dll library for efficiency reasons. How can I determine the proper hwindOwner to pass to the system routine from within a dll being called by a quickwin application?
Thanks in advance for your help on this subject,
Jack M. O'Leary
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I seem to have stumbled across a solution to my problem. After trying unsucessfully to call GetFocus and GetActiveWindow (they returned a zero) I finally have found GetForegroundWindow works. It passes me the handle of a window that I can supply to the hwndOwner member of OPENFILENAME, which is required by GetOpenFilename. After the user closes the GetOpenFilename dialog box, focus returns normally to the "console" window.
Jack
Jack
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Neat solution! I'll update our examples to use it. Thanks!
Steve
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page