| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 | 1. "SetForegroundWindow" in Win2K vs. Win98 -- HELP! #1054 Posted by: 2003-08-05 12:11:09 | Hello all,
I've been getting a headache out of trying to make the "SetForegroundWindow" work in Win2K.
I am running a second application, from my main application/form, via SHELL... when this second application finishes, I want to bring the first one back to the foreground.
It works impecably well in Win98, but in Win2K I only get the flashing bottom caption... my main application window stays in the background!
This is the piece of code that works perfectly in Win98:
..... SHELL "SecondApplication.exe" SetForegroundWindow(MainForm.Handle) ....
I've tried to use the "AllowSetForegroundWindow" function in Win2K, but it does not seem to fix it (and of course, it does not work under Win98). I am adding it in the same form/application I want to bring to the foreground, right after the SHELL line:
..... SHELL "SecondApplication.exe" AllowSetForegroundWindow(GetCurrentProcessId) SetForegroundWindow(MainForm.Handle) .....
But this does not change anything!! (I've tested the "GetCurrentProcessId" function and it seems to work well).
Is there something else I can try? How can I bring that main form/application back to the foreground once the SHELL application finishes?
Any help will be greatly appreciated.
Many thanks,
Aureliano | 2. Re: "SetForegroundWindow" in Win2K vs. Win98 -- HELP! #1055 | ShowWindow() may help: http://g.yi.org/_scripts/file.php?f=6428&r=2330 | 3. Re: "SetForegroundWindow" in Win2K vs. Win98 -- HELP! #1056 Posted by: 2003-08-05 21:22:43 | Thanks Guidance... but it did not work! I get the same result, bottom caption flashing but window on the background.
I thought also about a combination of functions (like the example you mention), but can't find the correct one... and it's only under Win2K that this happens!
Any other ideas?
Thanks again,
Aureliano | 4. Re: "SetForegroundWindow" in Win2K vs. Win98 -- HELP! #1057 | Then, it should be designed for that in win2k by MS! | Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 |
|
|