Kikoolol Posted August 4, 2009 Share Posted August 4, 2009 Hi !This is my first post and i don't speak very good English.I come from the french Forum, and this is my problem :When I use the function "PixelGetColor" (who return the color of one pixel) on Windows XP, the function takes ~0,3 ms,On windows Vista or Seven, the function takes ~20,3 MS for 1 Pixel ! When i disable the Aero theme and replace it with Windows Classique Theme I get the same result as in XP. how can I do to get better results with Vista Aero ?Sorry for my EnglishThank you in advance, and thanks to Google translation Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 4, 2009 Share Posted August 4, 2009 (edited) Aero is that slow on GDI+ on certain functions, there is nothing you can do about it. Either tell whoever is gonna run your script to disable it manually or run this code to do it automatically while the script is running:DllCall("dwmapi.dll", "uint", "DwmEnableComposition", "int", 0)Edit: BTW it's not really Aero that's causing the slowliness, it's DWM. But whatever, usually both are activated. Edited August 4, 2009 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Kikoolol Posted August 4, 2009 Author Share Posted August 4, 2009 Thanks a lot >_< But how can i know if the user have the "GDI +" enabled ? I would do this : If "Gdi Enabled" Then Msgbox("omg, would you like to disable the GDI ?") If Yes DllCall ( "dwmapi.dll", "uint", "DwmEnableComposition", "int", 0) If No Endif Thanks Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 4, 2009 Share Posted August 4, 2009 Maybe like this? (only tested very quickly) #include <GUIConstantsEx.au3> GUICreate(1024, 768) GUISetState() If _DwmIsEnabled() = True Then $Text = "By turning off DWM this script will be much much faster." & @CRLF & "Would you like me to turn off DWM for you?? (will be activated again when script end)" If MsgBox(4+32+262144, "It seems like you have DWM running.", $Text) = 6 Then _DwmEnable(False) EndIf Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _DwmIsEnabled() If FileExists("dwmapi.dll") Then Local $Bool $aTemp = DllCall("dwmapi.dll", "uint", "DwmIsCompositionEnabled", "int*", $Bool) If $aTemp[1] = True Then Return 1 Else Return SetError(1) EndIf Else Return SetError(2) EndIf EndFunc Func _DwmEnable($WhatToDo) DllCall("dwmapi.dll", "uint", "DwmEnableComposition", "int", $WhatToDo) EndFunc .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Kikoolol Posted August 4, 2009 Author Share Posted August 4, 2009 Even when the Dwm is disable the msgbox appear >_ Link to comment Share on other sites More sharing options...
Kikoolol Posted August 4, 2009 Author Share Posted August 4, 2009 up ? >_ Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 4, 2009 Share Posted August 4, 2009 I see the problem (I think). Does this work better? #include <GUIConstantsEx.au3> GUICreate(1024, 768) GUISetState() If _DwmIsEnabled() = True Then $Text = "By turning off DWM this script will be much much faster." & @CRLF & "Would you like me to turn off DWM for you?? (will be activated again when script end)" If MsgBox(4+32+262144, "It seems like you have DWM running.", $Text) = 6 Then _DwmEnable(False) EndIf Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _DwmIsEnabled() If FileExists(@SystemDir & "\dwmapi.dll") Then $Receiver = DllStructCreate("int") $aTemp = DllCall("dwmapi.dll", "uint", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($Receiver, 1)) $Receiver2 = DllStructCreate("int", $aTemp[1]) If DllStructGetData($Receiver2, 1) = True Then Return 1 Else Return SetError(1, 0, 0) EndIf Else Return SetError(2, 0, 0) EndIf EndFunc Func _DwmEnable($WhatToDo) DllCall("dwmapi.dll", "uint", "DwmEnableComposition", "int", $WhatToDo) EndFunc .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Kikoolol Posted August 4, 2009 Author Share Posted August 4, 2009 It's perfect >_< Thanks a lot ! Link to comment Share on other sites More sharing options...
Kikoolol Posted December 13, 2009 Author Share Posted December 13, 2009 Hi, sorry for the date, but i have detected a problem, on Windows Seven its perfect, but on Windows Vista, The Aero theme turns off, and reactivates immediately. How do to for made like Seven ? Thanks Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted December 13, 2009 Share Posted December 13, 2009 Hi, sorry for the date, but i have detected a problem, on Windows Seven its perfect, but on Windows Vista, The Aero theme turns off, and reactivates immediately. How do to for made like Seven ?ThanksThe code should work, I'm not sure why that is happening.Maybe you should choose another method to disable DWM. One of the easiest ways would be to right-click the exe-file for your script (or whatever you're botting), press Properties, go to the tab "Compatibility", and check the checkbox that says "Disable desktop composition". That will disable dwm while the process is running. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
MMKaresz Posted April 12, 2014 Share Posted April 12, 2014 I see the problem (I think). Does this work better? #include <GUIConstantsEx.au3> GUICreate(1024, 768) GUISetState() If _DwmIsEnabled() = True Then $Text = "By turning off DWM this script will be much much faster." & @CRLF & "Would you like me to turn off DWM for you?? (will be activated again when script end)" If MsgBox(4+32+262144, "It seems like you have DWM running.", $Text) = 6 Then _DwmEnable(False) EndIf Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _DwmIsEnabled() If FileExists(@SystemDir & "\dwmapi.dll") Then $Receiver = DllStructCreate("int") $aTemp = DllCall("dwmapi.dll", "uint", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($Receiver, 1)) $Receiver2 = DllStructCreate("int", $aTemp[1]) If DllStructGetData($Receiver2, 1) = True Then Return 1 Else Return SetError(1, 0, 0) EndIf Else Return SetError(2, 0, 0) EndIf EndFunc Func _DwmEnable($WhatToDo) DllCall("dwmapi.dll", "uint", "DwmEnableComposition", "int", $WhatToDo) EndFunc That's works perfect for me, shuts down aero, but it left one question. How can I make to stay on that state? I mean: If I switching off the DWM, it will switch itself back when the script ends. What can I do to keep in that state? Thank You! Link to comment Share on other sites More sharing options...
Bert Posted April 12, 2014 Share Posted April 12, 2014 You know this thread is over 4 years old? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
MMKaresz Posted April 13, 2014 Share Posted April 13, 2014 You know this thread is over 4 years old? ...But the problem is still exists. Any solution? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now