I am not pissed off, just frustrated with certain situations. If I was pissed off I wouldn't be here any more..
Appended is a mod to make it easier to use the same code for multiple color dialogs using what is already provided by windows for since the beginning of color dialogs.
Any one is free to do as they wish with this code, even wedge it into the widget if they feel like it.
I need to review the patch again, I only did with my local copy here which is 2.0.4 .
Function CCHookProc(H:THandle; msg:Cardinal; W:Wparam; L:Lparam):UintPtr; StdCall;
var
S:String;
Begin
If (H <> 0) and (Msg = Wm_InitDialog) then
Begin
S := TColorDialog(PchooseColor(L)^.lCustData).Title ;
SetWindowText(H, Pchar(S));
end;
Result := 0;
end;
procedure TForm1.ColorDialog1Show(Sender: TObject);
Var
C:PChooseColor;
begin
With TColorDialog(Sender) do
Begin
C := Pointer(Handle); //This handle is actually a pointer to a ChoseColor record;
C^.lpfnHook := @CCHookPRoc;
C^.lCustData := UintPtr(Sender); //Give the callback the Color dialog instance to play with.
C^.Flags := C^.Flags or CC_ENABLEHOOK;
end;
end;