标题:程序隐藏运行
取消只看楼主
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
结帖率:79.17%
 问题点数:0 回复次数:5 
程序隐藏运行
大家指教下,如何让一个程序在后台隐藏运行呢 ??
搜索更多相关主题的帖子: 程序 隐藏 运行 后台 指教 
2008-05-25 20:44
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
得分:0 
回复 2# 随心 的帖子
这个我试过了 不行 (我是在对话框初始化部分加入的)

BOOL CDialogExampleApp::InitInstance()
{
    // Standard initialization
    // If you are not using these features and wish to reduce the size
    //  of your final executable, you should remove from the following
    //  the specific initialization routines you do not need.

#ifdef _AFXDLL
    Enable3dControls();            // Call this when using MFC in a shared DLL
#else
    Enable3dControlsStatic();    // Call this when linking to MFC statically
#endif

    CDialogExampleDlg dlg;
    m_pMainWnd = &dlg;
   
    int nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
        // TODO: Place code here to handle when the dialog is
        //  dismissed with OK
    }
    else if (nResponse == IDCANCEL)
    {
        // TODO: Place code here to handle when the dialog is
        //  dismissed with Cancel
    }
 
      ShowWindow(SW_HIDE);  // 添加在这里 ,好像ShowWindow要两个参数
   
    return FALSE;
}
提示 error C2660: 'ShowWindow' : function does not take 1 parameters
2008-05-25 22:45
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
得分:0 
回复 3# p1s 的帖子
如果你方便的话,两个都给讲讲吧@
我一点思绪也没有 ,谢谢了
2008-05-25 22:47
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
得分:0 
回复 7# 随心 的帖子
那应该哪里添加的呢 ?
2008-05-26 00:21
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
得分:0 
回复 6# 随心 的帖子
LRESULT CMainFrame::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
    // TODO: Add your specialized code here and/or call the base class
   
    if(message==133 )
        ShowWindow(SW_HIDE);
    return CDialog::DefWindowProc(message, wParam, lParam);
}
有什么吗作用?我好像单单使用了
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
        // TODO: Add your specialized code here and/or call the base class

        cs.style = WS_POPUP;                                //使主窗口不可见
    cs.dwExStyle |=WS_EX_TOOLWINDOW;        //不显示任务按钮

        return CDialog::PreCreateWindow(cs);
}
就发现已经是实现了隐藏功能?
2008-05-26 00:26
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
得分:0 
回复 10# 随心 的帖子
第一千零一添,也希望像第一千零一夜一样,终于找到自己的爱情
2008-05-26 12:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-215899-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.135571 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved