Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to Start a Process as Another User (NT/XP/2K)
Locking and unlocking file of a VFP table
Enumerating data formats currently available on the clipboard
Enumerating network resources
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
A class that encrypts and decrypts files using Cryptography API Functions
How to block the ALT+TAB shortcut (WinXP)
Retrieving IP statistics for the computer
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
How to obtain Content-Type value for a file type from the System Registry
How to retrieve adapter information for the local computer (including MAC address)
How to retrieve version information for the specified file
How to view icons stored in executable files (Icon Viewer) - II
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 play a waveform sound (a WAV file in particular)
Starting a dialog box for connecting to network resources (mapping network drive)

User rating: 6/10 (1 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Versions:
click to open
Before you begin:


See also:
  • Starting a dialog box for connecting to network resources and passing input parameters
  • Connecting a local device to a network resource
  • Mapping and disconnecting network drives in FoxPro application
  •  
    #DEFINE RESOURCETYPE_DISK   1
    DO declare
     
    LOCAL hWindow
    hWindow = GetActiveWindow()
     
    * Map Network Drive dialog box
    = WNetConnectionDialog(hWindow, RESOURCETYPE_DISK)
     
    * Disconnect Network Drives dialog box
    * only RESOURCETYPE_DISK flag is allowed
    = WNetDisconnectDialog(hWindow, RESOURCETYPE_DISK)
     
    PROCEDURE declare
        DECLARE INTEGER GetActiveWindow IN user32
     
        DECLARE INTEGER WNetConnectionDialog IN mpr;
            INTEGER hwnd, INTEGER dwType
     
        DECLARE INTEGER WNetDisconnectDialog IN mpr;
            INTEGER hwnd, INTEGER dwType
     
     
     

    User rating: 6/10 (1 votes)
    Rate this code sample:
    • ~
    540 bytes  
    Created: 2002-06-06 08:01:07  
    Modified: 2012-09-26 09:57:12  
    Visits in 7 days: 113  
    Listed functions:
    GetActiveWindow
    WNetConnectionDialog
    WNetDisconnectDialog
    Printer friendly API declarations
    My comment:
    Not much of options exists for this function: one can not specify a disk letter and network path through the input parameters.

    The NET USE command connects a computer to, or disconnects a computer from a shared resource; or displays information about computer connections. The command also controls persistent net connections.

    Syntax:

    net use [devicename | *] [\\computername\sharename[\volume]] [password | *]
    [/user:[domainname\]username] [[/delete] | [/persistent:{yes | no}]]

    net use devicename [/home [password | *]] [/delete: {yes | no}]

    net use [/persistent: {yes | no}]

    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 (50.16.166.175)
    4 sec.Example: 'How to suspend or hibernate your system'
    7 sec.Function: 'CeCreateDatabase'
    Function group: 'Remote Application Programming (RAPI)'
    1.65 hrs.Example: 'Enumerating ODBC drivers available on the local computer'
     Function: 'WSAStartup'
    2.6 hrs.Function: 'SetWindowLong'
    3.26 hrs.Function: 'CopyFile'
    Function group: 'File Management'
     Example: 'Obtaining names and positions for shortcuts located on the Windows Desktop'
     Function: 'GetWindowRect'
    Function group: 'Window'
    Google
    Advertise here!