Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.
GetFileOwner - Get the owner of an NTFS file
How to test file attributes (key method for FileExists and DirectoryExists routines)
Reading virtual key status values and key names
Setting and retrieving the double-click time for the mouse
Setting properties of the window: caption and user-defined value
Using an Event Object. Part A: running an application that creates an Event object
Using an Event Object. Part B: running an application responding to events
Using Custom FTP class (DEFINE CLASS ftp As Custom)
Enumerating servers of the specified type (e.g. SQL Server) in the primary domain
Locking and unlocking file of a VFP table
Retrieving geometrical parameters of the system desktop window
Retrieving information about MS-DOS device names using QueryDosDevice (WinNT only)
Using Multimedia Command Strings to play MIDI files
Winsock: initializing the service in the VFP application
Creating hash values for the list of names
Enumerating MIDI output devices
Reading data from INI files
Retrieving the name of the primary domain controller (PDC) and join status information (NT/2000/XP)
Running a regular FoxPro form while main VFP window is minimized
Accessing a CD device (cdaudio) with Multimedia Command Strings
GDI+: converting text strings to images and saving in a graphics file
Pocket PC: creating new database in the Object Store and copying Contacts Database records into it
Retrieving configuration information for the specified server (Win98/Me)
Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.

User rating: 9.5/10 (2 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
 
DO decl
 
= DrawClassCursor ("Button",    100)
= DrawClassCursor ("ComboBox",  140)
= DrawClassCursor ("Edit",      180)
= DrawClassCursor ("ListBox",   220)
= DrawClassCursor ("MDIClient", 260)
= DrawClassCursor ("ScrollBar", 300)
= DrawClassCursor ("Static",    340)
 
PROCEDURE  DrawClassCursor (lcClassName, Y)
    LOCAL hwnd, hdc, lcWndClass, hCursor
    hwnd = GetActiveWindow()
    hdc = GetWindowDC(hwnd)
 
    #DEFINE WNDCLASS_SIZE  40
    lcWndClass = Repli(Chr(0), WNDCLASS_SIZE)
    = GetClassInfo (0, lcClassName, @lcWndClass)
 
    * drawing the cursor on the main VFP window
    hCursor = buf2dword(SUBSTR(lcWndClass, 25,4))
    IF hCursor <> 0
        = DrawIcon (hdc, 40,Y, hCursor)
    ENDIF
 
    ReleaseDC (hwnd, hdc)
RETURN
 
FUNCTION  buf2dword (lcBuffer)
RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ;
    Asc(SUBSTR(lcBuffer, 2,1)) * 256 +;
    Asc(SUBSTR(lcBuffer, 3,1)) * 65536 +;
    Asc(SUBSTR(lcBuffer, 4,1)) * 16777216
 
PROCEDURE  decl
    DECLARE INTEGER GetActiveWindow IN user32
    DECLARE INTEGER GetWindowDC IN user32 INTEGER hwnd
    DECLARE INTEGER ReleaseDC IN user32 INTEGER hwnd, INTEGER hdc
 
    DECLARE INTEGER GetClassInfo IN user32;
        INTEGER hInstance, STRING lpClassName, STRING @lpWndClass
 
    DECLARE SHORT DrawIcon IN user32;
        INTEGER hDC, INTEGER X, INTEGER Y, INTEGER hIcon
 

User rating: 9.5/10 (2 votes)
Rate this code sample:
  • ~
1292 bytes  
Created: 2001-12-02 17:47:44  
Modified: 2001-12-02 17:50:43  
Visits in 7 days: 73  
Listed functions:
DrawIcon
GetActiveWindow
GetClassInfo
GetWindowDC
ReleaseDC
Printer friendly API declarations
My comment:
Some info on System Classes.
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.72.184.104)
26.93 min.Example: 'How to set Creation Date/Time for a folder (WinNT)'
27.02 min.Function: 'SQLGetDiagRec'
Function group: 'ODBC API'
6.03 hrs.Example: 'Converting strings between ANSI and OEM'
 Banners
7.69 hrs.Example: 'Retrieving graphic capabilities of default printer'
 Example: 'Using the CreateFile'
9.59 hrs.Example: 'Bitmap Class for Visual FoxPro application'
 Function: 'JetBeginTransaction'
Function group: 'Extensible Storage Engine (ESE, Jet Blue)'
13.21 hrs.Function: 'CeGetStoreInformation'
Function group: 'Remote Application Programming (RAPI)'
 Example: 'How to make a VFP form fading out when released (GDI+ version)'
Google
Advertise here!