Jump to content

Function Conversation in Autoit


Recommended Posts

Hello there;

i want to know that how can i convert this function in AutoIt ?

<code>

DWORD WINAPI PowerSetActiveScheme(

__in_opt HKEY UserRootPowerKey,

__in const GUID *SchemeGuid

);

</code>

this is my rough attempt, i want to know about __in const GUID *SchemeGuid

Func PowerSetActiveScheme($sGUID)
    ConsoleWrite("> sel: "&$sGUID&@CRLF)
    Local $tGUID = DllStructCreate($tagGUID)
    Local $pGUID = DllStructGetPtr($tGUID)
    DllCall("ole32.dll", "long", "CLSIDFromString", "wstr", '{' & $sGUID & '}', "ptr", $pGUID)
    If @error Then Return SetError(@error, @extended, 0)
    Local $res = DllCall('PowrProf.dll', "int", 'PowerSetActiveScheme', 'ptr', 0, 'ptr', $pGUID)
    ConsoleWrite($res[0] & @CRLF)
EndFunc   ;==>PowerSetActiveScheme

thanks in advance

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...