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 box question

Dialog box question

Scheduled Pinned Locked Moved C / C++ / MFC
questionjsonhelptutorial
3 Posts 2 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.
  • J Offline
    J Offline
    Jump_Around
    wrote on last edited by
    #1

    I use api and I have a question DialogBox(hInst, MAKEINTRESOURCE(IDD_AUTHORIZATION), main_hwnd, (DLGPROC)authDialog); where main_hwnd is a handler to the parent window. But when the dialog box appears it is not shown relatively to the parent window. Relatively I mean at the center. Could you help me how to change the code to set the dialog box at the center of parent window?

    R 1 Reply Last reply
    0
    • J Jump_Around

      I use api and I have a question DialogBox(hInst, MAKEINTRESOURCE(IDD_AUTHORIZATION), main_hwnd, (DLGPROC)authDialog); where main_hwnd is a handler to the parent window. But when the dialog box appears it is not shown relatively to the parent window. Relatively I mean at the center. Could you help me how to change the code to set the dialog box at the center of parent window?

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      CDialog *pDlg=(CDialog *)GetDlgItem(IDD_AUTHORIZATION);
      BOOL bCenter=pDlg->CenterWindow(main_hwnd);

      ~RaGE();

      J 1 Reply Last reply
      0
      • R Rage

        CDialog *pDlg=(CDialog *)GetDlgItem(IDD_AUTHORIZATION);
        BOOL bCenter=pDlg->CenterWindow(main_hwnd);

        ~RaGE();

        J Offline
        J Offline
        Jump_Around
        wrote on last edited by
        #3

        OK but I said I use api windows not MFC. Any suggestions?

        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