Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.
How to empty the Recycle Bin
Reading and setting the priority class values for the current process and thread
Using FillMemory
Creating a mailslot
Displaying standard progress dialog box when copying files
GDI+: printing image file
OS version and revision
Retrieving list of Global Atom names
Using InternetGoOnline function
Winsock: resolving an address to a host name
GetFocus returns a HWND value
Listing child windows for the Windows desktop
Enumerating network interfaces on the local computer
GDI+: printing vertical text on VFP reports via generated images (VFP9)
How to retrieve information about a cache entry (Internet Explorer)
Using mailslots to send messages on the network
Using Path functions from Shell Lightweight Utility APIs (shlapi.dll)
Using vendor-neutral SQL constructs
Verifying a file using the Authenticode policy provider
Winsock: retrieving information about available transport protocols
Comparing dimensions of the VFP main window with _SCREEN properties
How to download this reference`s archive through WinInet functions using InternetOpenUrl
How to obtain Content-Type value for a file type from the System Registry
Reading the state of mouse buttons within DO WHILE loop

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:
See also:
  • Capturing keyboard activity of another application using the Raw Input API
  •  
    DECLARE INTEGER GetAsyncKeyState IN user32 INTEGER vKey
    DECLARE INTEGER GetKeyState IN user32 INTEGER vKey
    DECLARE INTEGER SetKeyboardState IN user32 STRING @lpKeyState
     
    #DEFINE VK_LBUTTON  1
    #DEFINE VK_RBUTTON  2
     
    LOCAL cBuffer, nIndex, lStop
    lStop=.F.
     
    * clearing input-state table
    cBuffer = REPLICATE(CHR(0), 256)
    = SetKeyboardState(@cBuffer)
    DOEVENTS
     
    DO WHILE Not lStop
        * simulating time-consuming activity
        CREATE CURSOR cs (num N(10))
        FOR nIndex=1 TO 1000
            INSERT INTO cs VALUES (nIndex)
        ENDFOR
     
        ?? "."
    *    DOEVENTS
     
        * testing if any mouse key has been pressed
        * since previous call to this function
        IF GetKeyState(VK_LBUTTON) <> 0
            ? "Left button pressed."
            EXIT
        ENDIF
     
        IF GetKeyState(VK_RBUTTON) <> 0
            ? "Right button pressed."
            EXIT
        ENDIF
    ENDDO
     
     
     

    User rating: 10/10 (1 votes)
    Rate this code sample:
    • ~
    807 bytes  
    Created: 2002-02-25 22:37:37  
    Modified: 2011-01-06 16:26:15  
    Visits in 7 days: 147  
    Listed functions:
    GetAsyncKeyState
    GetKeyState
    SetKeyboardState
    Printer friendly API declarations
    My comment:
    Check list of Virtual-Key Codes on the MSDN.
    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 (23.20.196.179)
    2.53 hrs.Example: 'Simple Window Viewer'
     Function: 'GetSystemMetrics'
    3.22 hrs.Function: 'mmioOpen'
     Example: 'Reading metrics for the currently selected font'
    4.5 hrs.Example: 'Adding and deleting Scheduled Tasks using NetScheduleJob API functions'
     Function: 'SendARP'
    5.08 hrs.Solutions
     Example: 'Converting command-line string to a set of Unicode argument strings (WinNT only)'
     Function: 'InternetReadFile'
    18.23 hrs.Example: 'Drawing Windows predefined bitmaps using the LoadBitmap functions'
    Google
    Advertise here!