This commit is contained in:
Alexey 2021-10-27 22:03:32 +03:00
parent 33df1460d5
commit b689a8da81
24 changed files with 97 additions and 95 deletions

View File

@ -318,8 +318,6 @@ end;
// The original function was about 2400 lines. // The original function was about 2400 lines.
type type
TAccessCustomEdit = class(TCustomEdit);
{ TWindowProcHelper } { TWindowProcHelper }
TWindowProcHelper = record TWindowProcHelper = record
@ -695,7 +693,7 @@ begin
end; end;
if ParentPaintWindow <> 0 then if ParentPaintWindow <> 0 then
GetWin32ControlPos(Window, ParentPaintWindow, parLeft, parTop); GetWin32ControlPos(Window, ParentPaintWindow, parLeft{%H-}, parTop{%H-});
//Is not necessary to check the result of GetLCLClientBoundsOffset since //Is not necessary to check the result of GetLCLClientBoundsOffset since
//the false condition (lWincontrol = nil or lWincontrol <> TWinControl) is never met //the false condition (lWincontrol = nil or lWincontrol <> TWinControl) is never met
//The rect is always initialized with 0 //The rect is always initialized with 0
@ -1133,11 +1131,11 @@ begin
C := DragQueryFile(Drop, $FFFFFFFF, nil, 0); // get dropped files count C := DragQueryFile(Drop, $FFFFFFFF, nil, 0); // get dropped files count
if C <= 0 then Exit; if C <= 0 then Exit;
SetLength(Files, C); SetLength(Files{%H-}, C);
for I := 0 to C - 1 do for I := 0 to C - 1 do
begin begin
L := DragQueryFileW(Drop, I, nil, 0); // get I. file name length L := DragQueryFileW(Drop, I, nil, 0); // get I. file name length
SetLength(WideBuffer, L); SetLength(WideBuffer{%H-}, L);
L := DragQueryFileW(Drop, I, @WideBuffer[1], L + 1); L := DragQueryFileW(Drop, I, @WideBuffer[1], L + 1);
SetLength(WideBuffer, L); SetLength(WideBuffer, L);
Files[I] := UTF16ToUTF8(WideBuffer); Files[I] := UTF16ToUTF8(WideBuffer);
@ -1907,7 +1905,7 @@ begin
LMMove.Msg := LM_NULL; LMMove.Msg := LM_NULL;
end else end else
begin begin
if GetWindowRelativePosition(Window, NewLeft, NewTop) then if GetWindowRelativePosition(Window, NewLeft{%H-}, NewTop{%H-}) then
UpdateLMMovePos(NewLeft, NewTop) UpdateLMMovePos(NewLeft, NewTop)
else else
LMMove.Msg := LM_NULL; LMMove.Msg := LM_NULL;
@ -1956,7 +1954,7 @@ begin
SizeType := SIZE_RESTORED or Size_SourceIsInterface; SizeType := SIZE_RESTORED or Size_SourceIsInterface;
end; end;
GetWindowSize(Window, NewWidth, NewHeight); GetWindowSize(Window, NewWidth{%H-}, NewHeight{%H-});
Width := NewWidth; Width := NewWidth;
Height := NewHeight; Height := NewHeight;
if Assigned(lWinControl) then if Assigned(lWinControl) then
@ -2038,7 +2036,7 @@ begin
if (LastMouseTracking<>lWinControl) then if (LastMouseTracking<>lWinControl) then
begin begin
// register for WM_MOUSELEAVE // register for WM_MOUSELEAVE
FillChar(LMouseEvent, SizeOf(TTRACKMOUSEEVENT), 0); FillChar(LMouseEvent{%H-}, SizeOf(TTRACKMOUSEEVENT), 0);
LMouseEvent.cbSize := SizeOf(TTRACKMOUSEEVENT); LMouseEvent.cbSize := SizeOf(TTRACKMOUSEEVENT);
LMouseEvent.dwFlags := TME_LEAVE; LMouseEvent.dwFlags := TME_LEAVE;
LMouseEvent.hwndTrack := Window; LMouseEvent.hwndTrack := Window;
@ -2762,7 +2760,7 @@ function
var var
Helper: TWindowProcHelper; Helper: TWindowProcHelper;
begin begin
FillChar(Helper, SizeOf(TWindowProcHelper), 0); FillChar(Helper{%H-}, SizeOf(TWindowProcHelper), 0);
Helper.Window := Window; Helper.Window := Window;
Helper.Msg := Msg; Helper.Msg := Msg;
Helper.WParam := WParam; Helper.WParam := WParam;
@ -2856,7 +2854,7 @@ begin
if (Int16(LoWord(LParam)) <> 0) or (Int16(HiWord(LParam)) <> 0) then if (Int16(LoWord(LParam)) <> 0) or (Int16(HiWord(LParam)) <> 0) then
begin begin
Parent := Windows.GetParent(Window); Parent := Windows.GetParent(Window);
Windows.GetClientRect(Parent, LRect); Windows.GetClientRect(Parent, LRect{%H-});
Windows.SetWindowPos(Window, HWND_TOP, 0, 0, LRect.Right, LRect.Bottom, 0); Windows.SetWindowPos(Window, HWND_TOP, 0, 0, LRect.Right, LRect.Bottom, 0);
end; end;
end; end;

View File

@ -26,7 +26,7 @@ unit Win32Extra;
interface interface
uses uses
InterfaceBase, Classes, LCLType, Windows, GraphType, SysUtils, ActiveX, ShlObj; Classes, LCLType, Windows, GraphType, SysUtils, ActiveX, ShlObj;
{ Win32 API constants not included in windows.pp } { Win32 API constants not included in windows.pp }
const const
@ -515,7 +515,7 @@ begin
SrcLineOrder := GetBitmapOrder(SrcSection.dsBm, SrcBmp); SrcLineOrder := GetBitmapOrder(SrcSection.dsBm, SrcBmp);
// setup info shared by alpha, source and destination bytes // setup info shared by alpha, source and destination bytes
FillChar(Info, sizeof(Info), 0); FillChar(Info{%H-}, sizeof(Info), 0);
Info.Header.biSize := sizeof(Windows.TBitmapInfoHeader); Info.Header.biSize := sizeof(Windows.TBitmapInfoHeader);
Info.Header.biWidth := nWidthDest; Info.Header.biWidth := nWidthDest;
if SrcLineOrder = riloBottomToTop if SrcLineOrder = riloBottomToTop
@ -551,7 +551,7 @@ begin
Info.Header.biSizeImage := nWidthSrc * nHeightSrc * 4; Info.Header.biSizeImage := nWidthSrc * nHeightSrc * 4;
// create temp bitmap to store orginal grayscale alpha // create temp bitmap to store orginal grayscale alpha
TmpBmp := CreateDIBSection(hdcSrc, PBitmapInfo(@Info)^, DIB_RGB_COLORS, TmpBytesPtr, 0, 0); TmpBmp := CreateDIBSection(hdcSrc, PBitmapInfo(@Info)^, DIB_RGB_COLORS, TmpBytesPtr{%H-}, 0, 0);
if TmpBmp = 0 then Exit(False); if TmpBmp = 0 then Exit(False);
if TmpBytesPtr = nil if TmpBytesPtr = nil
then begin then begin
@ -582,7 +582,7 @@ begin
Info.Header.biSizeImage := nWidthDest * nHeightDest * 4; Info.Header.biSizeImage := nWidthDest * nHeightDest * 4;
// create bitmap to store stretched grayscale alpha // create bitmap to store stretched grayscale alpha
AlphaBmp := CreateDIBSection(hdcSrc, PBitmapInfo(@Info)^, DIB_RGB_COLORS, AlphaBytesPtr, 0, 0); AlphaBmp := CreateDIBSection(hdcSrc, PBitmapInfo(@Info)^, DIB_RGB_COLORS, AlphaBytesPtr{%H-}, 0, 0);
if (AlphaBmp = 0) or (AlphaBytesPtr = nil) if (AlphaBmp = 0) or (AlphaBytesPtr = nil)
then begin then begin
FreeMem(SrcBytesPtr); FreeMem(SrcBytesPtr);
@ -668,7 +668,7 @@ begin
or (DstSection.dsBmih.biCompression <> BI_RGB) or (DstSection.dsBmih.biCompression <> BI_RGB)
then begin then begin
// create temp dib // create temp dib
DstBmp := CreateDIBSection(hdcSrc, PBitmapInfo(@Info)^, DIB_RGB_COLORS, DstBytesPtr, 0, 0); DstBmp := CreateDIBSection(hdcSrc, PBitmapInfo(@Info)^, DIB_RGB_COLORS, DstBytesPtr{%H-}, 0, 0);
// copy destination // copy destination
DC := CreateCompatibleDC(hdcDest); DC := CreateCompatibleDC(hdcDest);
OldBmp := SelectObject(DC, DstBmp); OldBmp := SelectObject(DC, DstBmp);

