`

C语言 判断是否打开QQ登陆窗口

阅读更多

#include<windows.h>
#include <string.h>
#include <stdio.h>
BOOL CALLBACK lpEnumFunc(HWND hwnd, LPARAM lParam)
{
char str[100];
char *qqlogin="QQLoginMessageWnd";
::GetWindowText(hwnd,str,sizeof(str));

int s=::GetClassName(hwnd,str,100);
if(strchr(str, *qqlogin)!=0){
    printf("QQ Login Window!");
}

return 1;
}
int WINAPI WinMain(
  HINSTANCE hInstance,  // handle to current instance
  HINSTANCE hPrevInstance,  // handle to previous instance
  LPSTR lpCmdLine,      // pointer to command line
  int nCmdShow          // show state of window
)
{
    EnumWindows(lpEnumFunc,NULL);

}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics