How to birng to top an application?
-
Hello, I'm trying to bring to top an application. I followed several examples that I've founded but it doesn't work. I have the instance of my application registered in the computer and I have access to it via Remoting. I've got a method (ShowMyWindow) that I want to call to show the main window of my application: public void ShowMyWindow() { if (IsIconic(hWnd)) { ShowWindowAsync(hWnd, 3); } SetForegroundWindow(hWnd); } Now, for example, I've got a instance of my application running in my computer and I try to execute another one from the console. I obtain the already running instance and execute the ShowMyWindow method. The problem is that the result of this is I've got the console window on top and the icon of my application flashing in the task bar (I want to show it a the top of my screen!!!!!:mad:) Instead, if my application is minimized, it works.... Any suggestion??? Thanks, Iván Fernández
-
Hello, I'm trying to bring to top an application. I followed several examples that I've founded but it doesn't work. I have the instance of my application registered in the computer and I have access to it via Remoting. I've got a method (ShowMyWindow) that I want to call to show the main window of my application: public void ShowMyWindow() { if (IsIconic(hWnd)) { ShowWindowAsync(hWnd, 3); } SetForegroundWindow(hWnd); } Now, for example, I've got a instance of my application running in my computer and I try to execute another one from the console. I obtain the already running instance and execute the ShowMyWindow method. The problem is that the result of this is I've got the console window on top and the icon of my application flashing in the task bar (I want to show it a the top of my screen!!!!!:mad:) Instead, if my application is minimized, it works.... Any suggestion??? Thanks, Iván Fernández
Did you try
BringWindowToTop
instead of SetForegroundWindow?
"...hasn't really been well accepted ... as the ratings tell us so far :)" - Nishant S
-
Did you try
BringWindowToTop
instead of SetForegroundWindow?
"...hasn't really been well accepted ... as the ratings tell us so far :)" - Nishant S
Yes, I tried but it doesn't work anyway... Iván Fernández
-
Yes, I tried but it doesn't work anyway... Iván Fernández
:confused: It's strange, because "The
BringWindowToTop
function brings the specified window to the top of the Z order"
"...hasn't really been well accepted ... as the ratings tell us so far :)" - Nishant S