Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Edge HMI

ViewerPostMessage

  • Last UpdatedOct 29, 2026
  • 1 minute read

The function ViewerPostMessage posts a Windows System Message to the specified project screen.

Function

Group

Execution

String Exp.

Windows

Windows Embedded

IoT View

Thin Clients

Mobile Access

ViewerPostMessage

Module Activity

Asynchronous

No

Supported

Supported

Not supported

Supported

Not supported

Syntax

ViewerPostMessage(strScrTitle,numMessage,numwParam,numlParam,optNumID)

ViewerPostMessage ( strScrTitle , numMessage , numwParam , numlParam { | ,optNumID } )

strScrTitle

The name of the screen to which the message will be posted.

numMessage

The number of the Windows System Message to be posted.

numwParam

Additional, message-specific information that is passed to wParam of the Windows System Message.

numlParam

Additional, message-specific information that is passed to lParam of the Windows System Message.

optNumID

The specific ID number of the screen. (This number is assigned when the screen is opened using the function Open.)

This parameter is optional; if no value is specified, the default value is 0.

Return value

This function returns no value.

Notes

This function emulates the PostMessage function in Microsoft Windows. For more information, including a complete list of available Windows System Messages, go to: msdn.microsoft.com/library/ms644944

If the Enforce Web functionality equivalence in local project screens option is selected in the project settings, this function cannot be called in VBScript Global Procedures, VBScript scripts (script groups), or other background tasks. This is because the function behaves differently depending on whether you view project screens locally (that is, on the same computer that hosts the project runtime) or remotely. For more information, see Preferences tab.

Examples

Send message 16 to the screen named "main" with ID 10:

ViewerPostMessage("main",16,3,1,10)

In This Topic