|
|
#1 |
|
Member
Join Date: Jan 01
Location: Chicago
Posts: 40
![]() |
This took me a while to figure out, so I thought I would pass it on.
VB Code:
|
|
|
|
|
|
#2 |
|
Super Moderator
Join Date: Aug 01
Location: Sterling Heights, Michigan
Posts: 54,243
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Curiosity questions: Have you tried this code with both NT 4 Workstation and Windows 2000 Workstation?
Will this work on only workstation, or have you tried in Server as well?
__________________
Please use [Code]your code goes in here[/Code] tags when posting code. When you have received an answer to your question, please mark it as resolved using the Thread Tools menu. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum. ![]() Creating A Wizard In VB.NET Modifications Required For VB6 Apps To Work On Vista Paging A Recordset What is wrong with using On Error Resume Next Good Article: Language Enhancements In Visual Basic 2010 IT professionals freelancer site. Register today to find coders, or offer your services for available freelance projects! Upgrading VB6 Code To VB.NET Microsoft MVP 2005/2006/2007/2008/2009/2010 |
|
|
|
|
|
#3 |
|
Member
Join Date: Jan 01
Location: Chicago
Posts: 40
![]() |
I only tried it on the workstation.
|
|
|
|
|
|
#4 |
|
Member
Join Date: Dec 01
Location: Amsterdam
Posts: 52
![]() |
I'm sorry to say I can't get the code to work correctly under NT4 workstation.
![]() I've been writing a program to easy logoff, reboot, etc. But I didn't get the screen locking to work, so this seemed a good solution. This code does not start the screen saver for me, although I have one configured with password. Nothing seems to be happening, but when I then press CTRL-ALT-DEL, I have to type my password, as if the workstation had been locked. Normally, it would show the menu with shutdown, taskmanager, etc.Anyway, it's a start, when I find out what caused the problem, I'll tell it here.
|
|
|
|
|
|
#5 |
|
Black Cat
Join Date: Nov 00
Location: WNY, USA
Posts: 4,032
![]() |
FYI, Windows 2000 + has a really simple to use LockWorkstation API call.
|
|
|
|
|
|
#6 |
|
Super Moderator
Join Date: Aug 01
Location: Sterling Heights, Michigan
Posts: 54,243
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I believe the LockWorkStation API also works under NT4.
__________________
Please use [Code]your code goes in here[/Code] tags when posting code. When you have received an answer to your question, please mark it as resolved using the Thread Tools menu. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum. ![]() Creating A Wizard In VB.NET Modifications Required For VB6 Apps To Work On Vista Paging A Recordset What is wrong with using On Error Resume Next Good Article: Language Enhancements In Visual Basic 2010 IT professionals freelancer site. Register today to find coders, or offer your services for available freelance projects! Upgrading VB6 Code To VB.NET Microsoft MVP 2005/2006/2007/2008/2009/2010 |
|
|
|
|
|
#7 |
|
Member
Join Date: Dec 01
Location: Amsterdam
Posts: 52
![]() |
I suppose the VB declaration would be:
Private Declare Sub LockWorkStation Lib "user32.dll" () That's copied from http://www.vbforums.com/showthread.p...threadid=44075 . I run NT4, and this little trick doesn't work. So it really is win2000+ only. |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|