Solved

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

Posted on 2004-08-27
4
607 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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

696 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