Using Win32 functions in Visual FoxPro Image Gallery
Icon
..msdn
CopyIcon
DestroyIcon
DrawIcon
ExtractAssociatedIcon
ExtractIcon
GetIconInfo
LoadIcon
Code examples:
Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.
Drawing icons associated with the VFP main window
Drawing standard Windows icons
How to view icons stored in executable files (Icon Viewer)
Storing screen shot of a form to bitmap file
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: 128  
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 (54.224.75.101)
4 sec.Function: 'SCardEstablishContext'
2.77 hrs.Function: 'GetEnvironmentVariable'
Function group: 'Process and Thread'
 Function: 'FindFirstPrinterChangeNotification'
7.26 hrs.Example: 'How to play AVI file on the _screen'
Language: 'Visual FoxPro'
 Function: 'FindFirstFile'
Google
Advertise here!