View File

@ -151,7 +151,7 @@ var
lProcessEvent: PProcessEvent absolute AData; lProcessEvent: PProcessEvent absolute AData;
exitcode: dword; exitcode: dword;
begin begin
if not Windows.GetExitCodeProcess(lProcessEvent^.Handle, exitcode) then if not Windows.GetExitCodeProcess(lProcessEvent^.Handle, exitcode{%H-}) then
exitcode := 0; exitcode := 0;
lProcessEvent^.OnEvent(lProcessEvent^.UserData, cerExit, exitcode); lProcessEvent^.OnEvent(lProcessEvent^.UserData, cerExit, exitcode);
end; end;
@ -259,7 +259,7 @@ var
begin begin
WndClassName := 'LazRubberBand' + IntToStr(ABrush); WndClassName := 'LazRubberBand' + IntToStr(ABrush);
if not Windows.GetClassInfo(System.HInstance, PChar(WndClassName), WindowClass) then if not Windows.GetClassInfo(System.HInstance, PChar(WndClassName), WindowClass{%H-}) then
begin begin
with WindowClass do with WindowClass do
begin begin
@ -701,7 +701,7 @@ begin
//Issue #0027664 //Issue #0027664
if (WindowsVersion >= wvVista) and (GetFileVersion(comctl32) >= ComCtlVersionIE6) then if (WindowsVersion >= wvVista) and (GetFileVersion(comctl32) >= ComCtlVersionIE6) then
begin begin
FillChar(TaskConfig, SizeOf(TaskConfig), 0); FillChar(TaskConfig{%H-}, SizeOf(TaskConfig), 0);
TaskConfig.cbSize := SizeOf(TaskConfig); TaskConfig.cbSize := SizeOf(TaskConfig);
// if we skip hwndParent our form will be a root window - with the taskbar item and icon // if we skip hwndParent our form will be a root window - with the taskbar item and icon
// this is unwanted // this is unwanted
@ -815,7 +815,7 @@ var
then DstBpp := 24 then DstBpp := 24
else DstBpp := ADesc.BitsPerPixel; else DstBpp := ADesc.BitsPerPixel;
FillChar(Info, SizeOf(Info), 0); FillChar(Info{%H-}, SizeOf(Info), 0);
Info.Header.biSize := SizeOf(Info.Header); Info.Header.biSize := SizeOf(Info.Header);
Info.Header.biWidth := ADesc.Width; Info.Header.biWidth := ADesc.Width;
if ADesc.LineOrder = riloTopToBottom if ADesc.LineOrder = riloTopToBottom
@ -832,7 +832,7 @@ var
// Use createDIBSection, since only devicedepth bitmaps can be selected into a DC // Use createDIBSection, since only devicedepth bitmaps can be selected into a DC
// when they are created with createDIBitmap // when they are created with createDIBitmap
// ABitmap := Windows.CreateDIBitmap(DC, Info.Header, CBM_INIT, ARawImage.Data, Windows.PBitmapInfo(@Info)^, DIB_RGB_COLORS); // ABitmap := Windows.CreateDIBitmap(DC, Info.Header, CBM_INIT, ARawImage.Data, Windows.PBitmapInfo(@Info)^, DIB_RGB_COLORS);
ABitmap := Windows.CreateDIBSection(DC, Windows.PBitmapInfo(@Info)^, DIB_RGB_COLORS, DstLinePtr, 0, 0); ABitmap := Windows.CreateDIBSection(DC, Windows.PBitmapInfo(@Info)^, DIB_RGB_COLORS, DstLinePtr{%H-}, 0, 0);
Windows.ReleaseDC(0, DC); Windows.ReleaseDC(0, DC);
if ABitmap = 0 if ABitmap = 0
@ -1010,7 +1010,7 @@ var
R: TRect; R: TRect;
begin begin
ARawImage.Init; ARawImage.Init;
FillChar(WinDIB, SizeOf(WinDIB), 0); FillChar(WinDIB{%H-}, SizeOf(WinDIB), 0);
ASize := Windows.GetObject(ABitmap, SizeOf(WinDIB), @WinDIB); ASize := Windows.GetObject(ABitmap, SizeOf(WinDIB), @WinDIB);
if ASize = 0 if ASize = 0
then Exit(False); then Exit(False);
@ -1100,7 +1100,7 @@ begin
if h = 0 if h = 0
then h := Windows.GetDeviceCaps(ADC, VERTRES); then h := Windows.GetDeviceCaps(ADC, VERTRES);
FillChar(Info, SizeOf(Info), 0); FillChar(Info{%H-}, SizeOf(Info), 0);
Info.Header.biSize := SizeOf(Info.Header); Info.Header.biSize := SizeOf(Info.Header);
Info.Header.biWidth := w; Info.Header.biWidth := w;
Info.Header.biHeight := -h; Info.Header.biHeight := -h;
@ -1108,7 +1108,7 @@ begin
Info.Header.biBitCount := Windows.GetDeviceCaps(ADC, BITSPIXEL); Info.Header.biBitCount := Windows.GetDeviceCaps(ADC, BITSPIXEL);
Info.Header.biCompression := BI_RGB; Info.Header.biCompression := BI_RGB;
copyBmp := Windows.CreateDIBSection(copyDC, Windows.PBitmapInfo(@Info)^, DIB_RGB_COLORS, BitsPtr, 0, 0); copyBmp := Windows.CreateDIBSection(copyDC, Windows.PBitmapInfo(@Info)^, DIB_RGB_COLORS, BitsPtr{%H-}, 0, 0);
copyOld := Windows.SelectObject(copyDC, copyBmp); copyOld := Windows.SelectObject(copyDC, copyBmp);
// prefill bitmap, to create an alpha channel in case of 32bpp bitmap // prefill bitmap, to create an alpha channel in case of 32bpp bitmap

View File

@ -153,7 +153,7 @@ begin
raise Exception.Create('Out of bounds.') raise Exception.Create('Out of bounds.')
else else
begin begin
SetLength(w, Windows.SendMessageW(FWin32List, FFlagGetTextLen, Index, 0)); SetLength(w{%H-}, Windows.SendMessageW(FWin32List, FFlagGetTextLen, Index, 0));
Windows.SendMessageW(FWin32List, FFlagGetText, Index, LPARAM(PWideChar(w))); Windows.SendMessageW(FWin32List, FFlagGetText, Index, LPARAM(PWideChar(w)));
Result := UTF16ToUTF8(w); Result := UTF16ToUTF8(w);
end; end;
@ -327,7 +327,7 @@ begin
if Source is TStrings then if Source is TStrings then
begin begin
// save text in edit box, assigning strings clears the text // save text in edit box, assigning strings clears the text
TWin32WSCustomComboBox.GetText(FSender, EditText); TWin32WSCustomComboBox.GetText(FSender, EditText{%H-});
inherited Assign(Source); inherited Assign(Source);

