`
Windows API: SendMessage and RegisterWindowMessage 2004-05-10 -- Richard Rogers Newsgroups: softvelocity.clarion.language You might wat to try this... API PROTOTYPES SendMessage(SIGNED,SIGNED,SIGNED,LONG),LONG,PASCAL,NAME('SendMessageA') RegisterWindowMessage(LONG),UNSIGNED,PASCAL,RAW,PROC,NAME('RegisterWindowMessageA') DATA DECLS MessageRegister CSTRING(255) MOD:wHandle LONG MyDoSomethingSilly LONG CODE MessageRegister = 'DoSomethingSilly' MyDoSomethingSilly = RegisterWindowMessage(ADDRESS(MessageRegister)) RET# = SendMessage(MOD:wHandle,WM_COMMAND,MyDoSomethingSilly,0) Subclass your procedure and watch for your registered messages. Additional info can be passed with wParam and lParam. I usually make wHandle the first parameter in the procedure prototype and when an outside application (C++, VB, doesn't matter) wants to use my procedure, all they have to do is pass me their window handle. The first thing I do after that is send them a message containing MY window handle. After that, the lines of communication are wide open. MUCH faster than DDE. Much more reliable. I have a Clarion Graphics module talking with a POS system written in C++ this way. Very sweet and simple. On 8 May 2004 10:35:22 -0400, "Charles Edmonds" Printed May 6, 2024, 11:59 am This article has been viewed/printed 35309 times. Google search has resulted in 586 hits on this article since January 25, 2004. |