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 play a waveform sound (a WAV file in particular)
How to play MIDI notes
MapiSendMail class for Visual FoxPro application
Monitoring changes in a directory
Sending a standard message with one or more attached files using default email client
Using the DeleteFile
Winsock: reading and setting socket options
Converting a decimal string to an integer
Creating a directory on the FTP
How to create a desktop shortcut (shell link)
How to find the application associated with a file name
How to retrieve version information for the specified file
Reading VFP settings from the Windows Registry
Retrieving information about all users currently logged on to the workstation (WinNT only)
Retrieving IP statistics for the computer
URL: splitting into its component parts
Using an Event Object. Part A: running an application that creates an Event object
Converting an HTTP time/date string to a SYSTEMTIME structure
Converting twips to pixels and vice versa
Drawing a window caption using the DrawCaption routine
Enumerating servers of the specified type (e.g. SQL Server) in the primary domain
Obtaining information about all user accounts on a server (WinNT only)
Retrieving information specific to the current Time Zone
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: 56  
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-2018 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.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.227.17.101)
25 sec.Example: 'Using NetWkstaTransportEnum to obtain MAC Address of remote server'
46 sec.Gallery
1.1 min.Function: 'FreeEnvironmentStrings'
Function group: 'Process and Thread'
1.42 min.
Function group: 'Event Logging'
1.75 min.Function: 'CeRegCreateKeyEx'
Function group: 'Remote Application Programming (RAPI)'
2.07 min.Function: 'SHFileOperation'
Function group: 'Shell Functions'
2.42 min.Function: 'CeCreateFile'
Function group: 'Remote Application Programming (RAPI)'
2.77 min.
Function group: 'DNS Functions'
3.08 min.Function: 'PathYetAnotherMakeUniqueName'
Function group: 'Shell Functions'
3.38 min.
Google
Advertise here!