View File

@ -72,7 +72,7 @@ begin
Result := ''; Result := '';
exit; exit;
end; end;
Setlength(WideBuffer, len); Setlength(WideBuffer{%H-}, len);
PWord(@WideBuffer[1])^ := len+1; PWord(@WideBuffer[1])^ := len+1;
len := SendMessageW(FHandle, EM_GETLINE, Index, lparam(PWideChar(WideBuffer))); len := SendMessageW(FHandle, EM_GETLINE, Index, lparam(PWideChar(WideBuffer)));
Result := UTF16ToUTF8(WideBuffer); Result := UTF16ToUTF8(WideBuffer);
@ -168,7 +168,7 @@ begin
if (AdjustedValue <> Text) then if (AdjustedValue <> Text) then
begin begin
Windows.SetWindowTextW(FHandle, PWideChar(UTF8ToUTF16(AdjustedValue))); Windows.SetWindowTextW(FHandle, PWideChar(UTF8ToUTF16(AdjustedValue)));
FillChar(Msg, SizeOf(Msg), 0); FillChar(Msg{%H-}, SizeOf(Msg), 0);
Msg.Msg := CM_TEXTCHANGED; Msg.Msg := CM_TEXTCHANGED;
DeliverMessage(Owner, Msg); DeliverMessage(Owner, Msg);
end; end;

View File

@ -400,7 +400,7 @@ begin
end else end else
if retVal = WAIT_OBJECT_0 + FWaitHandleCount then if retVal = WAIT_OBJECT_0 + FWaitHandleCount then
begin begin
while PeekMessage(AMessage, HWnd(nil), 0, 0, PM_REMOVE) do while PeekMessage(AMessage{%H-}, HWnd(nil), 0, 0, PM_REMOVE) do
begin begin
if AMessage.message = WM_QUIT then if AMessage.message = WM_QUIT then
begin begin
@ -654,7 +654,7 @@ procedure TWin32WidgetSet.UpdateMDIClientBounds;
var var
I: Integer; I: Integer;
begin begin
Windows.GetClientRect(Application.MainFormHandle, Result); Windows.GetClientRect(Application.MainFormHandle, Result{%H-});
for I := 0 to Application.MainForm.ControlCount - 1 do for I := 0 to Application.MainForm.ControlCount - 1 do
if Application.MainForm.Controls[I].Visible then if Application.MainForm.Controls[I].Visible then
case Application.MainForm.Controls[I].Align of case Application.MainForm.Controls[I].Align of

View File

@ -564,7 +564,7 @@ begin
WinHandle := ATabControl.Handle; WinHandle := ATabControl.Handle;
// Adjust page size to fit in tabcontrol, need bounds of tab control in client of parent // Adjust page size to fit in tabcontrol, need bounds of tab control in client of parent
TWin32WidgetSet(WidgetSet).GetClientRect(WinHandle, R); TWin32WidgetSet(WidgetSet).GetClientRect(WinHandle, R{%H-});
for I := 0 to ATabControl.PageCount - 1 do for I := 0 to ATabControl.PageCount - 1 do
begin begin
lPage := ATabControl.Page[I]; lPage := ATabControl.Page[I];
@ -599,9 +599,9 @@ var
Mess: TLMNotify; Mess: TLMNotify;
NMHdr: tagNMHDR; NMHdr: tagNMHDR;
begin begin
FillChar(Mess,SizeOf(Mess),0); FillChar(Mess{%H-},SizeOf(Mess),0);
Mess.Msg := LM_NOTIFY; Mess.Msg := LM_NOTIFY;
FillChar(NMHdr,SizeOf(NMHdr),0); FillChar(NMHdr{%H-},SizeOf(NMHdr),0);
NMHdr.code := TCN_SELCHANGE; NMHdr.code := TCN_SELCHANGE;
NMHdr.hwndfrom := AHandle; NMHdr.hwndfrom := AHandle;
NMHdr.idfrom := APageIndex; //use this to set pageindex to the correct page. NMHdr.idfrom := APageIndex; //use this to set pageindex to the correct page.

View File

@ -645,7 +645,7 @@ var
IntfWidth, IntfHeight: integer; IntfWidth, IntfHeight: integer;
begin begin
Result := False; Result := False;
LCLIntf.GetWindowSize(Sender.Handle, IntfWidth, IntfHeight); LCLIntf.GetWindowSize(Sender.Handle, IntfWidth{%H-}, IntfHeight{%H-});
if (Sender.Width = IntfWidth) and (Sender.Height = IntfHeight) and (not Sender.ClientRectNeedsInterfaceUpdate) then if (Sender.Width = IntfWidth) and (Sender.Height = IntfHeight) and (not Sender.ClientRectNeedsInterfaceUpdate) then
Exit; Exit;
Result := True; Result := True;
@ -689,7 +689,7 @@ begin
if not (Sender is TWinControl) then exit; if not (Sender is TWinControl) then exit;
if not TheWinControl.HandleAllocated then exit; if not TheWinControl.HandleAllocated then exit;
Handle := TheWinControl.Handle; Handle := TheWinControl.Handle;
FillChar(ORect, SizeOf(ORect), 0); FillChar(ORect{%H-}, SizeOf(ORect), 0);
if TheWinControl is TScrollingWinControl then if TheWinControl is TScrollingWinControl then
begin begin
{$ifdef RedirectDestroyMessages} {$ifdef RedirectDestroyMessages}
@ -723,7 +723,7 @@ begin
// add the upper frame with the caption // add the upper frame with the caption
DC := Windows.GetDC(Handle); DC := Windows.GetDC(Handle);
SelectObject(DC, TheWinControl.Font.Reference.Handle); SelectObject(DC, TheWinControl.Font.Reference.Handle);
Windows.GetTextMetrics(DC, TM); Windows.GetTextMetrics(DC, TM{%H-});
ORect.Top := TM.TMHeight + 3; ORect.Top := TM.TMHeight + 3;
Windows.ReleaseDC(Handle, DC); Windows.ReleaseDC(Handle, DC);
// add the left, right and bottom frame borders // add the left, right and bottom frame borders
@ -778,8 +778,8 @@ procedure GetWin32ControlPos(Window, Parent: HWND; var Left, Top: integer);
var var
parRect, winRect: Windows.TRect; parRect, winRect: Windows.TRect;
begin begin
Windows.GetWindowRect(Window, winRect); Windows.GetWindowRect(Window, winRect{%H-});
Windows.GetWindowRect(Parent, parRect); Windows.GetWindowRect(Parent, parRect{%H-});
Left := winRect.Left - parRect.Left; Left := winRect.Left - parRect.Left;
Top := winRect.Top - parRect.Top; Top := winRect.Top - parRect.Top;
end; end;
@ -1048,7 +1048,7 @@ begin
oldFontHandle := SelectObject(canvasHandle, newFontHandle); oldFontHandle := SelectObject(canvasHandle, newFontHandle);
DeleteAmpersands(Text); DeleteAmpersands(Text);
Result := LCLIntf.GetTextExtentPoint32(canvasHandle, PChar(Text), Length(Text), textSize); Result := LCLIntf.GetTextExtentPoint32(canvasHandle, PChar(Text), Length(Text), textSize{%H-});
if Result then if Result then
begin begin
@ -1070,7 +1070,7 @@ var
WideBuffer: WideString; WideBuffer: WideString;
begin begin
TextLen := Windows.GetWindowTextLengthW(AHandle); TextLen := Windows.GetWindowTextLengthW(AHandle);
SetLength(WideBuffer, TextLen); SetLength(WideBuffer{%H-}, TextLen);
if TextLen > 0 // Never give Windows the chance to write to System.emptychar if TextLen > 0 // Never give Windows the chance to write to System.emptychar
then TextLen := Windows.GetWindowTextW(AHandle, PWideChar(WideBuffer), TextLen + 1); then TextLen := Windows.GetWindowTextW(AHandle, PWideChar(WideBuffer), TextLen + 1);
SetLength(WideBuffer, TextLen); SetLength(WideBuffer, TextLen);
@ -1193,7 +1193,7 @@ begin
then ScanLine := GetMem(AWinBmp.bmWidthBytes) then ScanLine := GetMem(AWinBmp.bmWidthBytes)
else ScanLine := nil; else ScanLine := nil;
FillChar(Info.Header, sizeof(Windows.TBitmapInfoHeader), 0); FillChar({%H-}Info.Header, sizeof(Windows.TBitmapInfoHeader), 0);
Info.Header.biSize := sizeof(Windows.TBitmapInfoHeader); Info.Header.biSize := sizeof(Windows.TBitmapInfoHeader);
DC := Windows.GetDC(0); DC := Windows.GetDC(0);
if Windows.GetDIBits(DC, ABitmap, 0, 1, nil, Windows.PBitmapInfo(@Info)^, DIB_RGB_COLORS) = 0 if Windows.GetDIBits(DC, ABitmap, 0, 1, nil, Windows.PBitmapInfo(@Info)^, DIB_RGB_COLORS) = 0
@ -1326,7 +1326,7 @@ function IsAlphaBitmap(ABitmap: HBITMAP): Boolean;
var var
Info: Windows.BITMAP; Info: Windows.BITMAP;
begin begin
FillChar(Info, SizeOf(Info), 0); FillChar(Info{%H-}, SizeOf(Info), 0);
Result := (GetObject(ABitmap, SizeOf(Info), @Info) <> 0) Result := (GetObject(ABitmap, SizeOf(Info), @Info) <> 0)
and (Info.bmBitsPixel = 32); and (Info.bmBitsPixel = 32);
end; end;

