Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After WM_INITDIALOG??

Status
Not open for further replies.

Skute

Programmer
Jul 21, 2003
272
GB
Hi,

anyone know what the next message after WM_INITDIALOG is?

Ive got a dialog application which needs to start hidden and minimised (just an icon in the system tray).

There is no point trying to hide and minimise in WM_INITDIALOG because DialogBox() automatically calls ShowWindow() afterwards doesnt it?
 
mayeb you have forgotten to put a break in your swith/case block.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
sorry, the above was for another thread
how about:
ShowWindow(hDlg, SW_HIDE)

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
no i havent, its a dialog app and im using message crackers:


HANDLE_MSG(hwnd, WM_COMMAND, g_pDialog->OnCommand);
HANDLE_MSG(hwnd, WM_INITDIALOG, g_pDialog->OnInitDialog);
HANDLE_MSG(hwnd, WM_SYSCOMMAND, g_pDialog->OnSysCommand);
HANDLE_MSG(hwnd, WM_TRAYNOTIFY, g_pDialog->OnTrayMessage);


-----------


BOOL CGUIDialog::OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
m_hWnd = hwnd;

SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MAIN)));
SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MAIN)));

this->InitNotifyIcon();
this->SetNotifyIcon(IDI_RED);

//ShowWindow(hwnd, SW_SHOWNORMAL);
//SendMessage(hwnd, WM_SYSCOMMAND, (WPARAM)SC_CLOSE, 0);

return TRUE;
}


After WM_INITDIALOG returns, it automatically calls ShowWindow() (its part of the DialogBox() function).
 
Ah OK :)

----


If you put a breakpoint on the "return TRUE;" line, it does actually hide the application, its just when it returns it automatically get shown again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top