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. Main handle of MFC dialog

Main handle of MFC dialog

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++tutorial
6 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.
  • K Offline
    K Offline
    Kreatief
    wrote on last edited by
    #1

    Hi, one stupid question: I need to know the handle of the main dialog created by the MFC Wizzard (dialog based app). How to get that? I am confused that I couldnt find anything about it. I am using this for a class for minimizing the app to the tray. Do this dialogs have a handle? DKT

    2 D 2 Replies Last reply
    0
    • K Kreatief

      Hi, one stupid question: I need to know the handle of the main dialog created by the MFC Wizzard (dialog based app). How to get that? I am confused that I couldnt find anything about it. I am using this for a class for minimizing the app to the tray. Do this dialogs have a handle? DKT

      2 Offline
      2 Offline
      224917
      wrote on last edited by
      #2

      CWnd::m_hWnd CDialog is derived from CWnd, so you can access m_hwnd from CDialog or through CDialog !
      There is no spoon. mail

      K 1 Reply Last reply
      0
      • 2 224917

        CWnd::m_hWnd CDialog is derived from CWnd, so you can access m_hwnd from CDialog or through CDialog !
        There is no spoon. mail

        K Offline
        K Offline
        Kreatief
        wrote on last edited by
        #3

        Thank you! Thats it! Btw, why cant I see this member variable in the ClassWizzard? I just see my own vars... DKT

        B 1 Reply Last reply
        0
        • K Kreatief

          Thank you! Thats it! Btw, why cant I see this member variable in the ClassWizzard? I just see my own vars... DKT

          B Offline
          B Offline
          BlackDice
          wrote on last edited by
          #4

          I think if you saw every inherited function and variable from all the parent classes, classwizard would be almost useless. :) If I write code in my sleep, does that make me brilliant, or just a lazy programmer? My articles www.stillwaterexpress.com BlackDice - the programmer formerly known as bdiamond

          1 Reply Last reply
          0
          • K Kreatief

            Hi, one stupid question: I need to know the handle of the main dialog created by the MFC Wizzard (dialog based app). How to get that? I am confused that I couldnt find anything about it. I am using this for a class for minimizing the app to the tray. Do this dialogs have a handle? DKT

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

            Kreatief wrote: I am using this for a class for minimizing the app to the tray. You use Shell_NotifyIcon() for this. There are plenty of examples on how to do this here at CP, and on MSDN. You can Google for even more.


            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            K 1 Reply Last reply
            0
            • D David Crow

              Kreatief wrote: I am using this for a class for minimizing the app to the tray. You use Shell_NotifyIcon() for this. There are plenty of examples on how to do this here at CP, and on MSDN. You can Google for even more.


              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

              K Offline
              K Offline
              Kreatief
              wrote on last edited by
              #6

              Yeah sure. I did that, and got it to work. I am having other problems with the trayicon, which caused the problem! I have an MFC app, where I wanna handle Messages, eg. a Buttonclick on the icon. I dunno how to do that. Who can tell me just the base. I can learn myself, but I need to know the base. For a normal app you make an endless loop checking for messages. But here? DKT

              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