View File

@ -212,7 +212,7 @@ begin
idDialogConfirm: IconHandle := LoadImage(0, IDI_QUESTION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE or LR_SHARED); idDialogConfirm: IconHandle := LoadImage(0, IDI_QUESTION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE or LR_SHARED);
idDialogShield: idDialogShield:
begin begin
FillChar(SHIconInfo, SizeOf(SHIconInfo), 0); FillChar(SHIconInfo{%H-}, SizeOf(SHIconInfo), 0);
SHIconInfo.cbSize := SizeOf(SHIconInfo); SHIconInfo.cbSize := SizeOf(SHIconInfo);
if (SHGetStockIconInfo(SIID_SHIELD, SHGFI_ICON or SHGFI_LARGEICON, @SHIconInfo) = S_OK) then if (SHGetStockIconInfo(SIID_SHIELD, SHGFI_ICON or SHGFI_LARGEICON, @SHIconInfo) = S_OK) then
IconHandle := SHIconInfo.hIcon IconHandle := SHIconInfo.hIcon
@ -291,7 +291,7 @@ begin
begin begin
w := UTF8ToUTF16(S); w := UTF8ToUTF16(S);
GetThemeTextExtent(Theme[Element], DC, Part, State, PWideChar(W), Length(W), GetThemeTextExtent(Theme[Element], DC, Part, State, PWideChar(W), Length(W),
Flags, BoundingRect, Result); Flags, BoundingRect, Result{%H-});
end end
else else
Result := inherited GetTextExtent(DC, Details, S, Flags, BoundingRect); Result := inherited GetTextExtent(DC, Details, S, Flags, BoundingRect);
@ -432,7 +432,7 @@ begin
ExStyle := GetWindowLong(Handle, GWL_EXSTYLE); ExStyle := GetWindowLong(Handle, GWL_EXSTYLE);
if (ExStyle and WS_EX_CLIENTEDGE) <> 0 then if (ExStyle and WS_EX_CLIENTEDGE) <> 0 then
begin begin
GetWindowRect(Handle, DrawRect); GetWindowRect(Handle, DrawRect{%H-});
OffsetRect(DrawRect, -DrawRect.Left, -DrawRect.Top); OffsetRect(DrawRect, -DrawRect.Left, -DrawRect.Top);
DC := GetWindowDC(Handle); DC := GetWindowDC(Handle);
try try

View File

@ -159,7 +159,7 @@ var
WideBuffer: widestring; WideBuffer: widestring;
begin begin
// Fill TNotifyIconDataW // Fill TNotifyIconDataW
FillChar(tnidw, SizeOf(tnidw), 0); FillChar(tnidw{%H-}, SizeOf(tnidw), 0);
tnidw.cbSize := SizeOf(tnidw); tnidw.cbSize := SizeOf(tnidw);
tnidw.hWnd := ATrayIcon.Handle; tnidw.hWnd := ATrayIcon.Handle;
tnidw.uID := uIDTrayIcon; tnidw.uID := uIDTrayIcon;
@ -197,7 +197,7 @@ var
tnid: TNotifyIconData; tnid: TNotifyIconData;
begin begin
// Fill TNotifyIconData // Fill TNotifyIconData
FillChar(tnid, SizeOf(tnid), 0); FillChar(tnid{%H-}, SizeOf(tnid), 0);
tnid.cbSize := SizeOf(TNotifyIconData); tnid.cbSize := SizeOf(TNotifyIconData);
tnid.hWnd := ATrayIcon.Handle; tnid.hWnd := ATrayIcon.Handle;
tnid.uID := uIDTrayIcon; tnid.uID := uIDTrayIcon;
@ -270,7 +270,7 @@ var
WideBuffer: widestring; WideBuffer: widestring;
begin begin
// Fill TNotifyIconDataW // Fill TNotifyIconDataW
FillChar(tnidw, SizeOf(tnidw), 0); FillChar(tnidw{%H-}, SizeOf(tnidw), 0);
tnidw.cbSize := SizeOf(tnidw); tnidw.cbSize := SizeOf(tnidw);
tnidw.hWnd := ATrayIcon.Handle; tnidw.hWnd := ATrayIcon.Handle;
tnidw.uID := uIDTrayIcon; tnidw.uID := uIDTrayIcon;

View File

