Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter FifteenWindows/OS Functions (continued)

PostMessage Function

Overview

The PostMessage function post a raw message to the specified target window’s message queue. This is an advanced function and requires knowledge of Windows messaging.

Syntax/Parameters

Syntax

dword = PostMessage ( handle hwTarget, dword message, dword wParam, dword lParam );

Parameters

hwTarget

An handle that identifies the the target window.

message

A dword windows message.

wParam

A dword as a 32-bit value specific to the message.

lParam

A dword as a 32-bit value specific to the message.

Return Value

A dword with the message result. On failure of the function, a formatted error code will be returned. Since the return value and error may be ambiguous, the IsError, IsNotError and GetLastError functions can be used to determine if the underlying window message call failed.

Remarks

This is an advanced feature that essentially allows a message to be sent to any window. This message can result in program exceptions. To the extent possible, such exceptions will be captured, If an exception is captured, the value ERROR_MEMORY with a sub code of 0x0010 will be returned and set in the last error code. Use the GetLastError function to retrieve an error code separate from the return result.

The window handle is checked prior to posting the message. If the handle is invalid, an error will be returned. If windows is unable to post a message to window, an error will be returned.

Since the message is posted to the window queue, if the message value is not accepted by the window, the function will still return successfully.

Do not post the WM_QUIT message using the PostMessage function.

Related Functions 

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic