코드
FindWindow
by umaking
2010. 7. 13.
HWND hWnd = NULL;
HWND phWnd = NULL;
HDC hDC = NULL;
char word[0xff];
AnsiString tmp = "--TRAY";
AnsiString titl = "";
hWnd = FindWindow("#32770", NULL);
if(hWnd)
{
GetWindowText(hWnd, word, 0xfe);
titl = AnsiString(word);
phWnd = GetParent(hWnd);
GetWindowText(phWnd, word, 0xfe);
if(memcmp(word, tmp.c_str(), tmp.Length()) != 0)
return;
hWnd = FindWindowEx(hWnd, 0, NULL, "확인");
if(hWnd)
{
SendMessage(hWnd, WM_LBUTTONDOWN, 0, 0);
SendMessage(hWnd, WM_LBUTTONUP, 0, 0);
Memo1->Lines->Add("닫음 - " + titl);
}
}