读书人

quot;EnableWindow#039; : function does not

发布时间: 2012-06-15 19:37:05 作者: rapoo

"EnableWindow' : function does not take 2 parameters?
我查了MSDN,EnableWindow有两个参数,但是怎么会出现这种错误呢?
EnableWindow
The EnableWindow function enables or disables mouse and keyboard input to the specified window or control. When input is disabled, the window does not receive input such as mouse clicks and key presses. When input is enabled, the window receives all input.

BOOL EnableWindow(
HWND hWnd, // handle to window
BOOL bEnable // flag for enabling or disabling input
);

————编程小菜

[解决办法]
BOOL EnableWindow(
HWND hWnd, // handle to window
BOOL bEnable // flag for enabling or disabling input
);
这是一个全局函数. 但是在CWnd派生出来的类中对这个函数中了重载,就只需要一个参数了.
所以,如果你是在对话框之类的类中使用的话,可以不要HWND这个参数.如果要用这个两个参数的函数,你就在函数前面加下"::" . 例如 ::EnableWindow(hWnd,TRUE);
[解决办法]

C/C++ code
::EnableWindow 

读书人网 >VC/MFC

热点推荐