windowsdelphi

How can I hide a window while keeping it on the taskbar and the Alt+Tab list?


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.


Solution

  • var
       hWin : Cardinal;
    
     hWin := GetForegroundWindow;
     ShowWindow(hWin, SW_SHOWMINIMIZED);
    

    try this!