CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2005
    Posts
    1,030

    A question regarding DestroyWindow

    If a window is created by calling Create, the function DestroyWindow must be called to destroyed it at the end? Thanks.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: A question regarding DestroyWindow

    What does msdn tell you? Does DestroyWindow docs reference CreateWindow or CreateWindowEx? What does the remarks section in each api tell you.

    I mean I could answer this question directly but I wonder why you ask it since the info is available so easily in msdn online.

  3. #3
    Join Date
    Jul 2005
    Posts
    1,030

    Re: A question regarding DestroyWindow

    Quote Originally Posted by Arjay View Post
    What does msdn tell you? Does DestroyWindow docs reference CreateWindow or CreateWindowEx? What does the remarks section in each api tell you.

    I mean I could answer this question directly but I wonder why you ask it since the info is available so easily in msdn online.
    Yes, DestroyWindow docs does reference CreateWindow and CreateWindowEx. Okey, I may assume if a window is created by calling CreateWindow, then it must be destroyed by calling DestroyWindow. But what if I don't call DestroyWindow to destroy window created by the function Create? Programming is not about memorize some rules and programming is about knowing everything in and out instead.

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: A question regarding DestroyWindow

    Quote Originally Posted by LarryChen View Post
    Yes, DestroyWindow docs does reference CreateWindow and CreateWindowEx. Okey, I may assume if a window is created by calling CreateWindow, then it must be destroyed by calling DestroyWindow. But what if I don't call DestroyWindow to destroy window created by the function Create? Programming is not about memorize some rules and programming is about knowing everything in and out instead.
    Programming is about trying things and see how they work, reading documentation and about working independently. If you've been at it for 8 or more years, it's about giving back to the forum rather than using it as your personal replacement for figuring things out on your own. Just once Larry, just once, why don't you answer somebody's question for a change.

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: A question regarding DestroyWindow

    Quote Originally Posted by LarryChen View Post
    But what if I don't call DestroyWindow to destroy window created by the function Create? Programming is not about memorize some rules and programming is about knowing everything in and out instead.
    Do you know what a window handle is? Do you know if Windows has a max limit for the number of opened windows handles? Do you know what DestroyWindow does? CloseHandle?

    Sure, programming isn't about memorizing some rules - it is about understanding. So go do some research. Read up on Petzold and Richter and spend some time giving yourself a sufficient background so you don't need to ask the never ending obvious questions.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured