我打开了windows自己带的计算器,然后用spy++取得类名和窗口名hwnd=::FindWindow("SciCalc","计算器");为什么得不到正确的句柄?我是在2003下运行的
解决方案 »
- 请问一下,同一个程序在WIFI下是通讯是正常的,在GPRS下就不通了,可能有哪些原因?
- 一个很奇怪的问题?
- 分屏问题
- 串口通讯中莫名其妙的问题
- 请问,使用socket的recv()函数时返回SOCKET_ERROR,用函数WSAGetLastError()返回WSAECONNABORTED(由于超时或其他错误导致虚电路中止),
- 问题:有关回调函数
- 如何在SDI中实现tab view???
- create创建了一个CWnd,如何让其显示在屏幕的中间位置呀?而不是从屏幕的(0,0)开始。
- 从EXCEL中读数据到自己的程序中的问题
- 高手,怎么做浮动菜单?我搞不清楚也.
- 求一个能运行的简单 包过滤 的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,"计算器");