猿问

请帮忙,玫举所有窗口标题,并显示出来;并且要能运行的,谢谢~

求助 C++ ApI 问题 怎样用 EnumChildWindows( hwnd, WNDENUMPROC lpEnumFunc, LPARAM lParam );

SMILET
浏览 220回答 2
2回答

皈依舞

这是win32程序,当然不能这么用,你要建立一个win32或者mfc的程序看到下面这个没有:BOOL CALLBACK

守候你守候我

#include <windows.h>#pragma comment(lib,"user32.lib")BOOL CALLBACK EnumChildProc(HWND hwnd,LPARAM lParam) {LPWSTR lpString = (LPWSTR)malloc(1024 * sizeof(WCHAR));GetWindowText(hwnd,lpString,1024);wprintf(L"%s\n",lpString);return true;}int main(int argc, char* argv[]){EnumChildWindows(0,EnumChildProc,NULL);//EnumWindows(EnumChildProc,NULL;return 0;}
随时随地看视频慕课网APP
我要回答