- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The "fix" for this "problem" will without doubt be to add a SetFocus(hWnd) into the code, whether somewhere internal to a QWin routine or in your own code. When a particular window loses focus, a Windows issue entirely and nothing at all to do with Fortran as has been pointed out, the API provides an explicit means to recover the focus, no big deal, happens all the time, that's why that tool exists.
Instead of offloading this trivial nonsense to Intel with lots of boohoohoo-ing (big waste of their time), you could simply add a SetFocus() to your own code as an explicit operation, which would be much superior to relying on implicit behavior, which clearly varies, by a library routine which you have not written and have no control over. Then, this major show-stopping problem completely disappears, whether Intel ever "fixes" it or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Diagnosing this sort of problem is very difficult - it's not made any easier by the problem going away when you run the program under the debugger! Don't expect a quick fix for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have not forgotten you and are working toward a solution. If I find a circumvention I'll post it here.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd like for you to try something for me. Edit FORTRAN_WINPRINT.F90, removing the call to GetForegroundWindow() and assigning NULL to that member of the PrintDlg_Struct structure:
! Initialize PRINTDLG_Struct
!
PRINTDLG_Struct%lStructSize = SIZEOF(PRINTDLG_Struct)
!PRINTDLG_Struct%hwndOwner = GetForegroundWindow()
PRINTDLG_Struct%hwndOwner = NULL
I'm seeing good results here with this change. Give it a try and let me know what you see.
Thanks.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will be correcting all of the samples where GetForegroundWindow is used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Steve Whilst looking for something else I found this thread. I used some code from the getfileopen sample some years back and I note having checked the latest release that this is modified to use NULL rather than GetForegroundWindow() for the file structure. I have had a play in my code using both options and done some googling but learned very little. There appears to be no obvious effect. What does setting =NULL actually do?
As an aside I note on my current computer if I open a file open dialog I used to be able to right click on a file and (for example) open it in notepad, edit save and then open in my fortran application. These days on Win 7 x64 if I right click on the file my Fortran app always hangs on the point of click and has to be process killed in task manager. Any ideas? Do other people see this behaviour?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
NULL means it uses the desktop as the owner window. Years ago I thought GetForegroundWIndow() was the right thing to use here, but later learned that this was a common misconception and it created problem for QuickWin applications.
I have no idea regardimg the right-click behavior. Perhaps the control is not handling that properly. Did you try changing the owner to NULL to see what happens then?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Setting PRINTDLG_Struct%hwndOwner to NULL allows the application window to get its focus back once the dialog has been dismissed. GetForegroundWindow() does not.
Are you using the latest version of the compiler? If so, could you attach a test version of your application?
Annalee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you try changing the owner to NULL to see what happens then?.....
Yes my thought was it might fix the issue but it hangs just the same. It was a nice feature to have, many a time you think at the last moment it would be good to make a safe copy of the file you are about to open.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »