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?


Solution

  • Try this:

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