From 90d4b116d7e767befb55df5eb529629082953062 Mon Sep 17 00:00:00 2001 From: nickysn Date: Wed, 16 Sep 2015 14:47:14 +0000 Subject: [PATCH] + added the win16api window message functions git-svn-id: trunk@31714 - --- rtl/win16/win31.pp | 18 +++++++++++++ rtl/win16/winprocsh.inc | 40 +++++++++++++++++++++++++++++ rtl/win16/wintypes.inc | 56 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) diff --git a/rtl/win16/win31.pp b/rtl/win16/win31.pp index 76f13b4a4e..07d861cf73 100644 --- a/rtl/win16/win31.pp +++ b/rtl/win16/win31.pp @@ -480,6 +480,20 @@ const SPIF_UPDATEINIFILE = $0001; SPIF_SENDWININICHANGE = $0002; +{ Window message support } + +{ GetQueueStatus flags } + QS_KEY = $0001; + QS_MOUSEMOVE = $0002; + QS_MOUSEBUTTON = $0004; + QS_MOUSE = QS_MOUSEMOVE or QS_MOUSEBUTTON; + QS_POSTMESSAGE = $0008; + QS_TIMER = $0010; + QS_PAINT = $0020; + QS_SENDMESSAGE = $0040; + + QS_ALLINPUT = $007f; + function GetFreeSystemResources(SysResource: UINT): UINT; external 'USER'; procedure LogError(err: UINT; lpInfo: FarPointer); external 'KERNEL'; @@ -618,6 +632,10 @@ function SubtractRect(lprcDest: LPRECT; lprcSource1, lprcSource2: LPRECT): BOOL; function SubtractRect(var rcDest: RECT; var rcSource1, rcSource2: RECT): BOOL; external 'USER'; {$endif} +{ Window message support } +function GetMessageExtraInfo: LPARAM; external 'USER'; +function GetQueueStatus(flags: UINT): DWORD; external 'USER'; + implementation end. diff --git a/rtl/win16/winprocsh.inc b/rtl/win16/winprocsh.inc index 194e60f448..1f8ef4ee4e 100644 --- a/rtl/win16/winprocsh.inc +++ b/rtl/win16/winprocsh.inc @@ -745,3 +745,43 @@ procedure InflateRect(var rc: RECT; xAmt, yAmt: SmallInt); external 'USER'; function PtInRect(var rc: RECT; pt: POINT): BOOL; external 'USER'; {$endif} + +{ Window message support } + +function RegisterWindowMessage(lpsz: LPCSTR): UINT; external 'USER'; + +function GetMessage(lpmsg: LPMSG; hwnd: HWND; uMsgFilterMin, uMsgFilterMax: UINT): BOOL; external 'USER'; +function PeekMessage(lpmsg: LPMSG; hwnd: HWND; uFilterFirst, uFilterLast, fuRemove: UINT): BOOL; external 'USER'; +{$ifdef VAR_PARAMS_ARE_FAR} +function GetMessage(var msg: MSG; hwnd: HWND; uMsgFilterMin, uMsgFilterMax: UINT): BOOL; external 'USER'; +function PeekMessage(var msg: MSG; hwnd: HWND; uFilterFirst, uFilterLast, fuRemove: UINT): BOOL; external 'USER'; +{$endif} + +procedure WaitMessage; external 'USER'; + +function GetMessagePos: DWORD; external 'USER'; +function GetMessageTime: LONG; external 'USER'; + +function TranslateMessage(lpmsg: LPMSG): BOOL; external 'USER'; +function DispatchMessage(lpmsg: LPMSG): LONG; external 'USER'; +{$ifdef VAR_PARAMS_ARE_FAR} +function TranslateMessage(var msg: MSG): BOOL; external 'USER'; +function DispatchMessage(var msg: MSG): LONG; external 'USER'; +{$endif} + +function SetMessageQueue(cMsg: SmallInt): BOOL; external 'USER'; + +function GetInputState: BOOL; external 'USER'; + +function PostMessage(hwnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; external 'USER'; +function SendMessage(hwnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; external 'USER'; + +function PostAppMessage(htask: HTASK; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; external 'USER'; + +procedure ReplyMessage(lResult: LRESULT); external 'USER'; +function InSendMessage: BOOL; external 'USER'; + +function CallMsgFilter(lpmsg: LPMSG; nCode: SmallInt): BOOL; external 'USER'; +{$ifdef VAR_PARAMS_ARE_FAR} +function CallMsgFilter(var msg: MSG; nCode: SmallInt): BOOL; external 'USER'; +{$endif} diff --git a/rtl/win16/wintypes.inc b/rtl/win16/wintypes.inc index eacbe3d987..5e46151045 100644 --- a/rtl/win16/wintypes.inc +++ b/rtl/win16/wintypes.inc @@ -1295,3 +1295,59 @@ const WM_DEVMODECHANGE = $001B; WM_TIMECHANGE = $001E; + +{ Window message support } + WM_NULL = $0000; + +{ NOTE: All messages below $0400 are RESERVED by Windows } + WM_USER = $0400; + +type +{ Queued message structure } + PMSG = ^MSG; + NPMSG = ^MSG; near; + LPMSG = ^MSG; far; + MSG = record + hwnd: HWND; + message: UINT; + wParam: WPARAM; + lParam: LPARAM; + time: DWORD; + pt: POINT; + end; + TMsg = MSG; + +const +{ PeekMessage() options } + PM_NOREMOVE = $0000; + PM_REMOVE = $0001; + PM_NOYIELD = $0002; + +{ Special HWND value for use with PostMessage() and SendMessage() } + HWND_BROADCAST = HWND($ffff); + + WH_GETMESSAGE = 3; + + WH_CALLWNDPROC = 4; + + WH_MSGFILTER = (-1); + WH_SYSMSGFILTER = 6; + +{ CallMsgFilter() and WH_SYS/MSGFILTER context codes } + MSGF_DIALOGBOX = 0; + MSGF_MENU = 2; + MSGF_MOVE = 3; + MSGF_SIZE = 4; + MSGF_SCROLLBAR = 5; + MSGF_NEXTWINDOW = 6; + MSGF_MAINLOOP = 8; + MSGF_USER = 4096; + +{ Standard window messages } +{ PenWindows specific messages } + WM_PENWINFIRST = $0380; + WM_PENWINLAST = $038F; + +{ Coalescing messages } + WM_COALESCE_FIRST = $0390; + WM_COALESCE_LAST = $039F;