Jump to content

Detect the "Unlock Computer" Dialog?


Marcus
 Share

Recommended Posts

Hello Folks!

Need a little intel on the "Lock Computer" dialog which is invoked by the WIN+L key combination in XP :P

Want to pause script operations JUST when the window/process exists, and cannot detect the presence of the window by the WinExists() method.

To add insult to injury, I have no idea of which process is responsible for the deployment of the dialog (I suspect that it's winlogon, but I hope not ;) )

I need another way of doing this . . .

Does anyone know what process is used to run this window? Is there another (indirect) way of detecting this window with v3??

Yikes!

Thanks again . . .

[center][font="Courier"][quote]Which end do you put the cheesecake in?[/quote][/font][/center]

Link to comment
Share on other sites

Hello Folks!

Need a little intel on the "Lock Computer" dialog which is invoked by the WIN+L key combination in XP :P

Want to pause script operations JUST when the window/process exists, and cannot detect the presence of the window by the WinExists() method.

To add insult to injury, I have no idea of which process is responsible for the deployment of the dialog (I suspect that it's winlogon, but I hope not ;) )

I need another way of doing this . . .

Does anyone know what process is used to run this window?  Is there another (indirect) way of detecting this window with v3??

Yikes!

Thanks again . . .

<{POST_SNAPBACK}>

i'm on a 2k machine right now, and that hotkey doesn't do anything... if it's the window i think it is though, i believe that all processes are paused while it is active, so detecting it via script may not be possible...a possible work around would be to watch for the hotkey combination with IsPressed...or if you're trying to disable it, you could just throw into your loop:

#include<ISPRESSED.AU3>
while 1
    if _IsPressed("5B") OR _IsPressed("5C") Then
        Send("{LWIN UP}{RWIN UP}")
    EndIf
WEnd

that will effectively disable the windows keys... adding a sleep will reduce processor load, but may allow for a lucky strike where the hotkey combination is registered before the check for the windows key

Link to comment
Share on other sites

@cameronsdad:

Hmmm...

This is a real bugger!

You see, the problem arises for me when logonui.exe is up -- this app plays a similar havoc with script activity. The scripts are not paused, but they're prone to malfunction when these processes are doing their thing. Locking out the hotkeys would probably be an iffy affair at this juncture ;)

Now, logonui itself wasn't a problem; as detection can be done via the ProcessExists() method. However, this one is; as even if I detect the hotkey combination which launches it (assuming that's possible while logonui is up), I still won't know when the "Unlock Computer" dialog/functionality has been dismissed :P

So, as far as I can tell, I'm left with a scenario which gives me only a couple of options:

1. Detect the process which launches the "Unlock Computer" dialog (if it's not always active, anyway); or

2. Scan the registry for an event which is a sure indication of the existence of this operational mode...

Thank you for the input! Any other ideas???

[center][font="Courier"][quote]Which end do you put the cheesecake in?[/quote][/font][/center]

Link to comment
Share on other sites

[Tested on WinXP Home SP2 with AutoIt 3.1.1]

Try the following.... If you have speakers and have Windows configured to "beep" when a dialog window appears, you should hear beeping every second when the workstation is locked.

AdlibEnable("CheckWindow")

While 1
    sleep(100)
WEnd

Func CheckWindow()
    $x = WinGetPos("");Get position of the 'Active Window'...
    If $x[1] > 1000000 And PixelGetColor(0,0) = 0xFFFFFF Then
        MsgBox(4096,"","Detected!",1)
    EndIf
EndFunc

It seems--at least on my computer--that WinGetPos on the active window returns large values when workstation is locked or if you click on a taskbar button of a minimized window..... It also appears that PixelGetColor at any position always returns 0xFFFFFF when workstation is locked. Between these two criteria, you might be able to detect when computer is locked!

Edit: For extra measure, you might also check color of random pixel location.

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

@CyberSlug

A third solution ... something which'd never occurred to me ;)

I think that your discovery here merits inclusion into the syntax as some sort of function -- maybe "WinSecureDetect()" would be a good name for it...

It's another one of those things which would be very useful when needed!

Thanks for the insight!

Have a great day!

[center][font="Courier"][quote]Which end do you put the cheesecake in?[/quote][/font][/center]

Link to comment
Share on other sites

i believe that all processes are paused while it is active,

They are not paused will be really bad if they are paused.

Only thing that happens is it captures all input so no programs can capture keyboard or mouse and some flag is set wich can be read by programs maybe it sends a signal not shure but I won't pause processes that will certainly crash the whole system.

I tried this

while 1 
$title = WinGetHandle ( "")
$timestamp = "[" & @hour & ":" & @min & ":" & @sec & "] "
Filewriteline("log.log",$timestamp & $title)
sleep(1000)
Wend

it returned

[18:41:00] 0x00000000

When the lock computer window was open.

Wich means zero maybe its the only time when win handle is zero so maybe good way to check if its locked or not I gues all other windows have handles bigger then 0 and its not a error It did not return a blank string just 0x00000000

So try WingetHandle to get the handle if its 0x00000000 It might mean its locked other programs have > 0x00000000

Edited by MrSpacely
Link to comment
Share on other sites

Working with the "Computer Locked" window is difficult because it exists in a different Desktop than your program.

It is in the Winsta0\Winlogon Desktop, and unless told otherwise, your program runs in the Winsta0\Default desktop. (Can't interact with each others' window objects directly) :P

Consult this MSDN page for further details: http://msdn.microsoft.com/library/default....nd_desktops.asp

I wrote a script a while back that launches processes in the Winlogon Desktop. Due to previous limitations, it had to use 3rd-party utilities.

It was interesting to use the AutoIt Window Spy utility to inspect the "Computer Locked", "Windows Security", and Welcome screen. ;)

Now that the DLLStruct... beta functions are available, it is possible to interact with other desktops and window stations using just the API.

Perhaps I'll dig up the code and update it to use the API.

Hope this helps.

Good luck!

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

More help . . . thanks again ;)

BTW -- is anyone else having trouble receiving auto-notifications of new posts???

Queer not to get replies in the old inbox when they're posted...

[center][font="Courier"][quote]Which end do you put the cheesecake in?[/quote][/font][/center]

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...