Jump to content

_SendMessage: Integer results in wParam and lParam


 Share

Recommended Posts

I am working on the Rich Edit UDFs. For EM_GETZOOM, MSDN says:

wParam Receives the numerator of the zoom ratio. lParam Receives the denominator of the zoom ratio.

Someone has contributed to a forum:

Func _GUICtrlRichEdit_GetZoom($hWnd)
    Local $wParam,$lparam
    Local $lResult = _SendMessage($hWnd, $EM_GETZOOM, 0, 0, -1)
    If Not @error And $lResult[0] = True Then
        Local $return[2] = [$lResult[3], $lResult[4]]
        Return $return
    EndIf
    Return SetError(1, 0, 0)
EndFunc   ;==>_GUICtrlRichEdit_GetZoom

but this code sets $lResult[0] to 0. What is the correct way of having _SendMessage return values in wParam and lParam?

...chris

Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Link to comment
Share on other sites

I used this one in my RichEdit-UDF, too. It's from Gary Frost.

Thanks for the bug report, i never checked this funktion. This is the corrected one:

;===============================================================================
;
; Function Name:   _GUICtrlRichEdit_GetZoom
; Description:     Sets the zoomlevel of the RichEdit.
; Parameter(s):    $h_RichEdit - The handle of the RichEdit
;                  $nominator  - Numerator of the zoom ratio.
;                  $denominator  - Denominator of the zoom ratio.
; Requirement(s):
; Return Value(s):     On success return Array:
;                         [0] -> nominator
;                         [1] -> denominator
;                      On error returns 0 and @error set to 1
; Author(s):       Gary Frost, Prog@ndy
; Notes:           $nominator and $denominator: Both 0
;                       -> Turns off zooming by using the EM_SETZOOM message
;                  1/64 < ($nominator / $denominator) < 64
;                       -> Zooms display by the zoom ratio numerator/denominator
;
;===============================================================================
;
Func _GUICtrlRichEdit_GetZoom(ByRef $h_RichEdit)
    If Not IsHWnd($h_RichEdit) Then $h_RichEdit = HWnd($h_RichEdit)
    Local $lResult = _SendMessage($h_RichEdit, $EM_GETZOOM, 0, 0, -1,"int*","int*")
    If Not @error And $lResult[0] = True Then
        Local $return[2] = [$lResult[3], $lResult[4]]
        Return $return
    EndIf
    Return SetError(1, 0, 0)
EndFunc   ;==>_GUICtrlRichEdit_GetZoom

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Andy,

Thanks. I am debugging your Rich Edit UDFs, in alphabetical order: I am down to GetZ*. I will get back to you with all of them in a week or two.

...chris

Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...