?
Solved

VB: Win XP —» Need to Find "Switch User" API

Posted on 2004-08-27
4
Medium Priority
?
612 Views
Last Modified: 2009-12-16
I need to find something to fill in my need of a code snippet which progress the "Switch User" function. In which .dll do I find this function, or how do I imitate the behaviour? I'd like a full statement of how I do use the API if someone finds it.
Mentionable is that I contacted Microsoft's Support, and they were unable to help.

Grateful for a quick answer!
/Simeon
0
Comment
Question by:azoapes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 315 total points
ID: 11917208
If you press the "Windows key" in combination with the "L" key it will bring up the switch user window.  This is how you would do it via code:

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYEVENTF_KEYUP = &H2
Private Const VK_LWIN = &H5B

Private Sub Command1_Click()
    Call keybd_event(VK_LWIN, 0, 0, 0)
    Call keybd_event(76, 0, 0, 0) ' 76 = L
    Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
    Call keybd_event(76, 0, KEYEVENTF_KEYUP, 0)
End Sub
0
 
LVL 8

Accepted Solution

by:
mladenovicz earned 60 total points
ID: 11920049
Maybe this will be hepfull
http://support.microsoft.com/?kbid=841291
0
 
LVL 2

Author Comment

by:azoapes
ID: 11920428
That was not helpful, since It's about .NET development. I'm not into that. Yet. But yes, thankyou for helping, both of you guys!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question