Recent

Author Topic: Q about UXTheme: GetThemePosition, GetThemeRect, do those work?  (Read 202 times)

d7_2_laz

  • Sr. Member
  • ****
  • Posts: 439
Q about UXTheme: GetThemePosition, GetThemeRect, do those work?
« on: September 20, 2023, 05:11:38 pm »
For an app that uses theming (UXTheme), I ran into this situation:

within a function only getting as parameters:  hTheme: HTHEME; hdc: HDC; <some-others>
I’d need to find out the wincontrol resp. wincontrol’s handle to which the action belongs to..

Tried several strategies, beneath those:
Code: Pascal  [Select][+][-]
  1.    aResult := GetThemePosition(hTheme, iPartId, iStateId, aPropId, aPoint);

I never got any reasonable result for that. Same e.g. as for:

Code: Pascal  [Select][+][-]
  1.   aResult := GetThemeRect (hTheme, iPartId, iStateId, aPropId, aRect);

My question: is there anybody who ever got those two functions to work ?

(Besides: WindowFromDC  --  hwnd := WindowFromDC(hdc);  --  wont’t work either, because the device context isn’t directly  bound to a hwnd).
     

 

TinyPortal © 2005-2018