From Team Developer SqlWindows Wiki
Revision as of 12:12, 29 October 2013 by DaveRabelink (Talk | contribs)
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: