[求助]请问如何自己控制对话框的最大化、还原和最小化?

lvgame 2005-04-12 10:42:44
我想自己画Button来实现最大化,还原和最小化的功能,请问该如何做?发什么消息呢?

还有,有没有什么函数是处理最大化还原和最小化的呢?

谢谢。
...全文
201 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kudeet 2005-04-12
  • 打赏
  • 举报
回复
参考
http://www.vckbase.com/document/viewdoc/?id=317
jeniminon 2005-04-12
  • 打赏
  • 举报
回复
同意楼上~
老夏Max 2005-04-12
  • 打赏
  • 举报
回复
PostMessage(WM_SYSCOMMAND,MAKEWPARAM(SC_MINIMIZE,0),0);//最小化
PostMessage(WM_SYSCOMMAND,MAKEWPARAM(SC_MAXIMIZE,0),0);//最大化
PostMessage(WM_SYSCOMMAND,MAKEWPARAM(SC_RESTORE,0),0);//还原
lvgame 2005-04-12
  • 打赏
  • 举报
回复
呵呵,谢谢大家了!

结贴。
DentistryDoctor 2005-04-12
  • 打赏
  • 举报
回复
The ShowWindow function sets the specified window's show state.

Syntax

BOOL ShowWindow( HWND hWnd,
int nCmdShow
);
Parameters

hWnd
[in] Handle to the window.
nCmdShow
[in] Specifies how the window is to be shown. This parameter is ignored the first time an application calls ShowWindow, if the program that launched the application provides a STARTUPINFO structure. Otherwise, the first time ShowWindow is called, the value should be the value obtained by the WinMain function in its nCmdShow parameter. In subsequent calls, this parameter can be one of the following values.
SW_FORCEMINIMIZE
Windows 2000/XP: Minimizes a window, even if the thread that owns the window is hung. This flag should only be used when minimizing windows from a different thread.
SW_HIDE
Hides the window and activates another window.
SW_MAXIMIZE
Maximizes the specified window.
SW_MINIMIZE
Minimizes the specified window and activates the next top-level window in the Z order.
SW_RESTORE
Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
SW_SHOW
Activates the window and displays it in its current size and position.
SW_SHOWDEFAULT
Sets the show state based on the SW_ value specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application.
SW_SHOWMAXIMIZED
Activates the window and displays it as a maximized window.
SW_SHOWMINIMIZED
Activates the window and displays it as a minimized window.
SW_SHOWMINNOACTIVE
Displays the window as a minimized window. This value is similar to SW_SHOWMINIMIZED, except the window is not activated.
SW_SHOWNA
Displays the window in its current size and position. This value is similar to SW_SHOW, except the window is not activated.
SW_SHOWNOACTIVATE
Displays a window in its most recent size and position. This value is similar to SW_SHOWNORMAL, except the window is not actived.
SW_SHOWNORMAL
Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

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