如何创建子窗口(SDK)
m_createStruct.dwExStyle=WS_VISIBLE|WS_CAPTION|WS_CHILD;m_createStruct.hwndParent=fwP...
m_createStruct.dwExStyle=WS_VISIBLE|WS_CAPTION|WS_CHILD;
m_createStruct.hwndParent=fwParent.getWndHandle();
//id是子窗口的id,为1
m_createStruct.hMenu=(HMENU)id; //用HMENU设置子窗口的ID老是不成功
m_hWnd=::CreateWindow(
m_createStruct.lpszClass,
m_createStruct.lpszName,
m_createStruct.style,
m_createStruct.x,
m_createStruct.y,
m_createStruct.cx,
m_createStruct.cy,
m_createStruct.hwndParent,
m_createStruct.hMenu,
m_createStruct.hInstance,
m_createStruct.lpCreateParams);
int err=::GetLastError();
为什么CreateWindow之后会m_hWnd还是0,err为1401,无效的菜单句柄。
用id567后,GetLastError得到6,The handle is invalid. 展开
m_createStruct.hwndParent=fwParent.getWndHandle();
//id是子窗口的id,为1
m_createStruct.hMenu=(HMENU)id; //用HMENU设置子窗口的ID老是不成功
m_hWnd=::CreateWindow(
m_createStruct.lpszClass,
m_createStruct.lpszName,
m_createStruct.style,
m_createStruct.x,
m_createStruct.y,
m_createStruct.cx,
m_createStruct.cy,
m_createStruct.hwndParent,
m_createStruct.hMenu,
m_createStruct.hInstance,
m_createStruct.lpCreateParams);
int err=::GetLastError();
为什么CreateWindow之后会m_hWnd还是0,err为1401,无效的菜单句柄。
用id567后,GetLastError得到6,The handle is invalid. 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询