Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Converting Unicode data from the Clipboard to a character string using a given code page
Winsock: sending email messages (SMTP, port 25)
Enumerating data formats currently available on the clipboard
Custom FTP Class for Visual FoxPro application
Splash Screen for the VFP application
Detecting changes in connections to removable drives (VFP9)
How to download a file from the FTP server using FtpGetFile
How to activate Windows Calculator
Custom HttpRequest class (WinHTTP)
How to put a vertical text scrolling on the form (a movie cast)
Displaying bitmap using the AlphaBlend function
Establishing connection using the SQLDriverConnect
How to convert a bitmap file to monochrome format (1 bpp)
Using Font and Text functions
Mapping and disconnecting network drives
Using WM_COPYDATA for interprocess communication (VFP9)
GDI+: copying to the Clipboard (a) image of active FoxPro window/form, (b) image file
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
Displaying animated images on FoxPro form with BitBlt and StretchBlt functions
How to play AVI file on the _screen
Starting an external application in VFP using WinExec

User rating: 8.33/10 (3 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:
This code displays an ASCII file in maximized Notepad window. The file C:\newfile.txt is created if it does not exist.

Other code samples you might be interested in:
  • 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
  • How to Start a Process as Another User (NT/XP/2K)
  • Running MSDOS Shell as a child process with redirected input and output

  •  
    #DEFINE SW_HIDE 0
    #DEFINE SW_SHOWNORMAL 1
    #DEFINE SW_SHOWMINIMIZED 2
    #DEFINE SW_SHOWMAXIMIZED 3
    #DEFINE SW_SHOWNOACTIVATE 4
    #DEFINE SW_SHOW 5
    #DEFINE SW_MINIMIZE 6
    #DEFINE SW_SHOWMINNOACTIVE 7
    #DEFINE SW_SHOWNA 8
    #DEFINE SW_RESTORE 9
    #DEFINE SW_SHOWDEFAULT 10
     
    DECLARE INTEGER WinExec IN kernel32;
        STRING lpCmdLine, INTEGER nCmdShow
     
    LOCAL cCmdLine, nResult
     
    cCmdLine = ["notepad" "c:\newfile.txt"]
    *!*    cCmdLine = "C:\Program Files\Microsoft Office\Office10\WINWORD.EXE"
     
    nResult = WinExec(cCmdLine, SW_SHOWDEFAULT)
     
    IF nResult <= 31
        = MESSAGEBOX("WinExec failed with an error: " +;
            LTRIM(STR(nResult)) + "     ", 48)
    ENDIF
     

    User rating: 8.33/10 (3 votes)
    Rate this code sample:
    • ~
    652 bytes  
    Created: 2001-07-12 12:00:00  
    Modified: 2011-01-09 10:34:57  
    Visits in 7 days: 127  
    Listed functions:
    WinExec
    Printer friendly API declarations
    My comment:
    Running external applications through the WinExec call you bypass FOXRUN.PIF which makes the whole thing more efficient. According to the Microsoft: all WinExec calls are translated directly into corresponding CreateProcess calls.
    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.22.156.205)
    28.67 min.Function: 'NetUserGetLocalGroups'
    Function group: 'Network Management'
    28.7 min.Function: 'GdipDeleteFontFamily'
    3.39 hrs.Example: 'Displaying the main Dial-Up Networking dialog box'
    10.65 hrs.Function: 'GetIconInfo'
     Function: 'SHFormatDrive'
    12.58 hrs.Function: 'GetComputerName'
    Function group: 'System Information'
     Example: 'Vertical Label control'
    14.79 hrs.Example: 'Creating the Save dialog box to specify the drive, directory, and name of a file to save'
    15.27 hrs.Function: 'FreeLibrary'
     Function: 'GdipCreateSolidFill'
    Google
    Advertise here!