OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Louderjohn on January 19, 2023, 06:27:02 AM

Title: dcl-messagebox Help Button
Post by: Louderjohn on January 19, 2023, 06:27:02 AM
I tried the {ShowHelpButton [as Boolean]} option in dcl-messagebox. When I click on the Help button nothing happens, which I expected. How do you define the actual help file for the Help button?
Title: Re: dcl-messagebox Help Button
Post by: Fred Tomke on January 19, 2023, 06:39:41 AM
Hello, I really have no experience with the help button in messageboxes. I'm also afraid that the messagebox does not close by clicking on the button, to get the return value of dcl-messagebox. In some cases AutoCAD can open a chm-file by clicking F1 when just a command is runnig (context-sensitive-help) but you have to define a help function right before by using setfunhelp (http://docs.autodesk.com/ACD/2013/ENU/index.html?url=files/GUID-61B2326A-8DE4-46C4-B9F9-22B8D163A761.htm,topicNumber=d30e627653). But in the end I realy have no idea, sorry.
With regards, Fred
Title: Re: dcl-messagebox Help Button
Post by: Louderjohn on January 19, 2023, 06:54:22 AM
Thanks Fred.
Title: Re: dcl-messagebox Help Button
Post by: owenwengerd on January 19, 2023, 10:05:46 AM
Without looking at the code, I guess pressing [Help] causes the dialog to close and (dcl-MessageBox) returns an integer value for the Help button that is just missed in the OpenDCL reference.
Title: Re: dcl-messagebox Help Button
Post by: Fred Tomke on January 19, 2023, 07:36:29 PM
Hello, Owen, unfotunately the form won't be closed by clicking help button.

(dcl-messagebox "Msg" "Title" 3 3 T)

Regards, Fred
Title: Re: dcl-messagebox Help Button
Post by: owenwengerd on January 20, 2023, 04:18:07 PM
According to MSDN (https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebox) the button sends a WM_HELP message to the parent window. Presumably the intent was to trigger the parent form's Help (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Event/Help.htm) event handler. The parent form would be the form that is active before the message box is displayed.

I'm not sure it works, though. I see that there is no direct handler for WM_HELP for any of the form types, so it depends on how the MFC dialog code translates an unhandled WM_HELP message.