@ -54,7 +54,7 @@ begin
if Angle16DegLength < 0 then OldArcDirection := Windows.SetArcDirection(DC, AD_CLOCKWISE) if Angle16DegLength < 0 then OldArcDirection := Windows.SetArcDirection(DC, AD_CLOCKWISE)
else OldArcDirection := Windows.SetArcDirection(DC, AD_COUNTERCLOCKWISE); else OldArcDirection := Windows.SetArcDirection(DC, AD_COUNTERCLOCKWISE);
Angles2Coords(Left, Top, Right - Left, Bottom - Top, Angle16Deg, Angle16DegLength, SX, SY, EX, EY); Angles2Coords(Left, Top, Right - Left, Bottom - Top, Angle16Deg, Angle16DegLength, SX{%H-}, SY{%H-}, EX{%H-}, EY{%H-});
Result := Boolean(Windows.Arc(DC, Left, Top, Right, Bottom, SX, SY, EX, EY)); Result := Boolean(Windows.Arc(DC, Left, Top, Right, Bottom, SX, SY, EX, EY));
// Revert the arc direction to the previous value // Revert the arc direction to the previous value
Windows.SetArcDirection(DC, OldArcDirection); Windows.SetArcDirection(DC, OldArcDirection);
@ -77,7 +77,7 @@ function TWin32WidgetSet.AngleChord(DC: HDC; x1, y1, x2, y2, angle1,
var var
SX, SY, EX, EY : Longint; SX, SY, EX, EY : Longint;
begin begin
Angles2Coords(x1, y1, x2-x1, y2-y1, Angle1, Angle2, SX, SY, EX, EY); Angles2Coords(x1, y1, x2-x1, y2-y1, Angle1, Angle2, SX{%H-}, SY{%H-}, EX{%H-}, EY{%H-});
Result := Boolean(Windows.Chord(DC, x1, y1, x2, y2, SX, SY, EX, EY)); Result := Boolean(Windows.Chord(DC, x1, y1, x2, y2, SX, SY, EX, EY));
end; end;
@ -181,7 +181,7 @@ var
SystemWParam := Windows.WParam(Longint(PointToSmallPointNoChecks(Pos))); SystemWParam := Windows.WParam(Longint(PointToSmallPointNoChecks(Pos)));
// send scroll message // send scroll message
FillChar(ScrollInfo, sizeof(ScrollInfo), #0); FillChar(ScrollInfo{%H-}, sizeof(ScrollInfo), #0);
ScrollInfo.cbSize := sizeof(ScrollInfo); ScrollInfo.cbSize := sizeof(ScrollInfo);
ScrollInfo.fMask := SIF_PAGE or SIF_POS or SIF_RANGE; ScrollInfo.fMask := SIF_PAGE or SIF_POS or SIF_RANGE;
// if mouse is over horizontal scrollbar, scroll horizontally // if mouse is over horizontal scrollbar, scroll horizontally
@ -437,7 +437,7 @@ begin
BufferStream.Position := 0; BufferStream.Position := 0;
if FormatID=Windows.CF_UNICODETEXT then if FormatID=Windows.CF_UNICODETEXT then
begin; begin;
SetLength(BufferWideString, Size div 2); SetLength(BufferWideString{%H-}, Size div 2);
BufferStream.Read(BufferWideString[1], Size); BufferStream.Read(BufferWideString[1], Size);
//BufferString may have pending #0 's (or garbage after a #0) //BufferString may have pending #0 's (or garbage after a #0)
Size := Pos(#0, BufferWideString); Size := Pos(#0, BufferWideString);
@ -605,7 +605,7 @@ function TWin32WidgetSet.ClipboardGetOwnerShip(ClipboardType: TClipboardType;
// we need to convert it from UTF8 to UTF16 or Ansi // we need to convert it from UTF8 to UTF16 or Ansi
begin begin
if DataStream.Size>0 then begin if DataStream.Size>0 then begin
SetLength(BufferString, DataStream.Size); SetLength(BufferString{%H-}, DataStream.Size);
DataStream.Read(BufferString[1], DataStream.Size); DataStream.Read(BufferString[1], DataStream.Size);
if FormatID=Windows.CF_UNICODETEXT then if FormatID=Windows.CF_UNICODETEXT then
begin begin
@ -1340,6 +1340,7 @@ var
Rec: PProcRedirRec absolute Data; Rec: PProcRedirRec absolute Data;
ALogFont: TEnumLogFontExA; ALogFont: TEnumLogFontExA;
begin begin
FillChar(ALogFont{%H-}, SizeOf(ALogFont), 0);
Move(ELogFont.elfLogFont, ALogFont.elfLogFont, SizeOf(ALogFont.elfLogFont) - SizeOf(ALogFont.elfLogFont.lfFaceName)); Move(ELogFont.elfLogFont, ALogFont.elfLogFont, SizeOf(ALogFont.elfLogFont) - SizeOf(ALogFont.elfLogFont.lfFaceName));
ALogFont.elfLogFont.lfFaceName := UTF16ToUTF8(ELogFont.elfLogFont.lfFaceName); ALogFont.elfLogFont.lfFaceName := UTF16ToUTF8(ELogFont.elfLogFont.lfFaceName);
ALogFont.elfFullName := UTF16ToUTF8(ELogFont.elfFullName); ALogFont.elfFullName := UTF16ToUTF8(ELogFont.elfFullName);
@ -1532,7 +1533,7 @@ begin
nIndex := SFindFirstCharSurrogate(W); nIndex := SFindFirstCharSurrogate(W);
if nIndex > 0 then if nIndex > 0 then
begin begin
SConvertDxArrayFromUTF8ToWide(W, Dx, Count, DxWide, nIndex); SConvertDxArrayFromUTF8ToWide(W, Dx, Count, DxWide{%H-}, nIndex);
Result := Windows.ExtTextOutW(DC, X, Y, Options, LPRECT(Rect), PWideChar(W), Length(W), @DxWide[0]); Result := Windows.ExtTextOutW(DC, X, Y, Options, LPRECT(Rect), PWideChar(W), Length(W), @DxWide[0]);
Exit; Exit;
end; end;
@ -1856,7 +1857,7 @@ begin
// there is no way to get offset for memory or metafile DC => assume it 0 // there is no way to get offset for memory or metafile DC => assume it 0
Result := GetObjectType(PaintDC) = OBJ_DC; Result := GetObjectType(PaintDC) = OBJ_DC;
if not Result then Exit; if not Result then Exit;
Result := Windows.GetDCOrgEx(PaintDC, DCOrg); Result := Windows.GetDCOrgEx(PaintDC, DCOrg{%H-});
if not Result then Exit; if not Result then Exit;
winOrg.X := 0; winOrg.X := 0;
winOrg.Y := 0; winOrg.Y := 0;
@ -1898,7 +1899,7 @@ begin
hWindow := WindowFromDC(DC); hWindow := WindowFromDC(DC);
if hWindow <> HWND(nil) then if hWindow <> HWND(nil) then
begin begin
Result := GetClientRect(hWindow, ClientRect); Result := GetClientRect(hWindow, ClientRect{%H-});
P.x := ClientRect.Right; P.x := ClientRect.Right;
P.y := ClientRect.Bottom; P.y := ClientRect.Bottom;
end; end;
@ -2432,7 +2433,7 @@ begin
// maximized or aero snap windows will have problems // maximized or aero snap windows will have problems
if (GetWindowLong(Handle, GWL_STYLE) and WS_CHILD = 0) then if (GetWindowLong(Handle, GWL_STYLE) and WS_CHILD = 0) then
begin begin
FillChar(Info, SizeOf(Info), 0); FillChar(Info{%H-}, SizeOf(Info), 0);
Info.cbSize := SizeOf(Info); Info.cbSize := SizeOf(Info);
Result := GetWindowInfo(Handle, @Info); Result := GetWindowInfo(Handle, @Info);
if Result then if Result then
@ -3679,7 +3680,7 @@ function TWin32WidgetSet.StretchMaskBlt(DestDC: HDC; X, Y, Width, Height: Intege
Result := HasAlphaN or (HasAlpha0 and HasAlpha255); Result := HasAlphaN or (HasAlpha0 and HasAlpha255);
if Result if Result
then begin then begin
FillChar(Header, SizeOf(Header), 0); FillChar(Header{%H-}, SizeOf(Header), 0);
Header.biSize := SizeOf(Header); Header.biSize := SizeOf(Header);
Header.biWidth := AWinBmp.bmWidth; Header.biWidth := AWinBmp.bmWidth;
Header.biHeight := -AWinBmp.bmHeight; Header.biHeight := -AWinBmp.bmHeight;

View File

@ -71,7 +71,10 @@ uses
Win32Int, Win32Proc; Win32Int, Win32Proc;
type type
TBitBtnAceess = class(TCustomBitBtn) TBitBtnAccess = class(TBitBtn)
end;
TCustomBitBtnAccess = class(TCustomBitBtn)
end; end;
{ TWin32WSBitBtn } { TWin32WSBitBtn }
@ -97,7 +100,7 @@ function Create32BitHBitmap(ADC: HDC; AWidth, AHeight: Integer; out BitsPtr: Poi
var var
Info: Windows.TBitmapInfo; Info: Windows.TBitmapInfo;
begin begin
FillChar(Info, SizeOf(Info), 0); FillChar(Info{%H-}, SizeOf(Info), 0);
Info.bmiHeader.biSize := SizeOf(Info.bmiHeader); Info.bmiHeader.biSize := SizeOf(Info.bmiHeader);
Info.bmiHeader.biWidth := AWidth; Info.bmiHeader.biWidth := AWidth;
Info.bmiHeader.biHeight := -AHeight; // top down Info.bmiHeader.biHeight := -AHeight; // top down
@ -173,9 +176,10 @@ var
OldBitmapHandle := SelectObject(hdcNewBitmap, NewBitmap); OldBitmapHandle := SelectObject(hdcNewBitmap, NewBitmap);
if UseThemes and AlphaDraw then if UseThemes and AlphaDraw then
begin begin
FillChar(PaintParams, SizeOf(PaintParams), 0); FillChar(PaintParams{%H-}, SizeOf(PaintParams), 0);
PaintParams.cbSize := SizeOf(PaintParams); PaintParams.cbSize := SizeOf(PaintParams);
PaintParams.dwFlags := BPPF_ERASE; PaintParams.dwFlags := BPPF_ERASE;
TmpDC := 0;
PaintBuffer := BeginBufferedPaint(hdcNewBitmap, @BitmapRect, BPBF_COMPOSITED, @PaintParams, TmpDC); PaintBuffer := BeginBufferedPaint(hdcNewBitmap, @BitmapRect, BPBF_COMPOSITED, @PaintParams, TmpDC);
end end
else else
@ -202,7 +206,7 @@ var
begin begin
if (srcWidth <> 0) and (srcHeight <> 0) then if (srcWidth <> 0) and (srcHeight <> 0) then
begin begin
TBitBtnAceess(BitBtn).FButtonGlyph.GetImageIndexAndEffect(AState, BitBtn.Font.PixelsPerInch, 1, TCustomBitBtnAccess(BitBtn).FButtonGlyph.GetImageIndexAndEffect(AState, BitBtn.Font.PixelsPerInch, 1,
AImageRes, AIndex, AEffect); AImageRes, AIndex, AEffect);
TWin32WSCustomImageListResolution.DrawToDC( TWin32WSCustomImageListResolution.DrawToDC(
AImageRes.Resolution, AImageRes.Resolution,
@ -220,7 +224,7 @@ var
if (srcWidth <> 0) and (srcHeight <> 0) then if (srcWidth <> 0) and (srcHeight <> 0) then
begin begin
TBitBtnAceess(BitBtn).FButtonGlyph.GetImageIndexAndEffect(AState, BitBtn.Font.PixelsPerInch, 1, TCustomBitBtnAccess(BitBtn).FButtonGlyph.GetImageIndexAndEffect(AState, BitBtn.Font.PixelsPerInch, 1,
AImageRes, AIndex, AEffect); AImageRes, AIndex, AEffect);
if UseThemes and not AlphaDraw then if UseThemes and not AlphaDraw then
begin begin
@ -261,7 +265,7 @@ var
else else
begin begin
Details := ThemeServices.GetElementDetails(StateToDetail[AState]); Details := ThemeServices.GetElementDetails(StateToDetail[AState]);
FillChar(Options, SizeOf(Options), 0); FillChar(Options{%H-}, SizeOf(Options), 0);
Options.dwSize := SizeOf(Options); Options.dwSize := SizeOf(Options);
Options.dwFlags := DTT_COMPOSITED; Options.dwFlags := DTT_COMPOSITED;
TextFlags := DT_SINGLELINE; TextFlags := DT_SINGLELINE;
@ -300,7 +304,7 @@ begin
if BitBtn.CanShowGlyph(True) then if BitBtn.CanShowGlyph(True) then
begin begin
TBitBtnAceess(BitBtn).FButtonGlyph.GetImageIndexAndEffect(Low(TButtonState), BitBtn.Font.PixelsPerInch, 1, TCustomBitBtnAccess(BitBtn).FButtonGlyph.GetImageIndexAndEffect(Low(TButtonState), BitBtn.Font.PixelsPerInch, 1,
AImageRes, AIndex, AEffect); AImageRes, AIndex, AEffect);
srcWidth := AImageRes.Width; srcWidth := AImageRes.Width;
srcHeight := AImageRes.Height; srcHeight := AImageRes.Height;
@ -317,7 +321,7 @@ begin
BitBtnLayout := BidiAdjustButtonLayout(BitBtn.UseRightToLeftReading, BitBtn.Layout); BitBtnLayout := BidiAdjustButtonLayout(BitBtn.UseRightToLeftReading, BitBtn.Layout);
BitBtnDC := GetDC(BitBtnHandle); BitBtnDC := GetDC(BitBtnHandle);
hdcNewBitmap := CreateCompatibleDC(BitBtnDC); hdcNewBitmap := CreateCompatibleDC(BitBtnDC);
MeasureText(BitBtn, ButtonCaption, TextSize.cx, TextSize.cy); MeasureText(BitBtn, ButtonCaption, {%H-}TextSize.cx, {%H-}TextSize.cy);
// calculate size of new bitmap // calculate size of new bitmap
case BitBtnLayout of case BitBtnLayout of
blGlyphLeft, blGlyphRight: blGlyphLeft, blGlyphRight:
@ -590,7 +594,7 @@ begin
begin begin
if BitBtn.CanShowGlyph(True) then if BitBtn.CanShowGlyph(True) then
begin begin
TBitBtnAceess(BitBtn).FButtonGlyph.GetImageIndexAndEffect(Low(TButtonState), BitBtn.Font.PixelsPerInch, 1, TBitBtnAccess(BitBtn).FButtonGlyph.GetImageIndexAndEffect(Low(TButtonState), BitBtn.Font.PixelsPerInch, 1,
AImageRes, AIndex, AEffect); AImageRes, AIndex, AEffect);
srcWidth := AImageRes.Width; srcWidth := AImageRes.Width;
if BitBtn.Spacing = -1 then if BitBtn.Spacing = -1 then

View File

@ -58,7 +58,7 @@ type
implementation implementation
uses uses
Win32Int, InterfaceBase; Win32Int;
{ TWin32WSCustomCalendar } { TWin32WSCustomCalendar }
@ -149,7 +149,7 @@ begin
Result := cpNoWhere; Result := cpNoWhere;
if not WSCheckHandleAllocated(ACalendar, 'TWin32WSCustomCalendar.HitTest') then if not WSCheckHandleAllocated(ACalendar, 'TWin32WSCustomCalendar.HitTest') then
Exit; Exit;
FillChar(HitTestInfo, SizeOf(HitTestInfo), 0); FillChar(HitTestInfo{%H-}, SizeOf(HitTestInfo), 0);
//the MCHITTESTINFO structure not only depends on Windows version but also on wether or not //the MCHITTESTINFO structure not only depends on Windows version but also on wether or not
//the application has a Manifest (Issue #0029975) //the application has a Manifest (Issue #0029975)
if (WindowsVersion >= wvVista) and HasManifest then if (WindowsVersion >= wvVista) and HasManifest then
@ -160,7 +160,7 @@ begin
{$ifdef debug_win32calendar} {$ifdef debug_win32calendar}
if IsConsole then writeln(' HitTestInfo.cbSize = ',HitTestInfo.cbSize); if IsConsole then writeln(' HitTestInfo.cbSize = ',HitTestInfo.cbSize);
{$endif} {$endif}
HitPart := SendMessage(ACalendar.Handle, MCM_HITTEST, 0, LPARAM(@HitTestInfo)); HitPart := SendMessage(ACalendar.Handle, MCM_HITTEST, 0, {%H-}LPARAM(@HitTestInfo));
{$ifdef debug_win32calendar} {$ifdef debug_win32calendar}
//if IsConsole then writeln('TWin32WSCustomCalendar.HitTest: Handle = ',IntToHex(ACalendar.Handle,8)); //if IsConsole then writeln('TWin32WSCustomCalendar.HitTest: Handle = ',IntToHex(ACalendar.Handle,8));
if IsConsole then writeln(' APoint = (',APoint.x,',',APoint.y,'), pt = (',HitTestInfo.pt.x,',',HitTestInfo.pt.y,')'); if IsConsole then writeln(' APoint = (',APoint.x,',',APoint.y,'), pt = (',HitTestInfo.pt.x,',',HitTestInfo.pt.y,')');
@ -232,7 +232,7 @@ begin
Exit; Exit;
if ADayOfWeek = dowDefault then begin if ADayOfWeek = dowDefault then begin
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, PWideChar(tmp), SizeOf(tmp)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, PWideChar(tmp), SizeOf(tmp));
dow := StrToInt(tmp[0]); dow := StrToInt(char(ord(tmp[0])));
end else end else
dow := ord(ADayOfWeek); dow := ord(ADayOfWeek);
MonthCal_SetFirstDayOfWeek(ACalendar.Handle, dow); MonthCal_SetFirstDayOfWeek(ACalendar.Handle, dow);

View File

@ -315,7 +315,7 @@ begin
DebugLn(['Failed to create win32 control, error: ', AErrorCode, ' : ', GetLastErrorText(AErrorCode)]); DebugLn(['Failed to create win32 control, error: ', AErrorCode, ' : ', GetLastErrorText(AErrorCode)]);
raise Exception.Create('Failed to create win32 control, error: ' + IntToStr(AErrorCode) + ' : ' + GetLastErrorText(AErrorCode)); raise Exception.Create('Failed to create win32 control, error: ' + IntToStr(AErrorCode) + ' : ' + GetLastErrorText(AErrorCode));
end; end;
GetWindowRect(PreferredSizeStatusBar, R); GetWindowRect(PreferredSizeStatusBar, R{%H-});
PreferredStatusBarHeight := R.Bottom - R.Top; PreferredStatusBarHeight := R.Bottom - R.Top;
DestroyWindow(PreferredSizeStatusBar); DestroyWindow(PreferredSizeStatusBar);
end; end;

View File

@ -272,7 +272,7 @@ begin
if GetTextExtentPoint32W(ALV.Canvas.Handle, if GetTextExtentPoint32W(ALV.Canvas.Handle,
PWideChar(UTF8ToUTF16(ALV.Column[AIndex].Caption)), PWideChar(UTF8ToUTF16(ALV.Column[AIndex].Caption)),
UTF8Length(ALV.Column[AIndex].Caption), UTF8Length(ALV.Column[AIndex].Caption),
CaptionSize) then CaptionSize{%H-}) then
begin begin
// to retrieve the column width that can contain the string without // to retrieve the column width that can contain the string without
// truncating it, you must add padding to the returned string width // truncating it, you must add padding to the returned string width
@ -500,7 +500,7 @@ begin
then Exit; then Exit;
Hdr := ListView_GetHeader(ALV.Handle); Hdr := ListView_GetHeader(ALV.Handle);
FillChar(itm, sizeof(itm),0); FillChar(itm{%H-}, sizeof(itm),0);
itm.mask := HDI_FORMAT; itm.mask := HDI_FORMAT;
Header_GetItem(Hdr, AIndex, Itm); Header_GetItem(Hdr, AIndex, Itm);
case AAndicator of case AAndicator of
@ -1132,8 +1132,8 @@ begin
hwndHeader := GetHeader(AHandle); hwndHeader := GetHeader(AHandle);
if hwndHeader = 0 then Exit; // nothing to do if hwndHeader = 0 then Exit; // nothing to do
Windows.GetClientRect(AHandle, rc); Windows.GetClientRect(AHandle, rc{%H-});
FillChar(hdLayout, SizeOf(hdLayout), 0); FillChar(hdLayout{%H-}, SizeOf(hdLayout), 0);
hdLayout.prc := @rc; hdLayout.prc := @rc;
hdLayout.pwpos := @wpos; hdLayout.pwpos := @wpos;
Header_Layout(hwndHeader, hdLayout); Header_Layout(hwndHeader, hdLayout);
@ -1397,7 +1397,7 @@ begin
if not WSCheckHandleAllocated(ALV, 'SetViewOrigin') if not WSCheckHandleAllocated(ALV, 'SetViewOrigin')
then Exit; then Exit;
ListView_GetOrigin(ALV.Handle, Origin); ListView_GetOrigin(ALV.Handle, Origin{%H-});
dx := AValue.X - Origin.X; dx := AValue.X - Origin.X;
dy := AValue.Y - Origin.Y; dy := AValue.Y - Origin.Y;

View File

@ -351,7 +351,7 @@ var
begin begin
if (H <> 0) and (Msg = WM_InitDialog) then if (H <> 0) and (Msg = WM_InitDialog) then
begin begin
ws := TColorDialog(PChooseColor(L)^.lCustData).Title; ws := WideString(TColorDialog(PChooseColor(L)^.lCustData).Title);
SetWindowTextW(H, PWideChar(ws)); SetWindowTextW(H, PWideChar(ws));
end; end;
Result := 0; Result := 0;
@ -881,7 +881,7 @@ begin
I := 0; I := 0;
while I < Count do while I < Count do
begin begin
if Succeeded(ShellItems.GetItemAt(I, ShellItem)) then if Succeeded(ShellItems.GetItemAt(I, ShellItem{%H-})) then
AOpenDialog.Files.Add(GetFileName(ShellItem)); AOpenDialog.Files.Add(GetFileName(ShellItem));
inc(I); inc(I);
end; end;
@ -1128,7 +1128,7 @@ begin
begin begin
//debugln(['FontDialogCallBack: WM_INITDIALOG']); //debugln(['FontDialogCallBack: WM_INITDIALOG']);
//debugln([' PChooseFontW(LParam)^.lCustData=',IntToHex(PChooseFontW(LParam)^.lCustData,8)]); //debugln([' PChooseFontW(LParam)^.lCustData=',IntToHex(PChooseFontW(LParam)^.lCustData,8)]);
PtrInt(Dlg) := PChooseFontW(LParam)^.lCustData; Dlg := Pointer(PChooseFontW(LParam)^.lCustData);
end; end;
WM_COMMAND: WM_COMMAND:
begin begin

View File

@ -30,10 +30,9 @@ uses
// rtl // rtl
Windows, CommCtrl, SysUtils, Classes, Windows, CommCtrl, SysUtils, Classes,
// lcl // lcl
ExtCtrls, Controls, ImgList, LCLType, LCLIntf, LazUTF8, Themes, LCLMessageGlue, ComCtrls, WSComCtrls, ExtCtrls, Controls, ImgList, LCLType, LCLIntf, LazUTF8, Themes, ComCtrls,
// ws // ws
WSControls, WSExtCtrls, WSLCLClasses, WSProc, Win32Extra, Win32Int, Win32Proc, WSExtCtrls, WSLCLClasses, Win32Extra, Win32Int, Win32Proc;
InterfaceBase, Win32WSControls;
type type
{ TWin32WSPage } { TWin32WSPage }

View File

@ -116,10 +116,10 @@ begin
// attach our child to the template window // attach our child to the template window
AControl.ParentWindow := hWnd; AControl.ParentWindow := hWnd;
GetWindowRect(stc32Handle, ARect); GetWindowRect(stc32Handle, ARect{%H-});
ScreenToClient(hWnd, ARect.TopLeft); ScreenToClient(hWnd, ARect.TopLeft);
ScreenToClient(hWnd, ARect.BottomRight); ScreenToClient(hWnd, ARect.BottomRight);
GetClientRect(hWnd, ADialogRect); GetClientRect(hWnd, ADialogRect{%H-});
with ARect do with ARect do
begin begin

View File

@ -646,7 +646,7 @@ begin
// if position is default it will be changed to designed. We do not want this. // if position is default it will be changed to designed. We do not want this.
if wcfInitializing in TWinControlAccess(AWinControl).FWinControlFlags then if wcfInitializing in TWinControlAccess(AWinControl).FWinControlFlags then
begin begin
if GetWindowRect(AForm.Handle, CurRect) then if GetWindowRect(AForm.Handle, CurRect{%H-}) then
begin begin
if AForm.Position in [poDefault, poDefaultPosOnly] then if AForm.Position in [poDefault, poDefaultPosOnly] then
begin begin

View File

@ -114,7 +114,7 @@ class procedure TWin32WSCustomImageListResolution.AddData(AListHandle: TLCLIntfH
DC: HDC; DC: HDC;
DataCount, DataSize: Integer; DataCount, DataSize: Integer;
begin begin
FillChar(Info, SizeOf(Info), 0); FillChar(Info{%H-}, SizeOf(Info), 0);
Info.bmiHeader.biSize := SizeOf(Info.bmiHeader); Info.bmiHeader.biSize := SizeOf(Info.bmiHeader);
Info.bmiHeader.biWidth := AWidth; Info.bmiHeader.biWidth := AWidth;
Info.bmiHeader.biHeight := -AHeight; // request top down Info.bmiHeader.biHeight := -AHeight; // request top down
@ -157,7 +157,7 @@ class procedure TWin32WSCustomImageListResolution.AddData(AListHandle: TLCLIntfH
DC: HDC; DC: HDC;
DataCount, DataSize, x, y, MaskStride: Integer; DataCount, DataSize, x, y, MaskStride: Integer;
begin begin
FillChar(Info, SizeOf(Info), 0); FillChar(Info{%H-}, SizeOf(Info), 0);
Info.bmiHeader.biSize := SizeOf(Info.bmiHeader); Info.bmiHeader.biSize := SizeOf(Info.bmiHeader);
Info.bmiHeader.biWidth := AWidth; Info.bmiHeader.biWidth := AWidth;
Info.bmiHeader.biHeight := -AHeight; // request top down Info.bmiHeader.biHeight := -AHeight; // request top down
@ -316,7 +316,7 @@ begin
if (ADrawEffect = gdeDisabled) and HasComCtl6 then if (ADrawEffect = gdeDisabled) and HasComCtl6 then
begin begin
// if it is manifested exe then use winXP algoriphm of gray painting // if it is manifested exe then use winXP algoriphm of gray painting
FillChar(DrawParams, SizeOf(DrawParams), 0); FillChar(DrawParams{%H-}, SizeOf(DrawParams), 0);
DrawParams.cbSize := SizeOf(DrawParams); DrawParams.cbSize := SizeOf(DrawParams);
DrawParams.himl := AList.Reference._Handle; DrawParams.himl := AList.Reference._Handle;
DrawParams.i := AIndex; DrawParams.i := AIndex;

View File

@ -83,7 +83,7 @@ type
implementation implementation
uses strutils; //uses strutils;
type type
TMenuItemHelper = class helper for TMenuItem TMenuItemHelper = class helper for TMenuItem

View File

@ -80,7 +80,7 @@ var
filename: WideString; filename: WideString;
ico: TIcon; ico: TIcon;
begin begin
fileName := ATreeView.GetPathFromNode(ANode); fileName := WideString(ATreeView.GetPathFromNode(ANode));
ico := GetShellIcon(fileName); ico := GetShellIcon(fileName);
try try
ATreeView.Canvas.Draw(ARect.Left, (ARect.Top + ARect.Bottom - ico.Height) div 2, ico); ATreeView.Canvas.Draw(ARect.Left, (ARect.Top + ARect.Bottom - ico.Height) div 2, ico);

View File

@ -120,7 +120,7 @@ function SpinUpDownWndProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
Result := (lWindowInfo<>nil) and (lWindowInfo^.AWinControl<>nil); Result := (lWindowInfo<>nil) and (lWindowInfo^.AWinControl<>nil);
if Result then if Result then
begin begin
FillChar(LMessage, SizeOf(LMessage), 0); FillChar(LMessage{%H-}, SizeOf(LMessage), 0);
LMessage.msg := Msg; LMessage.msg := Msg;
LMessage.wParam := WParam; LMessage.wParam := WParam;
LMessage.lParam := LParam; LMessage.lParam := LParam;

View File

@ -32,7 +32,7 @@ uses
StdCtrls, Controls, Graphics, Forms, Themes, StdCtrls, Controls, Graphics, Forms, Themes,
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
WSControls, WSStdCtrls, WSLCLClasses, WSProc, Windows, LCLIntf, LCLType, WSControls, WSStdCtrls, WSLCLClasses, WSProc, Windows, LCLIntf, LCLType,
LazUTF8, InterfaceBase, LMessages, LCLMessageGlue, TextStrings, LazUTF8, LMessages, LCLMessageGlue, TextStrings,
Win32Int, Win32Proc, Win32WSControls, Win32Extra, Win32Themes; Win32Int, Win32Proc, Win32WSControls, Win32Extra, Win32Themes;
type type
@ -784,7 +784,7 @@ begin
begin begin
// Listbox has a border and Width argument is a window rect => // Listbox has a border and Width argument is a window rect =>
// Decrease it by border width // Decrease it by border width
Windows.GetClientRect(AWinControl.Handle, ARect); Windows.GetClientRect(AWinControl.Handle, ARect{%H-});
DW := ARect.Right - ARect.Left; DW := ARect.Right - ARect.Left;
Windows.GetWindowRect(AWinControl.Handle, ARect); Windows.GetWindowRect(AWinControl.Handle, ARect);
DW := ARect.Right - ARect.Left - DW; DW := ARect.Right - ARect.Left - DW;
@ -818,7 +818,7 @@ begin
begin begin
// if drag is called by mouse down then we need to complete it with mouse up // if drag is called by mouse down then we need to complete it with mouse up
// since in other case we will not get the change event called // since in other case we will not get the change event called
GetCursorPos(P); GetCursorPos(P{%H-});
P := ACustomListBox.ScreenToClient(P); P := ACustomListBox.ScreenToClient(P);
CallDefaultWindowProc(ACustomListBox.Handle, WM_LBUTTONUP, 0, MAKELPARAM(P.X, P.Y)); CallDefaultWindowProc(ACustomListBox.Handle, WM_LBUTTONUP, 0, MAKELPARAM(P.X, P.Y));
end; end;
@ -1591,7 +1591,7 @@ var
begin begin
if Length(AText) > 0 then if Length(AText) > 0 then
begin begin
GetText(ACustomMemo, S); GetText(ACustomMemo, S{%H-});
S := S + AText; S := S + AText;
SetText(ACustomMemo, S); SetText(ACustomMemo, S);
end; end;