svvada
asked on
SetForegroundWindow in Win2K and WinXP
Using the SetForegroundWindow function in Win2000 or WinXP doesn't bring the form to front but only flashes it on the taskbar. How can I get a form to come to the front without screwing around with the users registry settings?
use
ShowWindow([Window.Handle] , SW_RESTORE);
regards
ShowWindow([Window.Handle]
regards
ASKER
Thanks for the response.
Yes in this case it's from my own application, but the BringToFront and ShowWindow only works if i have focus on my application. If I have focus on another application it just happens in the background. Just to clearify, since the SW_RESTORE is used for restoring a minimized window, my window is not minimized it's just behind other windows, some from other applications.
Yes in this case it's from my own application, but the BringToFront and ShowWindow only works if i have focus on my application. If I have focus on another application it just happens in the background. Just to clearify, since the SW_RESTORE is used for restoring a minimized window, my window is not minimized it's just behind other windows, some from other applications.
Still works though
regards
regards
Hi, get the handle of your window or either
window of different application and use fn:
function BringWindowToTop(hWnd: HWND): BOOL; stdcall;
BringWindowToTop([Window.H andle]);
regards,
Kate
window of different application and use fn:
function BringWindowToTop(hWnd: HWND): BOOL; stdcall;
BringWindowToTop([Window.H
regards,
Kate
Is your form minimized or what?
SetForegroundWindow() works fine for me on XP.
SetForegroundWindow() works fine for me on XP.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks again for all the response, sorry about the delayed feedback but I've had a looooong weekend.
pcsentinel: It might work for you, but it's not working for me. Might have something to do with reg settings?
Kate: Same thing here, it just flashes on the taskbar.
ZhaawZ: When i write "my window is not minimized" it's not minimized (= And again it's not working for me.
Madshi: Perfect! Just what I needed!
smot: Link would not open, looks like the site is down, might also have been a good solution.
I'll wait a while and try the link again before I distribute out the points. fair is fair.
Again thanks for all your help.
pcsentinel: It might work for you, but it's not working for me. Might have something to do with reg settings?
Kate: Same thing here, it just flashes on the taskbar.
ZhaawZ: When i write "my window is not minimized" it's not minimized (= And again it's not working for me.
Madshi: Perfect! Just what I needed!
smot: Link would not open, looks like the site is down, might also have been a good solution.
I'll wait a while and try the link again before I distribute out the points. fair is fair.
Again thanks for all your help.
If it is your own application then you should be able to call:
Form1.BringToFront;