获取PC本地登录的QQ号码
1 #include <windows.h> 2 #include <stdio.h> 3 #include <string.h> 4 5 BOOL CALLBACK enumwindowsproc(HWND hwnd,LPARAM lParam){ 6 char name[255]={0}; 7 char rp[] = "qqexchangewnd_shortcut_prefix_"; 8 int l = strlen(rp); 9 GetWindowText(hwnd,name,255); 10 if(strstr(name,rp)){ 11 printf("%X\t%s\n",hwnd,name+l); 12 } 13 return 1; 14 } 15 16 int main(){ 17 EnumWindows(enumwindowsproc,NULL); 18 }
测试环境:win7 64bit
编译环境:cfree mingw5