Announcement

Collapse
No announcement yet.

Exit HTML helpfile

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exit HTML helpfile

    Hi,
    could somebody tell me how to exit a HTML helpfile by key-stroke "ESC"? According to the Help for Microsofts HTML Help Workshop it might be possible by a message loop using %HH_PRETRANSLATEMESSAGE.

    The doc says:
    "This command is called in the message loop of your Windows application to ensure proper handling of Windows messages, especially keyboard messages when running HTML Help single thread."

    But I don't know how to construct and where to place such a loop, and how to retrieve the notification message "%IDCANCEL".

    local dwCookie AS DWORD

    HtmlHelp BYVAL %NULL,BYVAL %NULL,%HH_INITIALIZE,VARPTR (dwCookie)

    CALL HtmlHelp(CBHNDL, $Helpfile, 0, 0)

    WHILE GetMessage(Msg,%NULL,0,0)
    IF (HtmlHelp (BYVAL %NULL,BYVAL %NULL,%HH_PRETRANSLATEMESSAGE,VARPTR(Msg))) THEN
    ???
    ELSE
    TranslateMessage Msg
    DispatchMessage Msg
    END IF
    WEND
    HtmlHelp BYVAL %NULL,BYVAL %NULL,%HH_UNINITIALIZE,VARPTR(dwCookie)
    www.praecom.de

  • #2
    I *assume* (based on mentioning %IDCANCEL) that your modal form get's a WM_COMMAND > %IDCANCEL

    So by using HtmlHelp (BYVAL %NULL,BYVAL %NULL,%HH_PRETRANSLATEMESSAGE,VARPTR(Msg)) in your code it might process the message to your modal window.
    hellobasic

    Comment


    • #3
      No, it doesn't. I think what I need is a hook procedure for HtmlHelp itself. But how can this
      be realized?
      www.praecom.de

      Comment


      • #4
        Maybe this is related?

        http://www.winehq.org/pipermail/wine...ay/032289.html
        hellobasic

        Comment


        • #5
          I saw this contribution before. Unfortunately that is no sample of a message loop in connection with %HH_PRETRANSLATEMESSAGE. Furthermore I'm not very fit in reading C++ code. So, a PB code snipped would be nice.
          www.praecom.de

          Comment


          • #6
            I got it:
            Code:
                LOCAL dwCookie AS DWORD
                LOCAL Msg AS tagMsg
            
                HtmlHelp BYVAL %NULL,BYVAL %NULL,%HH_INITIALIZE,VARPTR(dwCookie)
            
                IF TopicId > 0 THEN
                   CALL HtmlHelp(hPrnt, $Hlpfile, %HH_HELP_CONTEXT, BYVAL CLNG(TopicId))
                ELSE
                   CALL HtmlHelp(hPrnt, $Hlpfile, 0, 0)
                END IF
            
                WHILE GetMessage(Msg,%NULL,0,0)
                      IF NOT HtmlHelp (%Null,BYVAL %NULL,%HH_PRETRANSLATEMESSAGE,VARPTR(Msg)) THEN
                         TranslateMessage Msg
                         DispatchMessage Msg
                      END IF
            
                      SELECT CASE Msg.message
                         CASE %WM_CHAR
                            IF LO(WORD,Msg.wParam) = %VK_ESCAPE THEN
                               HtmlHelp %NULL,BYVAL %NULL,%HH_CLOSE_ALL,0
                               EXIT LOOP
                            END IF
                            
                      END SELECT
                WEND
                HtmlHelp BYVAL %NULL,BYVAL %NULL,%HH_UNINITIALIZE,dwCookie
            Thank you, Edwin!
            www.praecom.de

            Comment

            Working...
            X