Difference between revisions of "Miscellaneous messages"
From Team Developer SqlWindows Wiki
(New page: This page covers miscellaneous messages tips & tricks. __TOC__ <br> <h2 style="margin:0;background-color:#ddcef2;font-size:120%;font-weight:bold;border:1px solid #afa3bf;text-align:left;...) |
DaveRabelink (Talk | contribs) |
||
Line 40: | Line 40: | ||
Here you can download a sample: | Here you can download a sample: | ||
− | *[http:// | + | *[http://samples.tdcommunity.net/index.php?dir=&file=WIKI_SendApplicationMessage.zip WIKI_SendApplicationMessage.zip]<br> |
<br> | <br> |
Revision as of 08:58, 14 September 2008
This page covers miscellaneous messages tips & tricks.
Contents |
How to send a message to the Application Actions section
You can send messages to applications by using the thread ID of the running process.
In TD the message will be received at the Application Actions section.
Here how to do it.
First declare two WinAPI functions PostThreadMessageA and GetCurrentThreadId.
Library name: USER32.DLL Function: PostThreadMessageA Export Ordinal: 0 Returns Boolean: BOOL Parameters Number: DWORD Number: UINT Number: WPARAM Number: LPARAM Library name: KERNEL32.DLL Function: GetCurrentThreadId Export Ordinal: 0 Returns Number: DWORD Parameters
Now, here the code to send a message to the Application Actions level:
! Get the thread ID of this running application Set nCurrentThreadID = GetCurrentThreadId( ) ! Send a message to the thread. It will be received in the Application Actions Call PostThreadMessageA( nCurrentThreadID, PAM_AnyMessage, 0, 0 )
Here you can download a sample: