Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Dialog Position

Dialog Position

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutoriallearning
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Archer282
    wrote on last edited by
    #1

    Okay, I have a dialog, made with the resource editor, im using it as my main window, and im using Pure Win32, no MFC!, and i want this dialog to be positioned by the system like a normal window would be if you had created the window with CreateWindow() and specified CW_USEDEFUALT for the X paramater, but i dont know how to get my window to do this. and please, if you dont know exactly what i am asking then dont bother trying to answer

    D 1 Reply Last reply
    0
    • A Archer282

      Okay, I have a dialog, made with the resource editor, im using it as my main window, and im using Pure Win32, no MFC!, and i want this dialog to be positioned by the system like a normal window would be if you had created the window with CreateWindow() and specified CW_USEDEFUALT for the X paramater, but i dont know how to get my window to do this. and please, if you dont know exactly what i am asking then dont bother trying to answer

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Position the dialog to your liking in response to the WM_INITDIALOG message. Use:

      SetWindowPos(..., CW_USEDEFAULT, CW_USEDEFAULT, ...);

      for the x and y parameters.


      "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

      F A 2 Replies Last reply
      0
      • D David Crow

        Position the dialog to your liking in response to the WM_INITDIALOG message. Use:

        SetWindowPos(..., CW_USEDEFAULT, CW_USEDEFAULT, ...);

        for the x and y parameters.


        "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

        F Offline
        F Offline
        flystar707
        wrote on last edited by
        #3

        MoveWindow(x,y,cx,xy)

        1 Reply Last reply
        0
        • D David Crow

          Position the dialog to your liking in response to the WM_INITDIALOG message. Use:

          SetWindowPos(..., CW_USEDEFAULT, CW_USEDEFAULT, ...);

          for the x and y parameters.


          "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

          A Offline
          A Offline
          Archer282
          wrote on last edited by
          #4

          tried this, it positions the window off screen

          D 1 Reply Last reply
          0
          • A Archer282

            tried this, it positions the window off screen

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Does MoveWindow() produce the same result? I'm not sure if either support CW_USEDEFAULT. You might want to explain this requirement further. Perhaps there's a better alternative.


            "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups