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. Context help message loop

Context help message loop

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++helptutorial
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.
  • V Offline
    V Offline
    Vlasta_
    wrote on last edited by
    #1

    Hello *, dialog boxes can have a question mark button in their caption that (when clicked) changes cursor and provides help for selected control. I'd like to have the same functionality in the main window of the application, triggered for example by a toolbar button. I guess a specialized message loop is needed to provide all the functionality (changing cursor, sending the WM_HELP, cancelling on ESC, ...) Is this piece of code avaiable or would I need to implement it myself :sigh: ? One more thing - no MFC if possible, just pure Win32. Thanks in advance, Vlasta

    PJ ArendsP 1 Reply Last reply
    0
    • V Vlasta_

      Hello *, dialog boxes can have a question mark button in their caption that (when clicked) changes cursor and provides help for selected control. I'd like to have the same functionality in the main window of the application, triggered for example by a toolbar button. I guess a specialized message loop is needed to provide all the functionality (changing cursor, sending the WM_HELP, cancelling on ESC, ...) Is this piece of code avaiable or would I need to implement it myself :sigh: ? One more thing - no MFC if possible, just pure Win32. Thanks in advance, Vlasta

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      This is what I would try, When user clicks on '?' button:

      • capture mouse to main window
      • set flag variable that context help is active

      In main window's WM_SETCURSOR function set cursor to question mark. In main window's WM_LBUTTONDOWN:

      • use ChildWindowFromPoint() to get the window clicked on.
      • Post WM_HELP to that window
      • Release the capture
      • Clear the flag variable

      Within you lies the power for good; Use it!

      V 1 Reply Last reply
      0
      • PJ ArendsP PJ Arends

        This is what I would try, When user clicks on '?' button:

        • capture mouse to main window
        • set flag variable that context help is active

        In main window's WM_SETCURSOR function set cursor to question mark. In main window's WM_LBUTTONDOWN:

        • use ChildWindowFromPoint() to get the window clicked on.
        • Post WM_HELP to that window
        • Release the capture
        • Clear the flag variable
        V Offline
        V Offline
        Vlasta_
        wrote on last edited by
        #3

        Thanks for the reply, I was hoping somebody already did this. Oh well.

        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