News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Another ASM editor

Started by NoCforMe, September 03, 2022, 06:54:23 AM

Previous topic - Next topic

NoCforMe

I'm a bit confused. According to Microsoft, EM_GETZOOM returns the zoom numerator and denominator in wParam & lParam:
QuoteParameters
wParam
Receives the numerator of the zoom ratio.

lParam
Receives the denominator of the zoom ratio.
which must mean that you pass pointers to those variables, right?
LOCAL zoomNum:DWORD, zoomDenom:DWORD

INVOKE SendMessage, EditHandle, EM_GETZOOM, ADDR zoomNum, ADDR zoonDenom
Assembly language programming should be fun. That's why I do it.

Biterider

Hi NoCforMe

From DebugCenter code
  local dNumerator:DWORD, dDenominator:DWORD

  SetObject xsi
  ;Remember the current RichEdit zoom factor
  invoke SendMessage, [xsi].hEdit, EM_GETZOOM, addr dNumerator, addr dDenominator
  .if eax != FALSE
    mov [xsi].dZoomFactor, $32($invoke(MulDiv, dNumerator, ZOOM_BASE, dDenominator))
  .endif

This works nicely.

Biterider

jj2007

Quote from: NoCforMe on March 08, 2024, 06:52:20 AMwhich must mean that you pass pointers to those variables, right?

Right, that's what I do indeed.

NoCforMe

Which wasn't at all clear from
Quotemov edx, esp
        push eax
        invoke SendMessage, hRichEd, EM_GETZOOM, edx, esp
What was edx set to previously? and how did esp get to be set to point to that other variable (except for 1 DWORD)? Anyhow, moving on ...
Assembly language programming should be fun. That's why I do it.

jj2007

Try it out, it works. Olly is your friend :cool:

push eax ; wParam
mov edx, esp
push eax ; lParam
invoke SendMessage, hRichEd, EM_GETZOOM, edx, esp
pop edx ; wParam, either 0 (no zoom) or 100
pop ecx ; lParam, 10...200

NoCforMe

No thanks, I'd rather be explicit rather than too clever by half:
INVOKE SendMessage, EditHandle, EM_GETZOOM, ADDR zoomNum, ADDR zoonDenom
Assembly language programming should be fun. That's why I do it.