1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to destroy or close the window and create the new window

Discussion in 'Win32' started by vidhya, May 24, 2007.

  1. vidhya

    vidhya New Member

    Joined:
    May 17, 2007
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    hi

    what i want to do is if once the window is created by executing the code,if next time i execute the same code it should check wether the window is open or not.if the window is open it should close the previous window.and create the new window.

    is it possible to do this.if yes please give idea how to do this.

    regards
    vidhya
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    Send the WM_CLOSE message to the Window Handle.
     
  3. vidhya

    vidhya New Member

    Joined:
    May 17, 2007
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    see my task is when i first execute my exe file one banner window will display on the desktop it will always be running.when next time i execute exe with some argument the argument should display in the same banner.

    what i thought was when i execute exe file second or third time i will close the previous window and open in new window.

    what i want is single instance of the window.
     
  4. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    You don't need to do it that way. The better way is say you have some Message WM_COPYDATA to send to the old executable some data (Say command Line data). Now when getting the WM_COPYDATA the exe just updates its content accordingly.

    Now after sending the message (new running version) should be killed or closed and now you have single instance with the update happening each time you run the exe with the command line.
     

Share This Page