minimizing dialog to system tray
-
i succeeded in making tray icon..bur how to minimize it to tray only when i click on minimize button.also after filling all three field which are asked and then when i press ok i want the dialog window to minimize to taskbar icon..please help me...my code is as follows: #include #include "resource.h" #include #include #include #include #include #include "FileOperation.h" #include #define WM_ICON_NOTIFY WM_USER+1 //--------------------------------------------------------------------------- LPSTR lpString; HWND hWnd; LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); //--------------------------------------------------------------------------- INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow) { DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLGFIRST),hWnd, reinterpret_cast(DlgProc)); return FALSE; } //--------------------------------------------------------------------------- LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { char cPath[20]; char cUserName[20]; char cPassword[20]; switch(Msg) { case WM_INITDIALOG: { } case WM_ICON_NOTIFY: { } case WM_LBUTTONDBLCLK: { ShowWindow(hWndDlg, IDD_DLGFIRST); break; } break; case WM_COMMAND: { switch(wParam) { case IDOK: { size_t nLen; GetDlgItemText(hWndDlg, IDC_EDIT1, cPath, 20); nLen = strlen(cPath); if (nLen == 0) { MessageBox(hWndDlg,"Please Enter SVN Path","Error",MB_ICONERROR); break; } GetDlgItemText(hWndDlg, IDC_EDIT2, cUserName, 20); nLen = strlen(cUserName); if (nLen == 0) { MessageBox(hWndDlg,"Please Enter your user name","Error",MB_ICONERROR); break; } GetDlgItemText(hWndDlg, IDC_EDIT3, cPassword, 20); nLen = strlen(cPassword); if (nLen == 0) { MessageBox(hWndDlg,"Please Enter your Password ","Error",MB_ICONERROR); break; } /*EndDialog(hWndDlg, 0);*/ /*std::ofstream file ("config.txt"); file << " SVN Path entered by user is -> "<" <"<
-
i succeeded in making tray icon..bur how to minimize it to tray only when i click on minimize button.also after filling all three field which are asked and then when i press ok i want the dialog window to minimize to taskbar icon..please help me...my code is as follows: #include #include "resource.h" #include #include #include #include #include #include "FileOperation.h" #include #define WM_ICON_NOTIFY WM_USER+1 //--------------------------------------------------------------------------- LPSTR lpString; HWND hWnd; LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); //--------------------------------------------------------------------------- INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow) { DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLGFIRST),hWnd, reinterpret_cast(DlgProc)); return FALSE; } //--------------------------------------------------------------------------- LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { char cPath[20]; char cUserName[20]; char cPassword[20]; switch(Msg) { case WM_INITDIALOG: { } case WM_ICON_NOTIFY: { } case WM_LBUTTONDBLCLK: { ShowWindow(hWndDlg, IDD_DLGFIRST); break; } break; case WM_COMMAND: { switch(wParam) { case IDOK: { size_t nLen; GetDlgItemText(hWndDlg, IDC_EDIT1, cPath, 20); nLen = strlen(cPath); if (nLen == 0) { MessageBox(hWndDlg,"Please Enter SVN Path","Error",MB_ICONERROR); break; } GetDlgItemText(hWndDlg, IDC_EDIT2, cUserName, 20); nLen = strlen(cUserName); if (nLen == 0) { MessageBox(hWndDlg,"Please Enter your user name","Error",MB_ICONERROR); break; } GetDlgItemText(hWndDlg, IDC_EDIT3, cPassword, 20); nLen = strlen(cPassword); if (nLen == 0) { MessageBox(hWndDlg,"Please Enter your Password ","Error",MB_ICONERROR); break; } /*EndDialog(hWndDlg, 0);*/ /*std::ofstream file ("config.txt"); file << " SVN Path entered by user is -> "<" <"<
Still haven't found the right discussion board?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Still haven't found the right discussion board?
Mark Salsbery Microsoft MVP - Visual C++ :java: