#include <windows.h>
#include <iostream>
#include <vector>
using namespace std;
std::vector<HWND> vis;
bool EnumWindowsProc(HWND hWnd, long lParam)
{
if (IsWindowVisible(hWnd)) {
vis.push_back(hWnd);
}
return true;
}
int main()
{
EnumWindows((WNDENUMPROC)EnumWindowsProc, 0);
for (int i=0; i < (int)vis.size(); i++) {
ShowWindow(vis[i], SW_HIDE);
}
Sleep(10000);
for (int i=0; i < (int)vis.size(); i++) {
ShowWindow(vis[i], SW_SHOW);
}
return 0;
}
Just remember to add code which prevents you from hiding the console window (ie: the one that they need in order to type in their password). This program as it is now, simply hides all windows for a short amount of time, and then makes them show up again.