[英]How can i check for specific window name while enumerating EnumChildProc in WinApi?
So far i have been using GetClassName() to get a window handle with the class name that interested me while enumerating with EnumChildProc() but right now i am in situation where plenty of HWND's use the same classname so only way to identify my window i assume would be with its name which is unique. 到目前为止,我一直在使用GetClassName()获取带有我感兴趣的类名的窗口句柄,同时使用EnumChildProc()进行枚举,但是现在我处于大量HWND使用相同的类名的情况,因此这是唯一可识别我的窗口的方法假设将使用其唯一名称。
So while i am enumerating i was thinking to use something like... 因此,当我枚举时,我正在考虑使用类似...
If getwindowname() == what i need... but i have no idea what function can i use for this, is there a function like getwindowname() that i can use in this enumeration? 如果getwindowname()==我需要...但是我不知道我可以为此使用什么功能,是否可以在此枚举中使用像getwindowname()这样的功能?
this.. worked 这个..工作
TCHAR winname[MAX_PATH]; long lenght; HWND hwndineed; BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) { lenght = SendMessage(hwnd, WM_GETTEXT, 99, (LPARAM)winname); if(wcscmp(winname, _T("caption i needed")) == 0) { hwndineed= hwnd; return FALSE; // end enumeration } }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.