Jump to content
ptrex

Windows LogOnOff Screen

Recommended Posts

ptrex

Windows LogOnOff Screen

Seems to be an undocumented API call ?

#Include <WinAPI.au3>

WinLogOnOff()

Func WinLogOnOff()
Local $nCount
    $nCount = DllCall("shell32.dll", "int", 60, "hwnd", 0)
        Return $nCount[0]
EndFunc

ConsoleWrite( "DllCall Error " & _WinAPI_GetLastError () & @CRLF & _WinAPI_GetLastErrorMessage ()) ;Error 13: The data is invalid.

Just something I had laying around.

Regards

ptrex

Edited by ptrex

Share this post


Link to post
Share on other sites
Emiel Wieldraaijer

Hi ptrex

Thanks for sharing

works indeed

don't know when i could could/should use it

Best regards,

Emiel


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites
TokGajah

Hi, i found more simple way

WinClose("[CLASS:Progman]", "")

Share this post


Link to post
Share on other sites
ptrex
zodiac

Doing a bit of grave digging here. :)

Is just tested these and they produce slightly different results. The computer I tried these on has a pending Windows Update. Using the function from ptrex displays the "Shut Down Windows" windows with the "Install updates and shut down" option pre-selectd, while the line from TokGajah doesn't even have that option.

Share this post


Link to post
Share on other sites
rajeshontheweb

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

×

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.