Creating a window on top of another existing window

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Creating a window on top of another existing window

      I have one main window. on press of one button new window should be created which is not completely covering the main window area and again on press of slave window main window should be created without altering the properties of main window, to create that second
      window i have 3 options
      1. create a child window of the main window
      2. create a complete new window
      3. hiding main window and creating window


      I tried child window mechanism but in that i am facing some difficulties so I think creating a fresh new window will be a good option. need your suggestion on this.
    • Hi,

      Simply use WM_CreateWindow() to create a window.

      1. create a child window of the main window
      Call WM_CreateWindow() with the handle of the main window as parent. The new window will be placed inside of the main window with the given coordinates relative to the parent.

      2. create a complete new window
      Call WM_DeleteWindow() with the handle of the main window and call WM_CreateWindow() afterwards to create a new window.

      3. hiding main window and creating window
      Call WM_HideWindow() to hide a window (it is not deleted, just hidden). Call WM_CreateWindow() to create a new window (do not pass the hidden window as parent, otherwise the new window will be hidden, too).

      Regards,
      Sven
    • SEGGER - Schoenen wrote:

      Hi,

      Simply use WM_CreateWindow() to create a window.
      2. create a complete new window
      Call WM_DeleteWindow() with the handle of the main window and call WM_CreateWindow() afterwards to create a new window.
      Regards,
      Sven

      SEGGER - Schoenen wrote:

      Hi Thanks but if in second case I am not deleting the window and creating(Because i don't want to loose the properties of the main window when i will come back ) will it be a problem?

      The post was edited 1 time, last by Kusum Swarankar ().