Detect Windows Style
Detect Windows Style
Is there a way i can do this? like If in windows 7, I wanna detect if the users is currently using aero style or the old windows 95 style.
Re: Detect Windows Style
don't know about the styles but to detect if desktop composition is on you could try this
I don't have vista or win7 so not sure if this is right and you'll probably want to update it to use a prototype
I don't have vista or win7 so not sure if this is right and you'll probably want to update it to use a prototype
Code: Select all
Procedure DwmIsCompositionEnabled()
Protected *pfn,Lib,result
Lib = LoadLibrary_("dwmapi.dll")
If Lib
*pfn = GetProcAddress_(Lib, "DwmIsCompositionEnabled")
If *pfn
Result = CallFunctionFast(*pfn)
EndIf
FreeLibrary_(Lib)
EndIf
ProcedureReturn result
EndProcedure
Debug DwmIsCompositionEnabled()
Windows 11, Manjaro, Raspberry Pi OS
Re: Detect Windows Style
@idle
your code is wrong
the result comes not in the returnvalue of function!
here the corrected code with prototype (work on x86, x64, unicode and ascii)
greetings
Thomas
your code is wrong
the result comes not in the returnvalue of function!
here the corrected code with prototype (work on x86, x64, unicode and ascii)
Code: Select all
Prototype DwmIsCompositionEnabled(*pfEnabled)
Procedure DwmIsCompositionEnabled()
Protected fpIsCompositionEnabled.DwmIsCompositionEnabled
Protected Lib, result
Lib = OpenLibrary(#PB_Any, "dwmapi.dll")
If Lib
fpIsCompositionEnabled = GetFunction(Lib, "DwmIsCompositionEnabled")
If fpIsCompositionEnabled
fpIsCompositionEnabled(@result)
EndIf
CloseLibrary(Lib)
EndIf
ProcedureReturn result
EndProcedure
Debug DwmIsCompositionEnabled()
Thomas
Re: Detect Windows Style
Thanks Thomas, I wasn't paying attention and couldn't test it either to see if it worked.
Windows 11, Manjaro, Raspberry Pi OS
Re: Detect Windows Style
Wow.. Thanks for this. I tried it with both style. It changed