Question

I have a kiosk-style application where the user/operator can select applciations using special keys.

I have a management application that monitors the keys (via another API) and attempts to minimize and maximize other application windows as required.

For any given application, the pseudocode looks like:

  foreach(var process in NotCurrentProcess())
  {
    ShowWindowAsync(process.MainWindowHandle, SW_FORCEMINIMIZE);
  }
  ShowWindowAsync(myProcess.MainWindowHandle, SW_SHOWMAXIMIZED);

This works fine for testing.

For deployment my application becomes the shell at HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

Now when I minimize an application, there's no taskbar for it to go to and it floats above the top window.

Floating minimized windows

Can anyone help with a root cause/fix for this?

Was it helpful?

Solution

I assume you just want to hide the windows since there is no task bar to dock them in, right?

Rather than minimize the application window, just position it offscreen Like 10000 pixels to the left of where it is now using SetWindowPos. Alternatively, you could just hide each window with the SW_HIDE flag to your ShowWindow call.

for (process in NotCurrentProcess())
{
    SetWindowPos(process.MainWindowHandle, HWND_BOTTOM, -10000, 0, 0, 0, SWP_NOSIZE|SWP_NOZORDER);

    // OR call ShowWindow(process.MainWindowHandle, SW_HIDE);

}
SetWindowPos(myProcess.MainWindowHandle, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE);
ShowWindowAsync(myProcess.MainWindowHandle, SW_SHOWMAXIMIZED);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top