mrfangzheng

Hope and fear are useless. Be confident, and always be prepared for the worst.
  首页  :: 新随笔  :: 联系 :: 管理

Win32 : 无标题栏, 可改变大小的窗口

Posted on 2010-03-23 13:51  mrfangzheng  阅读(742)  评论(0编辑  收藏  举报

改变窗口的Style

1. 无标题栏

2. 可改变大小

 

代码
HWND hwnd = this->m_hWnd;
int index = GWL_STYLE;

// read existing value
LONG styleValue = ::GetWindowLong(hwnd, index);

// change
styleValue &= ~WS_CAPTION;

// take effect
::SetWindowLong(hwnd, GWL_STYLE, styleValue);
::SetWindowPos(hwnd, NULL, 
0000, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);