Dialog Base ÇÁ·Î±×·¥À» Tray¿¡ µî·ÏÇÒ ¶§ ¹®Á¦Á¡


1. ¿ä¾à

Dialog Base ÇÁ·Î±×·¥À» Tray¿¡ µî·ÏÇÒ ¶§ ´ëºÎºÐ Window¸¦ Hide½ÃÄѼ­ ½ÇÇàÇÏ°Ô µÈ´Ù. ±×·±µ¥ Dialog Base·Î ÇÁ·Î±×·¥ ÀÛ¼ºÇϸé ÇÁ·Î±×·¥ÀÌ Ã³À½ ½ÇÇàµÇ¸é¼­ È­¸é¿¡ Àá±ñ ³ªÅ¸³µ´Ù°¡ »ç¶óÁö´Â ¸ð½ÀÀ» º¼ ¼ö ÀÖ´Ù. ÀÌ·± Çö»óÀ» ÇÇÇÒ ¼ö ÀÖ´Â ¹æ¹ýÀ» ¼Ò°³ÇÑ´Ù.



2. º»¹®

CwinApp::InitInstance()¸¦ OverrideÇÑ °÷À» »ìÆìº¸¸é ´ÙÀ½°ú °°ÀÌ µÇ¾îÀÖ´Ù.


BOOL CTrayApp::InitInstance() 

{ 

    ¡¦ 

    CTrayDlg 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 

    } 



    // Since the dialog has been closed, return FALSE so that we exit the 

    //  application, rather than start the application's message pump. 

    return FALSE; 

} 


À§ÀÇ ¼Ò½º¸¦ º¸¸é Dialog¸¦ Modal·Î ¶ç¿ì°Ô µÇ¾ú´Ù. ÀÌ ºÎºÐÀ» Modeless·Î ¶ç¿ì°Ô µÇ¸é °£´ÜÇÏ°Ô ÇØ°áµÈ´Ù.


3. ¿¹Á¦


BOOL CTrayApp::InitInstance() 

{ 

    ... 

    CTrayDlg* pDlg = new CTrayDlg; 



    if (!pDlg->Create(IDD_TRAY_DIALOG)) 

        return FALSE; 

    m_pMainWnd = pDlg; 

    pDlg->ShowWindow(SW_HIDE); 

    pDlg->UpdateWindow(); 

    return TRUE;    // ¹Ýµå½Ã TRUE 

} 



ÀÌ·¸°Ô Çϸé Dialog Window°¡ óÀ½ ½ÇÇàµÉ ¶§ ±× ¸ð½ÀÀÌ º¸¿´´Ù »ç¶óÁö´Â °ÍÀ» ¸·À» ¼ö ÀÖ´Ù.
ÇѰ¡Áö Áß¿äÇÑ °ÍÀº Dialog°¡ Á¾·áµÉ ¶§ ÇÒ´çµÈ Memory¸¦ »èÁ¦ÇØ¾ß ÇÑ´Ù. À̰ÍÀº Dialog WindowÀÇ PostNcDestroy()¿¡¼­ ó¸® ÇØÁÖ¸é µÈ´Ù.


void CTrayDlg::PostNcDestroy() 

{ 

    // TODO: Add your specialized code here and/or call the base class 

    delete this; 

    CDialog::PostNcDestroy(); 

} 



4. Âü°í


- 2001.08.06 Smile Seo -