Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Paint/Redraw window while dragging 16 86
Access Object Property from VBA Module in Excel 2010 2 40
vbModal 12 66
how to Classify of email (pdf attachments) 7 50
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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

749 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