Solved

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

Posted on 2004-08-27
4
591 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
4 Comments
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 105 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 20 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now