dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: How to Close/Destroy a dialog from its OnInitDialog?

  1. #1
    Join Date
    May 1999
    Posts
    20

    How to Close/Destroy a dialog from its OnInitDialog?

    Hi!

    I need to destroy or close a dialog before
    it appears on screen - during its OnInitDialog.
    How can I do that?
    If I call DestroyWindow() the program crashes!

    Regards,
    Eyal Zucker



  2. #2
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    1,793

    Re: How to Close/Destroy a dialog from its OnInitDialog?

    use the EndDialog()
    dialog is not been closed by DestroyWindow()
    only by this func..
    HTH
    kishk91



  3. #3
    Join Date
    Aug 1999
    Location
    Germany
    Posts
    3

    Re: How to Close/Destroy a dialog from its OnInitDialog?

    Hi,

    simply send a WM_CLOSE Message to your dialog.

    PostMessage(WM_CLOSE,0,0);

    Rolf


    never touch a running system =:-(

  4. #4
    Guest

    Re: How to Close/Destroy a dialog from its OnInitDialog?

    Or...more easily........you can just return FALSE in the Init function and the dialog will never appear too. (So long as you do it before you hit the "ShowWindow" in your code...



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)