Re: Hide a DoModal

Tech-Archive recommends: Fix windows errors by optimizing your registry



That doesn't make sense. A modal dialog disables your main window, but if succeed in
making the dialog invisible, you can't dismiss it. The main window just gets disabled,
and if you are calling OnOK or OnCancel from within your dialog to make it disappear, the
entire app gets disabled for no apparent reason, which is exceptionally poor user
interface design.

Why do you think you want to do this? It sounds like you have not properly factored your
code to separate functionality from the dialog class, and that sounds like a design error.
joe

On Fri, 26 Sep 2008 15:07:46 -0700, "Michael Tissington" <michael@xxxxxxxxxxxxxxxxxxxxx>
wrote:

during call to my dlg.DoModal() before the dialog is shown for the first
time I'd like to hide it.
I have tried a ShowWindow(SW_HIDE) in the OnInitDialog but that did not
work.

How do I tell the DoModal to do everything except show the window ?
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: hide name box
    ... Add a Module and copy/paste all the code after my signature into its code window. ... ' Enables or disables a window. ... (ByVal hwnd As Long, _ ... Private Declare Function GetDesktopWindow Lib "user32" As Long ...
    (microsoft.public.excel.programming)
  • Re: Technical question about modal loops
    ... disabled window get any mouse events, because you can clearly see with Spy ... biggest problem I had was that, if I didn't disable the owner window, you ... if you click the task bar, the owner any owned windows (and their owned ... > It disables its owner because, for the sake of the experiment, it calls ...
    (microsoft.public.win32.programmer.ui)
  • Technical question about modal loops
    ... When a standard dialog box comes up, it clearly disables it's owner. ... So there's no way a standard disabled window would ... Is the frame window not really disabled? ...
    (microsoft.public.win32.programmer.ui)
  • Re: Hide the Name Box
    ... ' Enables or disables a window. ... (ByVal hwnd As Long, _ ... Private Declare Function GetDesktopWindow Lib "user32" As Long ...
    (microsoft.public.excel.programming)
  • Re: Hide the Name Box
    ... ' Enables or disables a window. ... (ByVal hwnd As Long, _ ... Private Declare Function GetDesktopWindow Lib "user32" As Long ...
    (microsoft.public.excel.programming)