描述:
我按照书上写的,自己做了一个OpenGL的ActiveX控件!我想让它和我的Dialog一起变化大小,我该怎么写代码?
Dialog我也经用下面的代码最大化了。
//////////////////////////////////////////////////////////////////////
//剖面显示窗口
int cx, cy; //最大化设置
HDC dc = ::GetDC(NULL); //
cx = GetDeviceCaps(dc,HORZRES) + //
GetSystemMetrics(SM_CXBORDER); //
cy = GetDeviceCaps(dc,VERTRES) + //
GetSystemMetrics(SM_CYBORDER); //
::ReleaseDC(0,dc); //
//
//去除标题和边框 //
// SetWindowLong(m_hWnd, GWL_STYLE, //
// GetWindowLong(m_hWnd, GWL_STYLE) & //
// (~(WS_CAPTION | WS_BORDER))); //
//
// 置对话框为最顶端并扩充到整个屏幕 //
::SetWindowPos(m_hWnd, HWND_TOPMOST, //
-(GetSystemMetrics(SM_CXBORDER)+1), //
-(GetSystemMetrics(SM_CYBORDER)+1), //
cx+1,cy+1, SWP_NOZORDER); //
//////////////////////////////////////////////////////////////////////