tags:

views:

135

answers:

4

In Delphi I can do something like:

var
   hWin : HWnd;

 hWin := GetForegroundWindow;
 ShowWindow(hWin, SW_HIDE);

and hide the window of the topmost application. The problem is that this also hides the application from the task bar and the alt-tab window.

Is there any way to only hide the window without hiding the app from the taskbar and the alt-tab?

Thanks, code is appreciated.

+1  A: 

i think you just want to minimize it ... that hides the window and leaves it in the taskbar, no?

Don Dickinson
I can't do that. I just want to hide the window. If it's minimize all kind of messages never reach the application
Jessica
+1  A: 

Hi Jessica,

using the following code, you can minimize the window:

SendMessage(hWin,WM_SYSCOMMAND,SC_MINIMIZE,0);
henchman
that would minimize it. I don't want that. I just want to hide the window. If it's minimized all kind of messages never reach the application
Jessica
+1  A: 
var
   hWin : Cardinal;

 hWin := GetForegroundWindow;
 ShowWindow(hWin, SW_SHOWMINIMIZED);

try this!

Andrey
that would minimize it. I don't want that. I just want to hide the window. If it's minimize all kind of messages never reach the application
Jessica
what do you mean by "all kind of messages"? i don't think there is a way to hide the window without minimizing it or hiding at all. you can set transparency to 100% may be :), but it sounds freaky.
Andrey
Some window messages are not captured by the application when its state is set to minimized. In any case, it doesn't matter. I'll accept your answer since I know that this is not possible in windows
Jessica
A: 

You could resize the window to 0x0, or maybe move it off the screen. The problem is then if someone alt-tabs to it you would need to restore its position and size.

Jim McKeeth