求助 C++ ApI 問題 怎樣用 EnumChildWindows( hwnd, WNDENUMPROC lpEnumFunc, LPARAM lParam );
2 回答

守候你守候我
TA貢獻1802條經驗 獲得超10個贊
#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;
}
- 2 回答
- 0 關注
- 210 瀏覽
添加回答
舉報
0/150
提交
取消