Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Obtaining I/O counts for the current process
Retrieving the IP-to-physical address mapping table
Retrieving the rectangle area where the mouse cursor is confined
Simulating DOEVENTS
Winsock: creating a socket that is bound to a specific service provider
Winsock: how to retrieve the protocol information corresponding to a protocol number
Current System information
Enhanced GetFont dialog
StrDup returns a pointer to the duplicate of a source VFP string
Creating a unique filename based on existing filename
DiskFreeSpace class
Enumerating connections made to a shared resource for the local computer (WinNT only)
GDI+: enumerating fonts installed on the system
GetFileOwner - Get the owner of an NTFS file
Obtaining physical parameters for a drive: sectors, clusters, cylinders...
Using ActiveX control for adding a menu directly to a FoxPro MDI form
Accessing the list of Windows Recent Documents
Creating hash values for the list of names
Creating two-byte hashes for a list of URLs
How to make the caption of a VFP application flashing in the Windows task bar
Retrieving statistics for the TCP protocol running on the local computer
Using IsChild() for testing ThisForm.ShowWindow property
Displaying all TCP connections for the local system
Enumerating Processes -- Win9*
Closing Windows

User rating: 10/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
Before you begin:
Similar examples:
  • How to initiate System shutdown (WinNT only)
  • Restarting Windows
  • Enabling the SE_SHUTDOWN_NAME privilege for the application
  •  
    #DEFINE EWX_LOGOFF 0
    #DEFINE EWX_SHUTDOWN 1
    #DEFINE EWX_REBOOT 2
    #DEFINE EWX_FORCE 4
    #DEFINE EWX_POWEROFF 8
    #DEFINE EWX_FORCEIFHUNG 16
     
    DECLARE INTEGER GetLastError IN kernel32
     
    DECLARE INTEGER ExitWindows IN user32;
        INTEGER dwReserved, INTEGER uReturnCode
     
    DECLARE INTEGER ExitWindowsEx IN user32;
        INTEGER uFlags, INTEGER dwReserved
     
    * logoff -- change user
    * = ExitWindowsEx(EWX_LOGOFF, 0)
     
    * reboot
    nResult = ExitWindowsEx(EWX_REBOOT, 0)
     
    IF nResult=0
    * 1314=ERROR_PRIVILEGE_NOT_HELD
        ? "ExitWindowsEx call failed:", GetLastError()
    ENDIF
     

    User rating: 10/10 (1 votes)
    Rate this code sample:
    • ~
    566 bytes  
    Created: 2001-07-12 12:00:00  
    Modified: 2010-07-30 16:20:36  
    Visits in 7 days: 74  
    Listed functions:
    ExitWindows
    ExitWindowsEx
    GetLastError
    Printer friendly API declarations
    My comment:
    To shut down the local computer, the calling thread must have the SE_SHUTDOWN_NAME privilege.
    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 (54.242.188.217)
    7 sec.Example: 'Enumerating connections made to a shared resource for the local computer (WinNT only)'
    41.77 min.Function: 'SQLRowCount'
    Function group: 'ODBC API'
    41.88 min.Function: 'GetShellWindow'
    Function group: 'Window'
    Google
    Advertise here!