mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 12:41:45 +02:00
LCL/TColorDialog: Show Title property. Issue #39155, based on code submitted by jamie in https://forum.lazarus.freepascal.org/index.php/topic,55236.msg410713.html#msg410713
git-svn-id: trunk@65375 -
This commit is contained in:
parent
912b44ef09
commit
9d94d9e7e3
@ -345,6 +345,18 @@ end;
|
|||||||
|
|
||||||
{ TWin32WSColorDialog }
|
{ TWin32WSColorDialog }
|
||||||
|
|
||||||
|
Function CCHookProc(H: THandle; msg: Cardinal; W: WParam; L: LParam): UintPtr; StdCall;
|
||||||
|
var
|
||||||
|
ws: WideString;
|
||||||
|
begin
|
||||||
|
if (H <> 0) and (Msg = WM_InitDialog) then
|
||||||
|
begin
|
||||||
|
ws := TColorDialog(PChooseColor(L)^.lCustData).Title;
|
||||||
|
SetWindowTextW(H, PWideChar(ws));
|
||||||
|
end;
|
||||||
|
Result := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
class function TWin32WSColorDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle;
|
class function TWin32WSColorDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle;
|
||||||
var
|
var
|
||||||
CC: PChooseColor;
|
CC: PChooseColor;
|
||||||
@ -372,7 +384,9 @@ begin
|
|||||||
RGBResult := ColorToRGB(ColorDialog.Color);
|
RGBResult := ColorToRGB(ColorDialog.Color);
|
||||||
LPCustColors := AllocMem(16 * SizeOf(DWord));
|
LPCustColors := AllocMem(16 * SizeOf(DWord));
|
||||||
FillCustomColors;
|
FillCustomColors;
|
||||||
Flags := CC_FULLOPEN or CC_RGBINIT;
|
lCustData := LParam(ACommonDialog);
|
||||||
|
lpfnHook := @CCHookProc;
|
||||||
|
Flags := CC_FULLOPEN or CC_RGBINIT or CC_ENABLEHOOK;
|
||||||
end;
|
end;
|
||||||
Result := THandle(CC);
|
Result := THandle(CC);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user