Minimize to Tray & SDI



  • Hallo

    wie man eine Dialogbasierende Anwendung in den Traybereich bekommt findet man hier ja 1000 Beiträge zu. Aber ich will das bei ner SDI machen und da find ich hier garnichts 😞
    Ich hab schon ne ganze weile dran getüddelt.. aber nu brauch ich mal wieder eure Hilfe. *schäm* 😡



  • Ahh ich hab es nun geschaft.
    In der CMailFrame

    void CMainFrame::OnSize(UINT nType, int cx, int cy) 
    {
    	CFrameWnd::OnSize(nType, cx, cy);
    	if (nType == SIZE_MINIMIZED)
    	{
    		NOTIFYICONDATA tnd; 
    	    ZeroMemory(&tnd, sizeof (NOTIFYICONDATA)); 
    	    tnd.cbSize = sizeof (NOTIFYICONDATA); 
    	    tnd.hWnd = this ->m_hWnd; 
    	    tnd.uID = 1; 
    	    tnd.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP; 
    	    tnd.uCallbackMessage = WM_NOTIFICATION; 
    	    tnd.hIcon = (HICON) LoadImage(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_MINI),IMAGE_ICON,16,16,LR_SHARED|LR_DEFAULTCOLOR);
    	    tnd.szTip[63]='\0'; 
    	    lstrcpyn(tnd.szTip,"Progname",sizeof(tnd.szTip)); 
    	    Shell_NotifyIcon(NIM_ADD,&tnd); 
    	    ShowWindow(SW_HIDE);
    	} 
    }
    

    Aber wie bekomm ich da nu n menü rein?

    OnTrayNotifikation find ich nicht bei meiner SDI Anwendung


Anmelden zum Antworten