测试代码:void CTestDlg::OnButton1()
{
// TODO: Add your control notification handler code here
WINDOWINFO wi;
RECT rcWnd, rcClient; ::GetWindowInfo(GetSafeHwnd(), &wi);
rcWnd = wi.rcWindow;
rcClient = wi.rcClient;
}
编译时总报错:
error C2065: 'WINDOWINFO' : undeclared identifier
error C2039: 'GetWindowInfo' : is not a member of '`global namespace''
error C2065: 'GetWindowInfo' : undeclared identifier但是换成函数::GetWindowRect(GetSafeHwnd(), &rcWnd)就没有问题了。WHY?
{
// TODO: Add your control notification handler code here
WINDOWINFO wi;
RECT rcWnd, rcClient; ::GetWindowInfo(GetSafeHwnd(), &wi);
rcWnd = wi.rcWindow;
rcClient = wi.rcClient;
}
编译时总报错:
error C2065: 'WINDOWINFO' : undeclared identifier
error C2039: 'GetWindowInfo' : is not a member of '`global namespace''
error C2065: 'GetWindowInfo' : undeclared identifier但是换成函数::GetWindowRect(GetSafeHwnd(), &rcWnd)就没有问题了。WHY?
解决方案 »
- error C2536:无法指定数组的显式初始值设定项
- 位图读取
- oninitdialog()内对某个控件setfous()无效?
- 如何创建大于64个线程
- 在ActiveX控件中使用多线程后Fire事件的问题
- 连接字符串中含有变量该如何处理?
- 如何在win2000下自定义纸张大小?
- 怎样在窗口或dialog上弄个洞出来?就是搞个透明区出来。
- sdk编程中,如何改变对话框中子控件的外观?
- 请教下,这样删除句柄后,再用m_hImageList会不会有问题
- 如何使一个用 WNetAddConnection2 打开的一个网络连接只供打开它程序使用,而其它进程不让使用?
- 怎样改变CListCtrl中的ScrollBar 的位置? (急)
这个是API函数,需要包含"Winuser.h" 或 "Windows.h"
不过如果在MFC下用可能会和MFC库冲突吧!
但是能否给以解释,或者给些相关的链接?
另,如何更新platform sdk?
#if(WINVER >= 0x0500)#endif /* WINVER >= 0x0500 */
中间,所以你得在你的工程中指定你的项目是winver>=0x0500的新的platform sdk不存在这个问题.platform sdk可从MS官方网站下载
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm