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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Non Moving dialog box

Non Moving dialog box

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, I have a dialog box that I don't want users to be able to move. Currently I have timer running that centers the window ever 5 milliseconds, which could prove to be a bit heavy on resources so I don't want to continue this way. My application is a Windows CE app and I want the window to be positioned in one place and never moved. Any ideas??? Thanks, Claire :confused:

    S L S 5 Replies Last reply
    0
    • L Lost User

      Hi, I have a dialog box that I don't want users to be able to move. Currently I have timer running that centers the window ever 5 milliseconds, which could prove to be a bit heavy on resources so I don't want to continue this way. My application is a Windows CE app and I want the window to be positioned in one place and never moved. Any ideas??? Thanks, Claire :confused:

      S Offline
      S Offline
      Sivakumar
      wrote on last edited by
      #2

      I am not sure if there is a way to fix the position of the dialog box. Instead of centering every 5 milli seconds, you could check if the position of the dialog box has been changed. If so, you could then reposition. Siva

      1 Reply Last reply
      0
      • L Lost User

        Hi, I have a dialog box that I don't want users to be able to move. Currently I have timer running that centers the window ever 5 milliseconds, which could prove to be a bit heavy on resources so I don't want to continue this way. My application is a Windows CE app and I want the window to be positioned in one place and never moved. Any ideas??? Thanks, Claire :confused:

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I am not sure but I think you can intercept OnMove event and force to 0 cx and cy.

        M 1 Reply Last reply
        0
        • L Lost User

          I am not sure but I think you can intercept OnMove event and force to 0 cx and cy.

          M Offline
          M Offline
          Masaaki Onishi
          wrote on last edited by
          #4

          Hello, the codegurus around the world.;) (Copy Right 2001 Masaaki Onishi) Check here by Paul DiLascia.:cool: I think that this works for Dialog application. http://msdn.microsoft.com/msdnmag/issues/01/02/c/c0102.asp Have a nice day! -Masaaki Onishi-

          1 Reply Last reply
          0
          • L Lost User

            Hi, I have a dialog box that I don't want users to be able to move. Currently I have timer running that centers the window ever 5 milliseconds, which could prove to be a bit heavy on resources so I don't want to continue this way. My application is a Windows CE app and I want the window to be positioned in one place and never moved. Any ideas??? Thanks, Claire :confused:

            S Offline
            S Offline
            Stuart van Weele
            wrote on last edited by
            #5

            detect WM_MOVING. You might be able to prevent movement by resetting the drag rectangle to the initial dialog position P.S. - Why don't you want the dialog moved?

            1 Reply Last reply
            0
            • L Lost User

              Hi, I have a dialog box that I don't want users to be able to move. Currently I have timer running that centers the window ever 5 milliseconds, which could prove to be a bit heavy on resources so I don't want to continue this way. My application is a Windows CE app and I want the window to be positioned in one place and never moved. Any ideas??? Thanks, Claire :confused:

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              try this: 1:Add the following in the *.h: afx_msg UINT OnNcHitTest(CPoint point); 2:Add in the *.cpp ON_WM_NCHITTEST() 3:Add in the *.cpp: UINT CYourDialog::OnNcHitTest(Cpoint point) { UINT nHitTest=CDialog::OnNcHitTest(point); return (nHitTest==HTCAPTION)?HTCLIENT:nHitTest; } good luck for you! ;) julia

              1 Reply Last reply
              0
              • L Lost User

                Hi, I have a dialog box that I don't want users to be able to move. Currently I have timer running that centers the window ever 5 milliseconds, which could prove to be a bit heavy on resources so I don't want to continue this way. My application is a Windows CE app and I want the window to be positioned in one place and never moved. Any ideas??? Thanks, Claire :confused:

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                CMenu *pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) pSysMenu->RemoveMenu(SC_MOVE, MF_BYCOMMAND);

                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