如何给窗口发送消息让其显示

zzz_zou 2010-10-12 10:47:01
PostMessage(m_hwnd, SW_SHOWWINDOW, , );
后面2个参数填什么啊 0 0
...全文
317 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzz_zou 2010-10-14
  • 打赏
  • 举报
回复
有道理
zzz_zou 2010-10-14
  • 打赏
  • 举报
回复
我的窗口是非模态 , 是不是就没办法发送消息让其显示了- -
Sou2012 2010-10-14
  • 打赏
  • 举报
回复
或者自定义一个消息,在消息响应里再添加显示窗口的代码。
aj3423 2010-10-13
  • 打赏
  • 举报
回复
贴窗口的代码吧, 如果只是子窗口的话,用vc自带的spy++看一下先,到底是窗口在那没显示 还是根本不在那
傻X 2010-10-13
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 muzizongheng 的回复:]
这个要看你的床体是否是非模的了。 如果是, 这个消息会被它忽略的。
[/Quote]

这个才是问题所在吧。
zzz_zou 2010-10-13
  • 打赏
  • 举报
回复
我确定句柄正确,并且可以显示!
向立天 2010-10-13
  • 打赏
  • 举报
回复
你确定目标窗口是可以显示的并且你的句柄正确么?
zzz_zou 2010-10-13
  • 打赏
  • 举报
回复
OK,我多看看,WS_VISIBLE时TRUE的。 FALSE我也试了,还是不出来。
youfeng888 2010-10-13
  • 打赏
  • 举报
回复
可以发送消息PostMessage,在对应的窗口里面定义相应的消息,实现你的功能既可以了!
欢迎来我空间看看,希望能找到需要的
test_machine 2010-10-12
  • 打赏
  • 举报
回复
你窗口是的属性是WS_VISIBLE吗?
dong918 2010-10-12
  • 打赏
  • 举报
回复
是不是要用send?
ShowWindow函数应该发的是个不进对消息?

猜测,仅供参考。。
zzz_zou 2010-10-12
  • 打赏
  • 举报
回复
我必须要通过发消息才行的- -
zzz_zou 2010-10-12
  • 打赏
  • 举报
回复
就是使用不成功诶
我想要show的窗口,之前是没有显示出来的,初始化了而已。
PostMessage(m_hwnd, WM_SHOWWINDOW, TRUE , NULL) 我使用失败
fishion 2010-10-12
  • 打赏
  • 举报
回复
ShowWindow(m_hwnd,SW_SHOW)
dong918 2010-10-12
  • 打赏
  • 举报
回复
msdn..


/*
WM_SHOWWINDOW Notification

--------------------------------------------------------------------------------

The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.

A window receives this message through its WindowProc function.


Syntax


WM_SHOWWINDOW

WPARAM wParam
LPARAM lParam;

Parameters

wParam
Specifies whether a window is being shown. If wParam is TRUE, the window is being shown. If wParam is FALSE, the window is being hidden.
lParam
Specifies the status of the window being shown. If lParam is zero, the message was sent because of a call to the ShowWindow function; otherwise, lParam is one of the following values.
SW_OTHERUNZOOM
The window is being uncovered because a maximize window was restored or minimized.
SW_OTHERZOOM
The window is being covered by another window that has been maximized.
SW_PARENTCLOSING
The window's owner window is being minimized.
SW_PARENTOPENING
The window's owner window is being restored.
Return Value

If an application processes this message, it should return zero.




Remarks

The DefWindowProc function hides or shows the window, as specified by the message. If a window has the WS_VISIBLE style when it is created, the window receives this message after it is created, but before it is displayed. A window also receives this message when its visibility state is changed by the ShowWindow or ShowOwnedPopups function.

The WM_SHOWWINDOW message is not sent under the following circumstances:


When a top-level, overlapped window is created with the WS_MAXIMIZE or WS_MINIMIZE style.
When the SW_SHOWNORMAL flag is specified in the call to the ShowWindow function.

Notification Requirements

Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1

See Also

Windows Overview, DefWindowProc, ShowOwnedPopups, ShowWindow

*/


zzz_zou 2010-10-12
  • 打赏
  • 举报
回复
或则说 要想通过发送消息让窗口显示需要什么前提条件!
zzz_zou 2010-10-12
  • 打赏
  • 举报
回复
这样也show不出来。。。
__Silent 2010-10-12
  • 打赏
  • 举报
回复
0,0 就可以了吧
muzizongheng 2010-10-12
  • 打赏
  • 举报
回复
这个要看你的床体是否是非模的了。 如果是, 这个消息会被它忽略的。

15,979

社区成员

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

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