Skip to content

Instantly share code, notes, and snippets.

@JubbaSmail
Created November 13, 2014 10:00
Show Gist options
  • Save JubbaSmail/b7a275e7852edfc1a53a to your computer and use it in GitHub Desktop.
Save JubbaSmail/b7a275e7852edfc1a53a to your computer and use it in GitHub Desktop.
#include <windows.h>
#if define UNICODE
#define FindWindow FindWindowW
#else
#define FindWindow FindWindowA
#endif
void Hide()
{
/* Retrieves a handle to the top-level window whose class name and window name match the specified strings.
1st Parmeter lpClassName: ConsoleWindowClass - Class Name
2nd Parameter lpWindowName: parameter is NULL, all window names match.
If the function succeeds, the return value is a handle to the window that has the specified class name and window name.
If the function fails, the return value is NULL.
*/
HANDLE stealth = FindWindow("ConsoleWindowClass", NULL);
if (stealth != INVALID_HANDLE_VALUE)
{
ShowWindow(stealth, FALSE);
Sleep(3000);
ShowWindow(stealth, TRUE);
}
}
int main(int argc, LPTSTR argv[])
{
Hide();
while (TRUE)
{
Sleep(100);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment