Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
How to display Windows On-Screen Keyboard
How to print a bitmap file
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
Winsock: sending email messages (SMTP, port 25)
System Image List Viewer
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Custom HttpRequest class (WinHTTP)
Creating the Save dialog box to specify the drive, directory, and name of a file to save
Printing Image File, programmatically set print page orientation to landscape
How to convert a bitmap file to monochrome format (1 bpp)
The window and its ancestors
Mapping and disconnecting network drives
Using EnumPrinters function to enumerate locally installed printers
How to download a file from the FTP server using FtpGetFile
Custom FTP Class for Visual FoxPro application
Displaying the associated icons and descriptions for files and folders
Displaying icons in the system tray (VFP9)
How to activate Windows Calculator
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
Drawing Windows predefined bitmaps using the LoadBitmap functions
Sending email messages with Simple MAPI
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: 36  
    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 (184.73.7.143)
    26.65 min.Function: 'SetClipboardViewer'
    Function group: 'Clipboard'
    2.46 hrs.Example: 'GDI+: Creating thumbnails to preview images in a directory'
     Function: 'GdipRotateMatrix'
    3.02 hrs.
     Example: 'Creating an Open dialog box to specify the drive, directory, and name of a file to open (Shell32 version)'
    4.26 hrs.Function: 'GetLongPathName'
    Function group: 'File Management'
     Gallery
    Page 17
    4.81 hrs.Example: 'How to find when the application started'
     Function: 'ExtractAssociatedIcon'
    4.82 hrs.Example: 'How to print a bitmap file'
    Google
    Advertise here!