@@ -173,18 +173,18 @@ function Detour_WinApi_DrawText(hDC: HDC; lpString: LPCWSTR; nCount: Integer; v
173173 OrgColor, LFontColor: Cardinal;
174174 RestoreColor : Boolean;
175175begin
176- OrgColor:= 0 ;
177- RestoreColor:= False;
176+ OrgColor := 0 ;
177+ RestoreColor := False;
178178
179- if (uFormat= 2084 ) and HookVTPaintNormalText and Assigned(TColorizerLocalSettings.Settings) and TColorizerLocalSettings.Settings.Enabled then
179+ if (uFormat = 2084 ) and HookVTPaintNormalText and TColorizerLocalSettings.Settings.Enabled then
180180 begin
181- LFontColor :=ColorToRGB(TColorizerLocalSettings.ColorMap.FontColor);
182- RestoreColor:= True;
183- OrgColor:= SetTextColor(hDC, LFontColor);
181+ LFontColor := ColorToRGB(TColorizerLocalSettings.ColorMap.FontColor);
182+ RestoreColor := True;
183+ OrgColor := SetTextColor(hDC, LFontColor);
184184 end ;
185185
186186 // SetTextColor(hDC, ColorToRGB(clRed));
187- Result:= Trampoline_DrawText(hDC, lpString, nCount, lpRect, uFormat);
187+ Result := Trampoline_DrawText(hDC, lpString, nCount, lpRect, uFormat);
188188 if RestoreColor then
189189 SetTextColor(hDC, OrgColor);
190190end ;
@@ -193,7 +193,7 @@ function Detour_WinApi_DrawText(hDC: HDC; lpString: LPCWSTR; nCount: Integer; v
193193{ .$IFDEF DELPHIXE6_UP}
194194function Detour_WinApi_DrawTextEx (DC: HDC; lpchText: LPCWSTR; cchText: Integer; var p4: TRect; dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
195195begin
196- if (dwDTFormat AND DT_CALCRECT = 0 ) and (HookDrawActiveTab or HookDrawInActiveTab) and Assigned(TColorizerLocalSettings.Settings) and TColorizerLocalSettings.Settings.Enabled then
196+ if (dwDTFormat AND DT_CALCRECT = 0 ) and (HookDrawActiveTab or HookDrawInActiveTab) and TColorizerLocalSettings.Settings.Enabled then
197197 begin
198198 if HookDrawActiveTab then
199199 begin
@@ -211,7 +211,7 @@ function Detour_WinApi_DrawTextEx(DC: HDC; lpchText: LPCWSTR; cchText: Integer;
211211 SetTextColor(DC, ColorToRGB(TryStrToColor(TColorizerLocalSettings.Settings.TabIDEActiveFontColor, TColorizerLocalSettings.ColorMap.FontColor)));
212212 end ;
213213 end ;
214- Result:= Trampoline_DrawTextEx(DC, lpchText, cchText, p4, dwDTFormat, DTParams);
214+ Result := Trampoline_DrawTextEx(DC, lpchText, cchText, p4, dwDTFormat, DTParams);
215215end ;
216216{ .$ENDIF}
217217
@@ -222,12 +222,12 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
222222 LBgColor, OrgColor : Cardinal;
223223 RestoreColor{ , RestoreBg} : Boolean;
224224begin
225- OrgColor :=0 ;
226- RestoreColor :=False;
225+ OrgColor := 0 ;
226+ RestoreColor := False;
227227
228228 if Assigned(TColorizerLocalSettings.Settings) and TColorizerLocalSettings.Settings.Enabled then
229229 begin
230- { $IFDEF DELPHIX_SEATTLE_UP}
230+ { $IFDEF DELPHIX_SEATTLE_UP}
231231 if HookNavSymbolSearchFormDrawItem then
232232 begin
233233 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.FontColor));
@@ -237,7 +237,7 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
237237 { $ENDIF}
238238 if DrawNamePair then
239239 begin
240- LBgColor:= GetBkColor(DC);
240+ LBgColor := GetBkColor(DC);
241241 if (TColor(LBgColor) = clWhite) or (TColor(LBgColor) = TColorizerLocalSettings.ColorMap.WindowColor) then
242242 begin
243243 if TColor(LBgColor) = clWhite then
@@ -249,7 +249,7 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
249249 SetBkColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.SelectedColor));
250250 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.SelectedFontColor));
251251 end ;
252- DrawNamePair:= False;
252+ DrawNamePair := False;
253253 end
254254 else
255255 begin
@@ -260,7 +260,7 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
260260 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.SelectedFontColor))
261261 else
262262 begin
263- if TColor(GetTextColor(DC))= $006D6D6D then
263+ if TColor(GetTextColor(DC)) = $006D6D6D then
264264 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.DisabledFontColor))
265265 else
266266 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.FontColor));
@@ -273,7 +273,7 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
273273 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.SelectedFontColor))
274274 else
275275 begin
276- if TColor(GetTextColor(DC))= $006D6D6D then
276+ if TColor(GetTextColor(DC)) = $006D6D6D then
277277 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.DisabledFontColor))
278278 else
279279 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.FontColor));
@@ -286,7 +286,7 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
286286 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.SelectedFontColor))
287287 else
288288 begin
289- if TColor(GetTextColor(DC))= $006D6D6D then
289+ if TColor(GetTextColor(DC)) = $006D6D6D then
290290 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.DisabledFontColor))
291291 else
292292 SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.FontColor));
@@ -434,16 +434,12 @@ function InterceptFillRect(hDC: hDC; const lprc: TRect; hbr: HBRUSH): Integer; s
434434
435435procedure InstallHooksWinAPI ();
436436begin
437- Trampoline_DrawText := InterceptCreate(@Windows.DrawTextW, @Detour_WinApi_DrawText);
438- Trampoline_DrawTextEx := InterceptCreate(@Windows.DrawTextEx, @Detour_WinApi_DrawTextEx);
439- Trampoline_ExtTextOutW := InterceptCreate(@Windows.ExtTextOutW, @Detour_WinApi_ExtTextOutW); // OK
440-
441-
442- Trampoline_GetSysColor := InterceptCreate(user32, ' GetSysColor' , @Detour_WinApi_GetSysColor);
443-
444-
437+ Trampoline_DrawText := InterceptCreate(@Windows.DrawTextW, @Detour_WinApi_DrawText);
438+ Trampoline_DrawTextEx := InterceptCreate(@Windows.DrawTextEx, @Detour_WinApi_DrawTextEx);
439+ Trampoline_ExtTextOutW := InterceptCreate(@Windows.ExtTextOutW, @Detour_WinApi_ExtTextOutW); // OK
440+ Trampoline_GetSysColor := InterceptCreate(user32, ' GetSysColor' , @Detour_WinApi_GetSysColor);
445441 // TrampolineGetSysColorBrush := InterceptCreate(user32, 'GetSysColorBrush', @InterceptGetSysColorBrush);
446- Trampoline_DrawEdge := InterceptCreate(user32, ' DrawEdge' , @Detour_WinApi_DrawEdge);
442+ Trampoline_DrawEdge := InterceptCreate(user32, ' DrawEdge' , @Detour_WinApi_DrawEdge);
447443 // Trampoline_DrawFrameControl := InterceptCreate(user32, 'DrawFrameControl', @Detour_WinApi_DrawFrameControl);
448444 // TrampolineFillRect := InterceptCreate(user32, 'FillRect', @InterceptFillRect);
449445end ;
@@ -467,10 +463,9 @@ initialization
467463 VCLStylesLock := TCriticalSection.Create;
468464 VCLStylesBrush := TObjectDictionary<string, TListStyleBrush>.Create([doOwnsValues]);
469465finalization
470- VCLStylesBrush.Free;
471- VCLStylesLock.Free;
472- VCLStylesLock := nil ;
473-
466+ VCLStylesBrush.Free;
467+ VCLStylesLock.Free;
468+ VCLStylesLock := nil ;
474469
475470end .
476471
0 commit comments