求一个使对话框程序启动时自动最小化的方法

n_ghost 2004-04-02 08:50:09
要求不闪的,我原来在OnPaint消息中使其最小化,不过每次启动总是会闪一下。请教一种不闪的方法。
...全文
139 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
jinweifu 2004-04-02
  • 打赏
  • 举报
回复
SW_HIDE 还有调用
BOOL Shell_NotifyIcon(DWORD dwMessage,PNOTIFYICONDATA lpdata); 具体就不知道了
lixiaosan 2004-04-02
  • 打赏
  • 举报
回复
看看这篇文章,你就知道怎么做了!
http://www.yesky.com/20021018/1635655.shtml
n_ghost 2004-04-02
  • 打赏
  • 举报
回复
如果我想启动时候最小化到托盘呢,麻烦各位了
Caps77 2004-04-02
  • 打赏
  • 举报
回复
同意 LongLongAgoImBoy(ThereIsAMe)
n_ghost 2004-04-02
  • 打赏
  • 举报
回复
MessageMap中需要添加什么消息啊 有参数么?
醉马不肖 2004-04-02
  • 打赏
  • 举报
回复
SetParent
The SetParent function changes the parent window of the specified child window.

HWND SetParent(
HWND hWndChild, // handle to window
HWND hWndNewParent // new parent window
);
Parameters
hWndChild
[in] Handle to the child window.
hWndNewParent
[in] Handle to the new parent window. If this parameter is NULL, the desktop window becomes the new parent window.
Windows 2000/XP: If this parameter is HWND_MESSAGE, the child window becomes a message-only window.

Return Values
If the function succeeds, the return value is a handle to the previous parent window.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

ymbymb 2004-04-02
  • 打赏
  • 举报
回复
BOOL CMyDlg::OnInitDialog()
{
...
ShowWindow(SW_SHOWMINIMIZED);
return TRUE;
}
ymbymb 2004-04-02
  • 打赏
  • 举报
回复
BOOL CMyDlg::OnInitDialog()
{
...
ShowWindow(SW_SHOWMINIMIZED);
return TRUE;
}
快乐鹦鹉 2004-04-02
  • 打赏
  • 举报
回复
如果是模式的,那么将这句话加到OnInitDialog函数中。
red-fly 2004-04-02
  • 打赏
  • 举报
回复
一楼说得对
就在OnInitDialog()里边
快乐鹦鹉 2004-04-02
  • 打赏
  • 举报
回复
当然不能在OnPaint中了。你是模式的还是非模式的?非模式的可以用ShowWindow(SW_SHOWMINIMIZED)就可以了。
Jimmy_Xia 2004-04-02
  • 打赏
  • 举报
回复
在初始化对话框函数OnInitDialog()中加入:ShowWindow(SW_SHOWMINIMIZED);
酒红绿叶 2004-04-02
  • 打赏
  • 举报
回复
添加虚函数,Init在里面写就可以了!

this->showwindow(SW_SHOWMINIMIZED)

16,471

社区成员

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

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

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