I came up with this code today when I wanted to hide the main dialog at start up (only tray icon visible):



WM_HIDEDIALOG equ WM_USER+123
....

.if uMsg==WM_INITDIALOG
invoke SetWindowPos, hWin, 0, -10000, -10000, 0, 0, SWP_NOZORDER or SWP_NOSIZE or SWP_NOACTIVATE
invoke PostMessage, hWnd, WM_HIDEDIALOG, 0, 0
...

.elseif uMsg==WM_HIDEDIALOG
invoke ShowWindow, hWin, SW_HIDE



Hiding the dialog at startup has been a problem for me, but this seems to work so I decided to share it .
Posted on 2003-05-11 14:42:14 by Delight
Why not send an SW_SHOW or SW_HIDE as the dwInitParam sent to the dialog in the WM_INITDIALOG message when it's created, that way no user messages.

Edit:ah, you'll still need the user message. but it would still be a good idea to use the dwInitParam and make this part of your dialog template.
Posted on 2003-05-11 15:18:12 by donkey