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. DialogBox problem

DialogBox problem

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

    I create DialogBox using Api Windows my question is how to get handle to this dialog before the dialog appears? in MFC i got CMyDlg dlg; now I am able to pass dlg somwhere (to the tread in my case) and I do dlg.doModal; I want to do similar thing in WinAPi but if I do DialogBox(hInst, MAKEINTRESOURCE(IDD_AUTHORIZATION), h, (DLGPROC)authDialog); the dialog box appears imiedetly, and I don't have HWND of it. Please help

    D N 2 Replies Last reply
    0
    • J Jump_Around

      I create DialogBox using Api Windows my question is how to get handle to this dialog before the dialog appears? in MFC i got CMyDlg dlg; now I am able to pass dlg somwhere (to the tread in my case) and I do dlg.doModal; I want to do similar thing in WinAPi but if I do DialogBox(hInst, MAKEINTRESOURCE(IDD_AUTHORIZATION), h, (DLGPROC)authDialog); the dialog box appears imiedetly, and I don't have HWND of it. Please help

      D Offline
      D Offline
      Daniel Strigl
      wrote on last edited by
      #2

      It's not possible to work with the HWND of a dialog before the dialog is created! There exists no HWND until the dialog is created! If you want to use some functions that uses the HWND the dialog have to exist, otherwise the doesn't work! Daniel ;) --------------------------- Never change a running system!

      1 Reply Last reply
      0
      • J Jump_Around

        I create DialogBox using Api Windows my question is how to get handle to this dialog before the dialog appears? in MFC i got CMyDlg dlg; now I am able to pass dlg somwhere (to the tread in my case) and I do dlg.doModal; I want to do similar thing in WinAPi but if I do DialogBox(hInst, MAKEINTRESOURCE(IDD_AUTHORIZATION), h, (DLGPROC)authDialog); the dialog box appears imiedetly, and I don't have HWND of it. Please help

        N Offline
        N Offline
        Neville Franks
        wrote on last edited by
        #3

        Grab WM_INITDIALOG inside your authDialog proc. You can do the same stuff here you would do in OnInitDialog() Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com

        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