我打开了windows自己带的计算器,然后用spy++取得类名和窗口名hwnd=::FindWindow("SciCalc","计算器");为什么得不到正确的句柄?我是在2003下运行的
解决方案 »
- 关于IXMLHTTPRequestPtr的setRequestHeader函数疑问
- [求助]MFC中printf、cout这些命令是不可以使用的吗?
- 各位大神,CStatic控件里怎么才能响应WM_CHAR消息
- vc++断网代码
- oracle与access日期时间格式的问题
- .exe中查找数据块的问题
- 高手请进,在线等:数据库ACESS,要用到sum,group by 等查询,总是报莫名其妙的错,救命啊
- 开发API有什么用呀!
- 关于cdhtmldialog打开网页的问题
- 注册表操作问题.编译老是提示一个错误!
- 求一个能运行的简单 包过滤 的SPI例字程序
- VC6访问WebService,返回Soap:Server
hwnd 0xccccccc
unused cxx0030:error:expression cannot be evaluated
LPCTSTR lpWindowName
);
ParameterslpClassName
[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. // /////////////////////////
你可以直接这样:
hwnd=::FindWindow(NULL, "计算器");
if(hwnd == NULL)
{
TRACE("Error: %d\n", GetLastError());
}
SciCalc
hwnd 0xccccccc
unused cxx0030:error:expression cannot be evaluated
这个问题不大的。建议你使用spy++ 先看看计算器的句柄是多少。看看是否是你真的没有找对。
你在看看hwnd的值是否有。
这个语句运行前如果你没有对hwnd赋初值智能感知就会显示hwnd 0xccccccc
FindWindow(NULL,"计算器");