下面为MFC 编程:
int flag =0;
HWND g_hWnd = NULL;
BOOL CALLBACK EnumChildProc(
HWND hwnd, // handle to child window
LPARAM lParam // application-defined value
)
{
char szName[255]="";
::GetClassName(hwnd,szName,255);
flag++;
if (flag == 28)
{
g_hWnd = hwnd;
return FALSE;
}
return TRUE;
}
void CMFCtestDlg::OnHide()
{
HWND hwnd = ::FindWindow(NULL,"PEiD v0.95");
EnumChildWindows(hwnd,EnumChildProc,NULL); ;动态枚举窗口句柄
::ShowWindow(g_hWnd,SW_HIDE);
}
void CMFCtestDlg::OnShow()
{
// TODO: Add your control notification handler code here
::ShowWindow(g_hWnd,SW_SHOW);
}