Syntax
AppSendMessage [WindowName$,] Message, Wparam, Lparam
Remarks
Sends a Windows message and its associated parameters to the application specified by WindowName$. On the Macintosh, AppSendMessage is not available and generates an error.
Argument | Explanation |
WindowName$ | A string that matches the beginning of an application window name, as it appears in the title bar or Task List (Windows). If omitted, Word is assumed. For more information on WindowName$, see AppActivate. |
Message | A decimal number corresponding to the message you want to send. |
Argument | Explanation |
Wparam, Lparam | Parameters appropriate for the message you are sending. For information on what these values represent, see the reference topic for the message in the Microsoft Windows 3.1 Programmer's Reference, Volume 3, available in the Microsoft Windows 3.1 Software Development Kit or from Microsoft Press, or in the Programmer's API Reference, Volume 5, available in the Microsoft Win32 Software Development Kit or from Microsoft Press. To retrieve the appropriate values, you may need to use the Spy utility (which comes with the Microsoft Windows 3.1 SDK or the Microsoft Win32 SDK). |
Example
This Windows 3.x example starts the Windows Help application and then sends it a message that displays the Open dialog box. The number 273 is the decimal value associated with the message WM_COMMAND and 1101 is the parameter that specifies the Open command. Lparam is ignored in this case, but must still be specified as 0 (zero).
Shell "WINHELP.EXE" AppSendMessage "Windows Help", 273, 1101, 0
See Also
AppActivate, AppIsRunning(), DDEExecute, DDEPoke