永发信息网

求助,VC++中findwindows用法??

答案:2  悬赏:80  手机版
解决时间 2021-02-28 20:09
例如想获取游戏的窗口句柄,而游戏标题是“天涯”!!??????
最佳答案
The FindWindow function retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search.

To search child windows, beginning with a specified child window, use the FindWindowEx function.

Syntax

HWND FindWindow( LPCTSTR lpClassName,
LPCTSTR lpWindowName
);
Parameters

lpClassName
[in] Pointer to a null-terminated string that specifies the class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero.
If lpClassName points to a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names.

If lpClassName is NULL, it finds any window whose title matches the lpWindowName parameter.

lpWindowName
[in] Pointer to a null-terminated string that specifies the window name (the window's title). If this parameter is NULL, all window names match.
Return Value

If the function succeeds, the return value is a handle to the window that has the specified class name and window name.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

If the lpWindowName parameter is not NULL, FindWindow calls the GetWindowText function to retrieve the window name for comparison. For a description of a potential problem that can arise, see the Remarks for GetWindowText.

To check if the Microsoft® IntelliType version 1.x software is running, call FindWindow as follows:

FindWindow("MSITPro::EventQueue",NULL);
To check if the IntelliType version 2.0 software is running, call FindWindow as follows:

FindWindow("Type32_Main_Window", NULL);
If the IntelliType software is running, it sends WM_APPCOMMAND messages to the application. Otherwise the application must install a hook to receive WM_APPCOMMAND messages.

Microsoft Windows® 95 or later: FindWindowW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.

为什么不在MSDN中查查呢.以上是在MSDN中找到的.
全部回答
HWND hwnd = ::FindWindow(NULL, _T("天涯"));
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
现在足球上谁的盘带最牛 退役的不算
某高等生物基因型为AaBb,为其某一时期的状态
练习小提琴怎样加强左手4指力度
宝田公寓怎么去啊,有知道地址的么
刘备招亲——弄假成真
我在QQ上和别的女人暧昧我该怎么得到老婆的原
石墨的性质中,与其它三种有本质区别的是AA.
襄垣县动物疫病预防控制中心怎么去啊,有知道
喜洋连锁便利店家友分店这个地址在什么地方,
虎牙怎么看回放
请问一下:听说有一种铅笔,写出的字迹与中性
金立f301触屏校准屏幕在哪
关于鲁智深的细节描写
临潼路/南运河南路(路口)在什么地方啊,我要
平凉方圆天艺广告装饰有限责任公司地址在哪,
推荐资讯
问道手游一斤大米是多少 5分
校园网可以同时登陆手机和电脑吗
苏州市吴中区临湖依利服装厂在哪里啊,我有事
有一种火锅就是各种丸子的那种,一般叫什么名
【隔壁的那个男人by靠靠】居住在我们隔壁的那
今年跟我喝不上酒的,明年再聚,什么意思?
山东枣庄烟草有限公司滕州营销部地址在什么地
求英文翻译:看得出来他真的很在乎你,他在吃
(15分)先天性眼睑下垂是显性基因(A)控制
设置会计科目应遵循的原则有()。A.合法性原
急求青年志愿者横幅
一头马两条路打一成语
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?