Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unlock Windows Programmatically

1,261 views
Skip to first unread message

Rafael Chemtob

unread,
Aug 25, 2003, 1:37:25 PM8/25/03
to
Hi,
I want to create a VB app that will run on the windows
scheduler to do the following:
Unlock windows (basically sending the CTRL + ALT + Delete
keystrokes)
enter a username and password.

Or just call an API function or something to unlock
windows passing it the username and password as parameters
(if needed).

Please advise how to do this or when can I get more info
on this.

thanks
rafael

Rick

unread,
Aug 25, 2003, 2:13:23 PM8/25/03
to
you cannot send the CTRL+ALT+DELETE keystrokes in win2k or above.


"Rafael Chemtob" <rche...@nospam.yahoo.com> wrote in message
news:03fa01c36b2f$8bddf500$a101...@phx.gbl...

Jeff Johnson [MVP: VB]

unread,
Aug 25, 2003, 2:32:59 PM8/25/03
to

"Rafael Chemtob" <rche...@nospam.yahoo.com> wrote in message
news:03fa01c36b2f$8bddf500$a101...@phx.gbl...

> I want to create a VB app that will run on the windows

It cannot be done. From the documentation for the LockWorkstation() API
function:

This function has the same result as pressing Ctrl+Alt+Del and clicking Lock
Workstation. To unlock the workstation, the user must log in.

In other words, there is no programmatic way to UNlock a workstation. Don't
beat your head against a wall trying to make it happen.


Andrew Faust

unread,
Aug 25, 2003, 5:02:54 PM8/25/03
to

"Rick" <ri...@NOSPAM.computetosuit.com> wrote in message
news:uEsKUSza...@tk2msftngp13.phx.gbl...

> you cannot send the CTRL+ALT+DELETE keystrokes in
win2k or above.

VNC does it.

Andrew Faust


Andrew Faust

unread,
Aug 25, 2003, 5:05:17 PM8/25/03
to

"Jeff Johnson [MVP: VB]" <i....@enough.spam> wrote in
message news:#Ny$QdzaDH...@TK2MSFTNGP10.phx.gbl...

I have to dispute this. VNC can do it. I don't know how
it
does it exactly, but you can connect to a machine that
is locked
and send the CTL+ALT+DEL, then enter the username and
password all from a remote location.

Granted, I don't know how to do it, and it may be
really hard
but technically it can be done.

Andrew Faust


SteveVine

unread,
Aug 25, 2003, 5:20:36 PM8/25/03
to
It must be possible. There's gotta be a way. Surely. After all it's 2003.

"Rafael Chemtob" <rche...@nospam.yahoo.com> wrote in message
news:03fa01c36b2f$8bddf500$a101...@phx.gbl...

Rick

unread,
Aug 25, 2003, 5:59:43 PM8/25/03
to
OK, i guess what i should have said was

You cannot send the ctrl+alt+delete keystrokes in win2k or above by using
standard windows API calls.


"Andrew Faust" <afa...@aradyme.com.REMOVE> wrote in message
news:elTxIx0a...@TK2MSFTNGP09.phx.gbl...

Andrew Faust

unread,
Aug 25, 2003, 6:43:32 PM8/25/03
to

"Rick" <ri...@NOSPAM.computetosuit.com> wrote in message news:OA5dyQ1a...@TK2MSFTNGP10.phx.gbl...

> OK, i guess what i should have said was
>
> You cannot send the ctrl+alt+delete keystrokes in win2k or above by using
> standard windows API calls.

Fair enough. I for one have no idea how VNC does it, but it is open
source so if someone is feeling adventuresom, they can read through
the code and find it for us.

Andrew Faust


Rick

unread,
Aug 25, 2003, 7:12:59 PM8/25/03
to
SimulateCtrlAltDelThreadFn(void *context)
{
HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());

// Switch into the Winlogon desktop
if (!vncService::SelectDesktop("Winlogon"))
{
log.Print(LL_INTERR, VNCLOG("failed to select logon desktop\n"));
return FALSE;
}

log.Print(LL_ALL, VNCLOG("generating ctrl-alt-del\n"));

// Fake a hotkey event to any windows we find there.... :(
// Winlogon uses hotkeys to trap Ctrl-Alt-Del...
PostMessage(HWND_BROADCAST, WM_HOTKEY, 0, MAKELONG(MOD_ALT | MOD_CONTROL, VK_DELETE));

// Switch back to our original desktop
if (old_desktop != NULL)
vncService::SelectHDESK(old_desktop);

return NULL;
}


"Andrew Faust" <afa...@aradyme.com.REMOVE> wrote in message news:OQOJYp1a...@TK2MSFTNGP10.phx.gbl...

MikeD

unread,
Aug 25, 2003, 8:55:20 PM8/25/03
to

"Andrew Faust" <afa...@aradyme.com.REMOVE> wrote in message
news:uCK9dy0a...@TK2MSFTNGP10.phx.gbl...


