Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to make a VFP form fading out when released (GDI+ version)
How to obtain Content-Type value for a file type from the System Registry
How to obtain the number of rows affected by remote UPDATE, INSERT or DELETE statement
How to retrieve information about a cache entry (Internet Explorer)
Peer-to-peer LAN messenger built with Mailslot API functions
Scanning a hierarchy of child windows down from the Windows Desktop
Setting properties of the window: caption and user-defined value
Testing Transparent Menu Class with top-level form (requires VFP9)
Extracting the name and extension parts of a path string
How to make a VFP form fading out when released (GDI version)
Using FrameRgn for displaying system colors
Drawing standard Windows icons
Loading a string resource from an executable file
Memory usage info for current VFP session (WinNT only)
Retrieving the state of your Internet connection
Scanning the hierarchy of child windows down from the main VFP window
Using an Event Object. Part B: running an application responding to events
Using vendor-neutral SQL constructs
GDI+: Creating thumbnails to preview images in a directory
Using InternetGoOnline function
Winsock: resolving an address to a host name
Winsock: retrieving information about available transport protocols
Comparing file times
Opening the Page Setup dialog box to specify the attributes of a printed page
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: 90  
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 (23.22.212.158)
34.93 min.Example: 'Building a tree of subdirectories for a given path using FindFile functions'
Language: 'C#'
2.54 hrs.Function: 'EnumPorts'
3.35 hrs.Function: 'GdipGetImageWidth'
5.61 hrs.Function: 'SQLTables'
Function group: 'ODBC API'
10.24 hrs.Example: 'Extended MessageBox Class'
 Function: 'BeginUpdateResource'
 Example: 'Using FrameRgn for displaying system colors'
16.61 hrs.Example: 'How to write and read Window Properties for the specified window'
 Example: 'Retrieving a universal form for the drive-based path for a network resource'
18.26 hrs.Function: 'NetFileGetInfo'
Google
Advertise here!