@@ -173,18 +173,18 @@ function Detour_WinApi_DrawText(hDC: HDC; lpString: LPCWSTR; nCount: Integer; v
173
173
OrgColor, LFontColor: Cardinal;
174
174
RestoreColor : Boolean;
175
175
begin
176
- OrgColor:= 0 ;
177
- RestoreColor:= False;
176
+ OrgColor := 0 ;
177
+ RestoreColor := False;
178
178
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
180
180
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);
184
184
end ;
185
185
186
186
// SetTextColor(hDC, ColorToRGB(clRed));
187
- Result:= Trampoline_DrawText(hDC, lpString, nCount, lpRect, uFormat);
187
+ Result := Trampoline_DrawText(hDC, lpString, nCount, lpRect, uFormat);
188
188
if RestoreColor then
189
189
SetTextColor(hDC, OrgColor);
190
190
end ;
@@ -193,7 +193,7 @@ function Detour_WinApi_DrawText(hDC: HDC; lpString: LPCWSTR; nCount: Integer; v
193
193
{ .$IFDEF DELPHIXE6_UP}
194
194
function Detour_WinApi_DrawTextEx (DC: HDC; lpchText: LPCWSTR; cchText: Integer; var p4: TRect; dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
195
195
begin
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
197
197
begin
198
198
if HookDrawActiveTab then
199
199
begin
@@ -211,7 +211,7 @@ function Detour_WinApi_DrawTextEx(DC: HDC; lpchText: LPCWSTR; cchText: Integer;
211
211
SetTextColor(DC, ColorToRGB(TryStrToColor(TColorizerLocalSettings.Settings.TabIDEActiveFontColor, TColorizerLocalSettings.ColorMap.FontColor)));
212
212
end ;
213
213
end ;
214
- Result:= Trampoline_DrawTextEx(DC, lpchText, cchText, p4, dwDTFormat, DTParams);
214
+ Result := Trampoline_DrawTextEx(DC, lpchText, cchText, p4, dwDTFormat, DTParams);
215
215
end ;
216
216
{ .$ENDIF}
217
217
@@ -222,12 +222,12 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
222
222
LBgColor, OrgColor : Cardinal;
223
223
RestoreColor{ , RestoreBg} : Boolean;
224
224
begin
225
- OrgColor :=0 ;
226
- RestoreColor :=False;
225
+ OrgColor := 0 ;
226
+ RestoreColor := False;
227
227
228
228
if Assigned(TColorizerLocalSettings.Settings) and TColorizerLocalSettings.Settings.Enabled then
229
229
begin
230
- { $IFDEF DELPHIX_SEATTLE_UP}
230
+ { $IFDEF DELPHIX_SEATTLE_UP}
231
231
if HookNavSymbolSearchFormDrawItem then
232
232
begin
233
233
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.FontColor));
@@ -237,7 +237,7 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
237
237
{ $ENDIF}
238
238
if DrawNamePair then
239
239
begin
240
- LBgColor:= GetBkColor(DC);
240
+ LBgColor := GetBkColor(DC);
241
241
if (TColor(LBgColor) = clWhite) or (TColor(LBgColor) = TColorizerLocalSettings.ColorMap.WindowColor) then
242
242
begin
243
243
if TColor(LBgColor) = clWhite then
@@ -249,7 +249,7 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
249
249
SetBkColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.SelectedColor));
250
250
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.SelectedFontColor));
251
251
end ;
252
- DrawNamePair:= False;
252
+ DrawNamePair := False;
253
253
end
254
254
else
255
255
begin
@@ -260,7 +260,7 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
260
260
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.SelectedFontColor))
261
261
else
262
262
begin
263
- if TColor(GetTextColor(DC))= $006D6D6D then
263
+ if TColor(GetTextColor(DC)) = $006D6D6D then
264
264
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.DisabledFontColor))
265
265
else
266
266
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.FontColor));
@@ -273,7 +273,7 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
273
273
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.SelectedFontColor))
274
274
else
275
275
begin
276
- if TColor(GetTextColor(DC))= $006D6D6D then
276
+ if TColor(GetTextColor(DC)) = $006D6D6D then
277
277
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.DisabledFontColor))
278
278
else
279
279
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.FontColor));
@@ -286,7 +286,7 @@ function Detour_WinApi_ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint; Rec
286
286
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.SelectedFontColor))
287
287
else
288
288
begin
289
- if TColor(GetTextColor(DC))= $006D6D6D then
289
+ if TColor(GetTextColor(DC)) = $006D6D6D then
290
290
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.DisabledFontColor))
291
291
else
292
292
SetTextColor(DC, ColorToRGB(TColorizerLocalSettings.ColorMap.FontColor));
@@ -434,16 +434,12 @@ function InterceptFillRect(hDC: hDC; const lprc: TRect; hbr: HBRUSH): Integer; s
434
434
435
435
procedure InstallHooksWinAPI ();
436
436
begin
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);
445
441
// TrampolineGetSysColorBrush := InterceptCreate(user32, 'GetSysColorBrush', @InterceptGetSysColorBrush);
446
- Trampoline_DrawEdge := InterceptCreate(user32, ' DrawEdge' , @Detour_WinApi_DrawEdge);
442
+ Trampoline_DrawEdge := InterceptCreate(user32, ' DrawEdge' , @Detour_WinApi_DrawEdge);
447
443
// Trampoline_DrawFrameControl := InterceptCreate(user32, 'DrawFrameControl', @Detour_WinApi_DrawFrameControl);
448
444
// TrampolineFillRect := InterceptCreate(user32, 'FillRect', @InterceptFillRect);
449
445
end ;
@@ -467,10 +463,9 @@ initialization
467
463
VCLStylesLock := TCriticalSection.Create;
468
464
VCLStylesBrush := TObjectDictionary<string, TListStyleBrush>.Create([doOwnsValues]);
469
465
finalization
470
- VCLStylesBrush.Free;
471
- VCLStylesLock.Free;
472
- VCLStylesLock := nil ;
473
-
466
+ VCLStylesBrush.Free;
467
+ VCLStylesLock.Free;
468
+ VCLStylesLock := nil ;
474
469
475
470
end .
476
471
0 commit comments