Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Displaying all TCP connections for the local system
How to hot-track menu item selection in top-level form (requires VFP9)
Using FrameRgn for displaying system colors
Winsock: resolving an address to a host name
Enumerating data formats currently available on the clipboard
Enumerating network resources
How to Start a Process as Another User (NT/XP/2K)
Simple MAPI: how to pick an email recipient from Outlook Express address book
Winsock: how to retrieve the protocol information corresponding to a protocol name
A class that encrypts and decrypts files using Cryptography API Functions
How to block the ALT+TAB shortcut (WinXP)
Programmatically removing submenus from VFP main menu
Retrieving the name of the default printer for the current user on the local computer (Win NT/XP)
Shortcut Menu Class
Using NetWkstaTransportEnum to obtain MAC Address of remote server
Using Path functions from Shell Lightweight Utility APIs (shlapi.dll)
Winsock: initializing the service in the VFP application
Browsing Windows Known Folders (Special Folders)
How to obtain Content-Type value for a file type from the System Registry
How to play a waveform sound (a WAV file in particular)
How to retrieve version information for the specified file
Retrieving IP statistics for the computer
Switching between keyboard layouts
Validating URLs using moniker functions
How to Start a Process as Another User (NT/XP/2K)

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Before you begin:
The following code offers solution, which is similar to Microsoft Knowledge Base Article - 285879: HOWTO: Start a Process as Another User from Visual Basic.

Other code samples you might be interested in:
  • Running external applications from VFP using WinExec
  • Using ShellExecute for performing operations on files
  • Running external applications from VFP using CreateProcess
  • Running an external program from FoxPro and waiting for its termination
  • Running MSDOS Shell as a child process with redirected input and output

  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    5486 bytes  
    Created: 2003-10-30 14:35:25  
    Modified: 2011-12-10 09:20:22  
    Visits in 7 days: 96  
    Listed functions:
    CloseHandle
    CreateProcessAsUser
    CreateProcessWithLogonW
    GetLastError
    GetVersionEx
    LogonUser
    Printer friendly API declarations
    My comment:
    To start a process as another user, you can use the LogonUser and CreateProcessAsUser Win32 APIs when running Microsoft Windows NT 4.0, or you can use the CreateProcessWithLogonW Win32 API when running Microsoft Windows 2000/XP or later.
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian  
    FreeTranslation.com offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.


    Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

    Privacy policy
    Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (107.20.7.65)
    40.3 min.Example: 'Displaying the associated icons and descriptions for files and folders'
    40.38 min.Example: 'Enumerating Performance Counters'
    40.45 min.Example: 'Listing INF files in a specified directory'
    1.1 hrs.Function: 'RegCloseKey'
     Example: 'Wininet last error description'
     Example: 'Using the CreateFile'
    Google
    Advertise here!