WS_EX_CONTEXTHELP message processing

Started by Roger Garstang, June 08, 2004, 08:06:26 PM

Previous topic - Next topic

Roger Garstang

Can we add functions/messages to the list for WM_HELP and maybe WM_CONTEXTMENU.  I also noticed when WS_EX_CONTEXTHELP is given to a window it doesn't show the ? button on the bar...it only shows when Maximize and Minimize are off too.

TechSupport


Roger Garstang

To help out a little bit, I just implemented a simple little help scheme in my app using msgboxes.

WM_HELP can be processed as it stands in each control type, or you can let the def proc send it back to your main form callback and it sends a pointer to a HELPINFO in lParam, so I do something like this in the main callback (Custom at the moment since it isn't implemented)-


LOCAL hi AS HELPINFO PTR

   SELECT CASE wMsg
        CASE %WM_HELP
           hi= lParam
           SELECT CASE @hi.hItemHandle
               CASE HWND_HTML_USERNAMETXT
                   MSGBOX "Enter a Username here.", %MB_ICONINFORMATION OR %MB_TASKMODAL, "Help"
               CASE HWND_HTML_PASSWORDTXT
                   MSGBOX "Enter a Password here.", %MB_ICONINFORMATION OR %MB_TASKMODAL, "Help"
           END SELECT
   END SELECT


There is probably more that could be done and I could create my own help file, but I don't need it.  Hitting F1 or click on the control with the context help either one shows the help.  I wish clicking anywhere in the window or pressing F1 with no control selected and having CASE ELSE process the message would work, but the window doesn't seem to return the message and it is difficult to not have a control selected, so you still have to click a control that just isn't handled...statusbars are pretty good.

Roger Garstang

Anyone know what Windows does with the structure this points to with the lparam?  There is no mention in the documentation about needing to clean up any memory or anything, so I'm guessing Windows cleans it up on Callback exit or when another is sent or it is reused and cleaned up later...