I have no idea what VNC is, but perhaps it replaces Windows' GINA.DLL file
with its own.

Mike


Jeff Johnson [MVP: VB]

unread,
Aug 25, 2003, 10:08:55 PM8/25/03
to

"MikeD" <nob...@nowhere.edu> wrote in message
news:%23Ihq%23v2aD...@TK2MSFTNGP10.phx.gbl...

> I have no idea what VNC is, but perhaps it replaces Windows' GINA.DLL file
> with its own.

No, it doesn't. VNC is Virtual Network Computing. It's like Terminal
Server/Remote Desktops, but it works with Windows, Macs, and *NIX.


MikeD

unread,
Aug 25, 2003, 10:47:48 PM8/25/03
to

"Jeff Johnson [MVP: VB]" <i....@enough.spam> wrote in message
news:%23l%23lBb3a...@TK2MSFTNGP12.phx.gbl...


So....is VNC a company? A product? A technology?

Mike


Grinder

unread,
Aug 25, 2003, 11:07:43 PM8/25/03
to

"MikeD" <nob...@nowhere.edu> wrote in message
news:%237Mq0u3...@TK2MSFTNGP09.phx.gbl...

It's a freebie (at least it used to be) pcAnywhere work-alike.


Mike C.

unread,
Aug 25, 2003, 11:22:04 PM8/25/03
to
http://www.uk.research.att.com/vnc/


"MikeD" <nob...@nowhere.edu> wrote in message

news:%237Mq0u3...@TK2MSFTNGP09.phx.gbl...

Ben Taylor

unread,
Aug 26, 2003, 8:56:59 AM8/26/03
to
It can be done using LANDesk.

>.
>

Veign

unread,
Aug 26, 2003, 9:42:20 AM8/26/03
to
This is the new link;
http://www.realvnc.com/

--
Veign
Chris Hanscom
http://www.veign.com
Application Design Section
http://www.veign.com/information/application/info_app.html
------
"Mike C." <non...@nonet.net> wrote in message
news:uOAY7E4a...@TK2MSFTNGP09.phx.gbl...

Mike C.

unread,
Aug 26, 2003, 11:04:30 AM8/26/03
to
Hmmm, looks like the original dev team spawned off from AT&T to do their own
thing.

Thanks!

Mike C.


"Veign" <NOSPAM...@veign.com> wrote in message
news:u1lXgf9a...@TK2MSFTNGP10.phx.gbl...

Veign

unread,
Aug 26, 2003, 11:47:03 AM8/26/03
to
Ive been using the v4.0 Beta without any problems yet...Very nice program...

--
Veign
Chris Hanscom
http://www.veign.com
Application Design Section
http://www.veign.com/information/application/info_app.html
------
"Mike C." <non...@nonet.net> wrote in message

news:eZTfBM%23aDH...@TK2MSFTNGP12.phx.gbl...

Andrew Faust

unread,
Aug 26, 2003, 2:57:09 PM8/26/03
to
"Rick" <ri...@NOSPAM.computetosuit.com> wrote in message news:ehrmu51...@tk2msftngp13.phx.gbl...

> SimulateCtrlAltDelThreadFn(void *context)
> {
> HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
>
> // Switch into the Winlogon desktop
> if (!vncService::SelectDesktop("Winlogon"))
> {
> log.Print(LL_INTERR, VNCLOG("failed to select logon desktop\n"));
> return FALSE;
> }
>
> log.Print(LL_ALL, VNCLOG("generating ctrl-alt-del\n"));
>
> // Fake a hotkey event to any windows we find there.... :(
> // Winlogon uses hotkeys to trap Ctrl-Alt-Del...
> PostMessage(HWND_BROADCAST, WM_HOTKEY, 0, MAKELONG(MOD_ALT | MOD_CONTROL, VK_DELETE));

I guess it wasn't too hard to find afterall then? What I find interesting
is that they do just use a standard API call (PostMessage) but they
have to fake it as being a hotkey. That's just one of those neat
little things that most people would never have thought to try.

Andrew Faust


Andrew Faust

unread,
Aug 26, 2003, 2:58:54 PM8/26/03
to
"Mike C." <non...@nonet.net> wrote in message news:eZTfBM#aDHA...@TK2MSFTNGP12.phx.gbl...

> Hmmm, looks like the original dev team spawned off from AT&T to do their own
> thing.
>

They spawned off to do their own thing, but not by choice. AT&T closed
the research lab where they all worked.

Andrew Faust


Rick

unread,
Aug 26, 2003, 3:22:58 PM8/26/03
to
yeah, i noticed that too. Ill just be over here eating my words.....


"Andrew Faust" <afa...@aradyme.com.REMOVE> wrote in message news:e0YkiPA...@tk2msftngp13.phx.gbl...

0 new messages