Skip to content

Instantly share code, notes, and snippets.

@velikodniy
Created October 26, 2012 19:56
Show Gist options
  • Save velikodniy/3961081 to your computer and use it in GitHub Desktop.
Save velikodniy/3961081 to your computer and use it in GitHub Desktop.
IE closer
#include <windows.h>
#include <string.h>
const char FILTER[] = "Internet Explorer";
BOOL CALLBACK CloseWindow(HWND h, LPARAM lparam)
{
char buff [256]; // I know, I know...
GetWindowText(h, (LPTSTR)buff, 256);
if(strstr(buff, FILTER) != NULL)
PostMessage(h, WM_CLOSE, 0, 0);
return TRUE;
}
void main()
{
EnumWindows(&CloseWindow, (LPARAM)0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment