如何侦测窗口风格改变?

allenhiman 2016-11-09 10:42:38
一些特殊的需求 我需要知道一个窗口在什么时候被改变了风格。
是有什么消息吗? 这个窗口一开始是popup类型的,过了一会后变成childwindow了 我怎么知道它什么时候改变了这个风格呢?
...全文
253 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
allenhiman 2016-11-17
  • 打赏
  • 举报
回复
okay 那应该是WM_STYLECHANGED的吧 不过由于需求改变了 我就不实验了
赵4老师 2016-11-09
  • 打赏
  • 举报
回复
Hook SetWindowLong ?
schlafenhamster 2016-11-09
  • 打赏
  • 举报
回复
Sorry, 写错了! if(style & WS_POPUP) { AfxMessageBox("WS_POPUP"); } else if(style & WS_CHILD) { AfxMessageBox("WS_CHILD"); }
schlafenhamster 2016-11-09
  • 打赏
  • 举报
回复
void CxxxxDlg::OnBtStyle() { // TODO: Add your control notification handler code here LONG style=GetWindowLong(m_hWnd,GWL_STYLE); if(style | WS_POPUP) { AfxMessageBox("WS_POPUP"); } else { AfxMessageBox("WS_CHILD"); } }
schlafenhamster 2016-11-09
  • 打赏
  • 举报
回复
WM_STYLECHANGED The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles. WM_STYLECHANGED wStyleType = wParam; // windows styles or extended styles lpss = (LPSTYLESTRUCT) lParam; // structure containing new styles Parameters wStyleType Value of wParam. Specifies whether the window's styles or extended styles have changed. This parameter can be a combination of the following values: Value Meaning GWL_EXSTYLE The window's extended styles have changed. GWL_STYLE The window's styles have changed. lpss Value of lParam. Pointer to a STYLESTRUCT structure that contains the new styles for the window. An application can examine the styles, but can not change them. Return Values An application should return zero if it processes this message.
hurryboylqs 2016-11-09
  • 打赏
  • 举报
回复
响应WM_STYLECHANGED

15,978

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