Jump to content
Sign in to follow this  
hispeed_mike

Dllcall - Call the Turn off Computer dialog

Recommended Posts

hispeed_mike

Hi All,

first dll call and I am just strgling to get me head around the conversion from VB to autoit and how to structure the call. I am trying to show the Turn Off Computer Dialog from XP. I cannot use the standard dialog windows uses as it has the shutdown option and we have modified the gina to only allow the restart button and some custom text we have injected.

Here is the VB script:

'System & API - How to Show Shutdown Dialog

Private Declare Function SHShutDownDialog Lib "shell32" Alias "#60" (ByVal YourGuess As Long) As Long

Private Sub Main()

SHShutDownDialog 0

End Sub

How Do I get it into a dllcall for autoit?

I have read the Help and multiple examples but I just don't get it. All help appreciated, thanks in advance.

Share this post


Link to post
Share on other sites
wolf9228

Hi All,

first dll call and I am just strgling to get me head around the conversion from VB to autoit and how to structure the call. I am trying to show the Turn Off Computer Dialog from XP. I cannot use the standard dialog windows uses as it has the shutdown option and we have modified the gina to only allow the restart button and some custom text we have injected.

Here is the VB script:

'System & API - How to Show Shutdown Dialog

Private Declare Function SHShutDownDialog Lib "shell32" Alias "#60" (ByVal YourGuess As Long) As Long

Private Sub Main()

SHShutDownDialog 0

End Sub

How Do I get it into a dllcall for autoit?

I have read the Help and multiple examples but I just don't get it. All help appreciated, thanks in advance.

;Private Declare Function SHShutDownDialog Lib "shell32" _
;Alias "#60" (ByVal lType As Long) As Long


SHShutDownDialog()


Func SHShutDownDialog()
$BOOL = DllCall("shell32.dll","int",60,"int",0)
if @error Then Return 0
Return $BOOL[0]
EndFunc
Edited by wolf9228

صرح السماء كان هنا

 

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.