lcl: explicitly add 4 byte UnusedMsg field for 64 bit cpu to LMessage records, to prevent that 2 or 4 byte fields of WPARAM are moved to offset 4, fixed the OnDropDown event on win64

git-svn-id: trunk@11216 -
This commit is contained in:
vincents 2007-05-29 11:42:32 +00:00
parent 014f349a63
commit a4121beefb

View File

@ -350,6 +350,9 @@ type
TLMDrawItems = record TLMDrawItems = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
Ctl: HWND; Ctl: HWND;
DrawItemStruct: PDrawItemStruct; DrawItemStruct: PDrawItemStruct;
Result: LRESULT; Result: LRESULT;
@ -358,6 +361,9 @@ type
TLMDrawListItem = record TLMDrawListItem = record
// message from the interface to the LCL // message from the interface to the LCL
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
Unused: PtrInt; Unused: PtrInt;
DrawListItemStruct : PDrawListItemStruct; DrawListItemStruct : PDrawListItemStruct;
Result: LRESULT; Result: LRESULT;
@ -366,6 +372,9 @@ type
TLMMeasureItem = record TLMMeasureItem = record
// message from the interface to the LCL // message from the interface to the LCL
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
idCtl: PtrUint; idCtl: PtrUint;
MeasureItemStruct: PMeasureItemStruct; MeasureItemStruct: PMeasureItemStruct;
Result: LRESULT; Result: LRESULT;
@ -374,6 +383,9 @@ type
{$ifndef WINDOWS} {$ifndef WINDOWS}
TLMNoParams = record TLMNoParams = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
Unused: array[0..1] of PtrInt; Unused: array[0..1] of PtrInt;
Result: LRESULT; Result: LRESULT;
end; end;
@ -383,6 +395,9 @@ type
TLMEraseBkgnd = record TLMEraseBkgnd = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
DC: HDC; DC: HDC;
Unused: PtrInt; Unused: PtrInt;
Result: LRESULT; Result: LRESULT;
@ -390,6 +405,9 @@ type
TLMGetText = record TLMGetText = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
TextMax: PtrInt; TextMax: PtrInt;
Text: PChar; Text: PChar;
Result: LRESULT; Result: LRESULT;
@ -399,6 +417,9 @@ type
TLMKey = record TLMKey = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
CharCode: Word; // VK_XXX constants as TLMKeyDown/Up, ascii if TLMChar CharCode: Word; // VK_XXX constants as TLMKeyDown/Up, ascii if TLMChar
Unused: Word; Unused: Word;
{$ifdef cpu64} {$ifdef cpu64}
@ -434,6 +455,9 @@ type
TLMMove = record TLMMove = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
MoveType: PtrInt; // 0 = update, 1 = force RequestAlign, MoveType: PtrInt; // 0 = update, 1 = force RequestAlign,
// 128 = Source is Interface (Widget has moved) // 128 = Source is Interface (Widget has moved)
case Integer of case Integer of
@ -449,6 +473,9 @@ type
TLMActivate = record TLMActivate = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
Active: WordBool; Active: WordBool;
Minimized: WordBool; Minimized: WordBool;
{$ifdef cpu64} {$ifdef cpu64}
@ -460,6 +487,9 @@ type
TLMNCActivate = record TLMNCActivate = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
Active: LongBool; Active: LongBool;
{$ifdef cpu64} {$ifdef cpu64}
Unused2 : Longint; Unused2 : Longint;
@ -470,6 +500,9 @@ type
TLMNotify = record TLMNotify = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
IDCtrl: PtrInt; IDCtrl: PtrInt;
NMHdr: PNMHdr; NMHdr: PNMHdr;
Result: LRESULT; Result: LRESULT;
@ -477,6 +510,9 @@ type
TLMNotifyFormat = record TLMNotifyFormat = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
From: HWND; From: HWND;
Command: LPARAM; Command: LPARAM;
Result: LRESULT; Result: LRESULT;
@ -484,6 +520,9 @@ type
TLMPaint = record TLMPaint = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
DC: HDC; DC: HDC;
PaintStruct: PPaintStruct; PaintStruct: PPaintStruct;
Result: LRESULT; Result: LRESULT;
@ -504,6 +543,9 @@ type
TLMWindowPosMsg = record TLMWindowPosMsg = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
Unused: WPARAM; Unused: WPARAM;
WindowPos: PWindowPos; WindowPos: PWindowPos;
Result: LPARAM; Result: LPARAM;
@ -524,6 +566,9 @@ type
TLMNCCalcSize = record TLMNCCalcSize = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
CalcValidRects: LongBool; CalcValidRects: LongBool;
{$ifdef cpu64} {$ifdef cpu64}
Unused : Longint; Unused : Longint;
@ -536,6 +581,9 @@ type
TLMSysCommand = record TLMSysCommand = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
case CmdType: PtrInt of case CmdType: PtrInt of
SC_HOTKEY: ( SC_HOTKEY: (
ActivateWnd: HWND; ActivateWnd: HWND;
@ -551,6 +599,9 @@ type
TLMSysDeadChar = record TLMSysDeadChar = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
CharCode: Word; CharCode: Word;
Unused: Word; Unused: Word;
{$ifdef cpu64} {$ifdef cpu64}
@ -563,6 +614,9 @@ type
TLMSystemError = record TLMSystemError = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
ErrSpec: Word; ErrSpec: Word;
Unused1 : Word; Unused1 : Word;
{$ifdef cpu64} {$ifdef cpu64}
@ -576,6 +630,9 @@ type
TLMSetText = record TLMSetText = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
Unused: WPARAM; Unused: WPARAM;
Text: PChar; Text: PChar;
Result: LRESULT; Result: LRESULT;
@ -583,7 +640,10 @@ type
PLMMouseEvent = ^TLMMouseEvent; PLMMouseEvent = ^TLMMouseEvent;
TLMMouseEvent = record TLMMouseEvent = record
Msg: cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
Button: Word; // 1=left, 2=right, 3=middle Button: Word; // 1=left, 2=right, 3=middle
WheelDelta: SmallInt; // -1 for up, 1 for down WheelDelta: SmallInt; // -1 for up, 1 for down
{$ifdef cpu64} {$ifdef cpu64}
@ -617,6 +677,9 @@ type
TLMSetFocus = record TLMSetFocus = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
FocusedWnd: HWND; FocusedWnd: HWND;
Unused: LPARAM; Unused: LPARAM;
Result: LRESULT; Result: LRESULT;
@ -625,6 +688,9 @@ type
{$ifndef windows} {$ifndef windows}
TLMSize = record TLMSize = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
SizeType: PtrInt; // see LCLType.pp (e.g. Size_Restored) SizeType: PtrInt; // see LCLType.pp (e.g. Size_Restored)
Width: Word; Width: Word;
Height: Word; Height: Word;
@ -645,6 +711,9 @@ type
{$ifndef windows} {$ifndef windows}
TLMessage = record TLMessage = record
Msg : Cardinal; Msg : Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
case Integer of case Integer of
0 : ( 0 : (
WParam: LclType.WPARAM; WParam: LclType.WPARAM;
@ -659,7 +728,7 @@ type
LParamHi: Word; LParamHi: Word;
ResultLo: Word; ResultLo: Word;
ResultHi: Word); ResultHi: Word);
{$ENDIF} {$endif}
end; end;
{$else} {$else}
TLMessage = TMessage; TLMessage = TMessage;
@ -674,9 +743,11 @@ type
// So POS: SmallInt -> LongInt and a win32compatible smallpos is added // So POS: SmallInt -> LongInt and a win32compatible smallpos is added
// Due to this, the record is a LongInt to large. // Due to this, the record is a LongInt to large.
{.$if defined(ver1_0) or not(defined(WINDOWS))}
TLMScroll = record TLMScroll = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
ScrollCode: SmallInt; // SB_xxx ScrollCode: SmallInt; // SB_xxx
SmallPos: SmallInt; SmallPos: SmallInt;
{$ifdef cpu64} {$ifdef cpu64}
@ -689,15 +760,13 @@ type
TLMHScroll = TLMScroll; TLMHScroll = TLMScroll;
TLMVScroll = TLMScroll; TLMVScroll = TLMScroll;
{.$else}
// TLMScroll = TWMScroll;
// TLMHScroll = TWMScroll;
// TLMVScroll = TWMScroll;
{.$endif}
{$ifndef windows} {$ifndef windows}
TLMShowWindow = record TLMShowWindow = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
Show: LongBool; Show: LongBool;
{$ifdef cpu64} {$ifdef cpu64}
Unused : Longint; Unused : Longint;
@ -716,7 +785,10 @@ type
{$endif} {$endif}
TLMNCHITTEST = record TLMNCHITTEST = record
Msg: cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
Unused: WPARAM; Unused: WPARAM;
case Integer of case Integer of
0 : ( 0 : (
@ -733,6 +805,9 @@ type
TLMCommand = record TLMCommand = record
Msg: Cardinal; Msg: Cardinal;
{$ifdef cpu64}
UnusedMsg: Cardinal;
{$endif}
ItemID: Word; ItemID: Word;
NotifyCode: Word; NotifyCode: Word;
{$ifdef cpu64} {$ifdef cpu64}