News:

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

Main Menu

easy for experts...

Started by xandaz, December 03, 2020, 03:21:55 AM

Previous topic - Next topic

jj2007

Which "word line"? Post an example.

xandaz

   It goes like this:
   .if uMsg==WM_CHAR || uMsg==WM_MOUSEMOVE
        invoke  SendMessage,hWnd,EM_LINEINDEX,-1,0
        invoke  SendMessage,hWnd,EM_LINEFROMCHAR,eax,0
        inc     eax
        push    eax
        invoke  SendMessage,hMdi,WM_MDIGETACTIVE,0,0
        invoke  GetWindowLong,eax,GWL_USERDATA
        mov     edi,eax
        invoke  SendMessage,[edi.MdiStruct.hStatic],WM_SETTEXT,0,addr szEmptyString
        pop     eax
        invoke  SendMessage,[edi.MdiStruct.hStatic],WM_SETTEXT,0,ustr$(eax)

    Just wanted to add the word 'line' to the line number as in WM_SETTEXT,0,ustr$(eax)

hutch--

Allocate a buffer that is large enough to hold all of the string data you have in mind then use either "cat$()" or the macro "strcat" to join the strings. You will find this data in the help file on the menu "High Level Macro Help". There is a ton of stuff there that you will find really useful.

xandaz

  yeah Hutch...thanks for the help i've been trying  WM_SETTEXT,0,cat$(offsset szLine,ustr$(eax)) but it crashes.

hutch--

Try constructing the string separately then show it in a MessageBox().

xandaz


xandaz

   The macro works fine. the problem is that i'm using cat$(offset Buffer,"ln ",ustr$(eax)) and although i've attentiveally set the first character of Buffer to 0 it keeps adding to the string.

xandaz

    working perfectlly. Thanks a lot

jj2007

Quote from: xandaz on December 04, 2020, 03:12:01 AM
  yeah Hutch...thanks for the help i've been trying  WM_SETTEXT,0,cat$(offsset szLine,ustr$(eax)) but it crashes.


First arg is the destination buffer, x$ in this example:
  Local x$[100]:BYTE
  mov ecx, 123
  print cat$(addr x$, "Line ", str$(ecx))


In MasmBasic you could use invoke SendMessage,[edi.MdiStruct.hStatic],WM_SETTEXT,0, Str$("Line %i", eax)

xandaz

   yeah thanks JJ. î got it working thanks to you guys but i have to confess it's kinda slow.