? :-)
Posted on 2005-05-19 21:34:15 by kero
Standard way to register unique message for communication between apps is RegisterWindowMessage. But:

1) It seems to me we can always replace

? ?invoke RegisterWindowMessage,offset MyUniqueMessage
? ?mov message_id,eax

with

? ?invoke RegisterClipboardFormat,offset MyUniqueMessage
? ?mov message_id,eax

and vice versa !


2) Also we can replace

? ?invoke RegisterWindowMessage,offset MyUniqueMessage
? ?mov message_id,eax

with

? ?.data?
? ?wc WNDCLASS <>
? ?.code
? ?mov wc.lpszClassName,offset MyUniqueMessage
? ?invoke RegisterClass,offset wc
? ?and eax,0ffffh
? ?mov message_id,eax

or with

? ?.data?
? ?wc WNDCLASSEX <>
? ?.code
? ?mov wc.cbSize,sizeof WNDCLASSEX
? ?mov wc.lpszClassName,offset MyUniqueMessage
? ?invoke RegisterClassEx,offset wc
? ?and eax,0ffffh
? ?mov message_id,eax

Even more: we can use this replacement directly in WinMain (i.e. MyWindowClassName = MyUniqueMessage).


Some examples (+ sources):

http://www.geocities.com/xmemor/2lz/framerector.zip (11 kb)
http://www.geocities.com/xmemor/2lz/winfinderposter.zip (8 kb)
http://www.geocities.com/xmemor/2lz/regrange.zip (very interesting range C000-FFFF via GetClipboardFormatName, 2 kb)

(from? http://www.geocities.com/xmemor/2lz/tinyasm.html)


So: am i right or not ?? when i can't use RegisterClipboardFormat instead of RegisterWindowMessage ?


P.S. In Russian -? http://rsdn.ru/Forum/Message.aspx?mid=1197645&all=1
Posted on 2005-06-06 18:30:33 by kero