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) |
||
(4 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{PageHeader|Messages miscellaneous}} | |
+ | |||
__TOC__ | __TOC__ | ||
− | |||
− | < | + | |
+ | <!------------------------------------------------------------------------------------------------------------------------------> | ||
+ | {{TipHeader|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.<br> | You can send messages to applications by using the thread ID of the running process.<br> | ||
− | In TD the message will be received at the Application Actions section.<br> | + | In TD the message will be received at the '''Application Actions''' section.<br> |
+ | |||
+ | |||
+ | [[image:SendAppMessage.png]] | ||
+ | |||
+ | |||
Here how to do it.<br> | Here how to do it.<br> | ||
− | + | ||
+ | |||
First declare two WinAPI functions [http://msdn.microsoft.com/en-us/library/ms644946(VS.85).aspx <b>PostThreadMessageA</b>] and [http://msdn.microsoft.com/en-us/library/ms683183(VS.85).aspx <b>GetCurrentThreadId</b>]. | First declare two WinAPI functions [http://msdn.microsoft.com/en-us/library/ms644946(VS.85).aspx <b>PostThreadMessageA</b>] and [http://msdn.microsoft.com/en-us/library/ms683183(VS.85).aspx <b>GetCurrentThreadId</b>]. | ||
Line 32: | Line 40: | ||
Now, here the code to send a message to the Application Actions level: | Now, here the code to send a message to the Application Actions level: | ||
+ | |||
<pre> | <pre> | ||
! Get the thread ID of this running application | ! Get the thread ID of this running application | ||
Line 39: | Line 48: | ||
</pre> | </pre> | ||
− | Here you can download a sample: | + | |
− | + | Here you can download a sample:<br> | |
− | + | {{Download | |
+ | |URL=http://samples.tdcommunity.net/index.php?dir=&file=WIKI_SendApplicationMessage.zip | ||
+ | |TEXT=WIKI_SendApplicationMessage.zip | ||
+ | }} | ||
+ | |||
+ | |||
+ | |||
+ | [[Category:Messages]] |
Latest revision as of 11:12, 29 October 2013
Messages miscellaneous
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:
WIKI_SendApplicationMessage.zip