Jump to content
Sign in to follow this  
EKY32

Loading PDF Object file stops mouse wheel detection

Recommended Posts

EKY32

Hey there,

I'm very thankful.

Mouse wheel detection works correctly untill loading the pdf file into the com object:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

GUIRegisterMsg($WM_MOUSEWHEEL, "_WM_MOUSEWHEEL")
GUICreate("PDF Object", 802, 590)
$oPDF = ObjCreate("AcroPDF.PDF.1")
$oPDF.src = (@ScriptDir & "\file.pdf") ; loading the pdf file stops mouse wheel detection
$GUI_ActiveX = GUICtrlCreateObj($oPDF, 10, 10, 780, 550)
GUICtrlSetStyle($GUI_ActiveX, $WS_VISIBLE)
GUICtrlSetResizing($GUI_ActiveX, $GUI_DOCKAUTO)
GUISetState()

;~ $oPDF.setShowToolbar(False)
;~ $oPDF.setShowScrollbars(True)
;~ $oPDF.setCurrentPage(10)
;~ $oPDF.gotonextpage()
;~ $oPDF.setZoom (10)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd
$oPDF = ""
$GUIActiveX = ""
Exit

Func _WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam)
    Local $iMPos = MouseGetPos()
    Switch $wParam
        Case 0x00780000
            ToolTip("Mouse wheel UP is detected!" & @CRLF & @CRLF & 'Click in the "My GUI" to return...', $iMPos[0], $iMPos[1], "Wheel UP", 1, 3)
        Case 0xFF880000
            ToolTip("Mouse wheel Down is detected!" & @CRLF & @CRLF & 'Click in the "My GUI" to return...', $iMPos[0], $iMPos[1], "Wheel Down", 1, 3)
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_WM_MOUSEWHEEL

If there is any way to fix that.

Thank you.


[font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×