spikey_nick
asked on
Bringing a window to the front
I'm working on a program that needs to bring an already opened IE window to the front of the screen. I looked on the MSDN site for help. I've tried using ShowWindow(), ShowWindowAsync(), BringWindowToTop() and SwitchToThisWindow() [which wouldn't compile]. Does anybody know of any other functions that will do this, or is there anything special that I need to do to get one of the above functions to work?
SetWindowPos() works well, assumming you have the HWND handler of the window.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/setwindowpos.asp
An example:
BOOL SetWindowPos( hWnd, HWND_TOPMOST, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE);
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/setwindowpos.asp
An example:
BOOL SetWindowPos( hWnd, HWND_TOPMOST, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER