Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-08-27
4
Medium Priority
?
616 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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

597 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