Navigation:  thinBasic Modules > UI (User Interface) > Events > Events in message loops >

GetMessage

Previous pageReturn to chapter overviewNext page

 

Description

 

Returns the next waiting message present in message queue for the hWnd dialog.

 

Syntax

 

Msg = GetMessage(hWnd, wParam, lParam [, ptrToNMHDR_Structure [, lCBCTL [, lCBCTLMSG]]])

 

Returns

 

Number.

 

Parameters

 

Name

Type

Optional

Meaning

hWnd

Number

No

Handle of the dialog you want to get next message

wParam

Variable

No

A numeric existing variable name. This variable will be filled with additional message-specific information

lParam

Variable

No

A numeric existing variable name. This variable will be filled with additional message-specific information

ptrToNMHDR_Structure

Pointer

Yes

This must be a pointer to a variable of type NMHDR. NMHDR is a structure (UDT) defined as described in Remarks here below. If present, this structure will be automatically filled with notification information received from child controls inside a window.

To use this parameter, pass something like: VARPTR(My_NMHDR) where My_NMHDR is a variable of type NMHDR.

lCBCTL

Variable

Yes

A numeric variable. If present, it will receive the numeric ID value of the control sending the message. In many cases it is equivalent to: LOWRD(wParam)

lCBCTLMSG

Variable

Yes

A numeric variable. If present, it will receive the numeric value of a notification message parameter sent from a control. In many cases it is equivalent to: HIWRD(wParam)

 

Remarks

 

The following is the standard WIN32 NMHDR udt used to get control notifications.

 

  Type NMHDR

    hwndFrom  As DWORD

    idfrom    As DWORD

    code      As LONG

  End Type

 

Restrictions

 

See also

 

PeekMessage, SendMessage, ClearMessages

 

Examples

 

 

 

© 2004-2008 thinBasic. All rights reserved. Version 1.7.0.0 Web Site: http://www.thinbasic.com