Tomasz,

In ASMWORK, let's say I need to add a string ';This is THE END' to every instance of a program I open at the end of the file, like a mark or sign.
How can it be done?

TIA,
slop
Posted on 2002-11-05 12:41:54 by slop
The thing is:

how to add a string without messing with ASMEDIT.DLL

Is there any way?

I could use the copy-paste-buffer, but is there a way to do it automagically, without having to cut and paste?
And without changing the dll?

The question is opened to anybody.
Posted on 2002-11-07 10:29:42 by slop
Hm.... What you think about this:

a little program, searching windows for asmedit windows and sending messages "WM_PASTE" to every "asmedit" window found.
Posted on 2002-11-07 10:39:20 by JohnFound
Good idea,

but there's still the problem of placing the cursor at the end of the program (or where required) and I don't know how to do that without changing asmedit
Posted on 2002-11-07 10:42:28 by slop
AEM_SETPOS message (defined in asmedit.inc):
= pointer to rc RECT structure
= line of selection origin (0 for current line)
= position of selection origin (in range 1-256, 0 for current position)
= line of caret position (0 for current)
= caret position (1-256, 0 for current)
= reserved (should be 0)

When you specify value larger than available, the largest possible is used, so to put caret at the beginning
of last line, you should set to -1 (0FFFFFFFFh) and to 1.
Posted on 2002-11-07 12:06:14 by Tomasz Grysztar
Privalov, you 0wn me

Then how can I 'add' the message there without messing the copy buffer.
Is there something like a pointer to the place where the caret points?

Or a handler?
Posted on 2002-11-08 06:08:07 by slop
No, I didn't need anything like this so I didn't make it. But you can send the stream of WM_CHAR messages with the key-release bit set (otherwise they'll be ignored, ASMEDIT depends mainly on WM_KEYDOWN messages, but for them you'd have to convert text into virtual key codes).
Posted on 2002-11-08 06:24:02 by Tomasz Grysztar
But you can send the stream of WM_CHAR messages with the key-release bit set


You mean, ONE BY ONE? A char at a time?

but for them you'd have to convert text into virtual key codes).

Are they like the codes that int 16h returns?
Can you explain how to do it?
Posted on 2002-11-08 06:29:06 by slop
Assuming ESI points to your ASCIIZ string, you can do it this way:


xor eax,eax
.send_string:
lodsb
or al,al
jz .end
invoke SendMessage,[hwnd_asmedit],WM_CHAR,eax,80000000h
jmp .send_string
.end:


About the virtual key codes you can read in API manual for the WM_KEYDOWN message.
Posted on 2002-11-08 06:43:45 by Tomasz Grysztar
Clear as water now
Posted on 2002-11-08 06:49:38 by slop