Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Extensible Storage Engine class library
GDI+: custom Clock Control
Writing entries to custom Event Log
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
GDI+ fun: roach-infested desktop
Adding a background image to VFP report (VFP9, ReportListener)
GDI+: creating a gradient
Winsock: sending email messages (SMTP, port 25)
Capturing keyboard activity of another application with the Raw Input API (VFP9)
How to load a user profile
Storing content of the Clipboard to a bitmap file
Controlling master audio volume by sending WM_APPCOMMAND messages
GDI+: Creating thumbnails to preview images in a directory
How to put a horizontal text scrolling on the form (a news line, marquee)
How to put a vertical text scrolling on the form (a movie cast)
Generating random cryptographic keys
Using Month Calendar Control (VFP9, Comctl32.dll)
Displaying animated images on FoxPro form with BitBlt and StretchBlt functions
GDI+: Scrolling through large image using the mouse
Starting a dialog box for connecting to network resources and passing input parameters
Creating irregularly shaped FoxPro form using transparency color key
How to enumerate logon sessions on local computer
How to enumerate, add and delete shares on the local computer (WinNT/XP)
How to find which fonts Windows uses for drawing captions, menus and message boxes
Exporting DLL icon resources as .ICO files

User rating: 0/10 (0 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:
This code includes definitions for three classes: IconGroups, IconGroupResource and IconResource.

The IconGroups is a collection of the IconGroupResource objects. The icons property of the IconGroupResource class is a collection of the IconResource objects.

The following code employs classes from this code sample to store VFP Icon resources to ICO files.
oIconGroups = CREATEOBJECT("IconGroups",;
        _vfp.ServerName)

oIconGroups.EnumIconGroupResources
? "Icon groups:", oIconGroups.Count

LOCAL cTargetPath, nGroupIndex, nIconIndex
cTargetPath = GETDIR("", "Select ICO files destination folder.")

IF NOT EMPTY(m.cTargetPath)
        SET SAFETY OFF
        nGroupIndex = 0

        FOR EACH oIconGroup IN oIconGroups
                oIconGroup.SaveToFile(cTargetPath +;
                        "groupicon_" + TRANSFORM(nGroupIndex) + ".ico")

                nIconIndex = 0
                FOR EACH oIcon IN oIconGroup.icons
                        oIcon.SaveToFile(cTargetPath +;
                                "icon_" +;
                                TRANSFORM(nGroupIndex) + "_" +;
                                TRANSFORM(nIconIndex) + "_" +;
                                TRANSFORM(oIcon.resid) + ".ico")

                        nIconIndex = nIconIndex + 1
                NEXT
                nGroupIndex = nGroupIndex + 1
        NEXT
        SET SAFETY ON
ENDIF

Selected Windows iconsDownload a small selection of Windows icons from System32\Imageres.dll library.


See also:
  • Storing DLL icon resources in image files
  • View icons stored in executable files (Icon Viewer)
  • View icons stored in executable files (Icon Viewer II)
  • Displaying Windows Shell Icons
  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    6306 bytes  
    Created: 2005-12-08 16:01:04  
    Modified: 2011-02-21 19:45:27  
    Visits in 7 days: 44  
    Listed functions:
    FindResource
    FreeLibrary
    LoadLibraryEx
    LoadResource
    LockResource
    SizeofResource
    Printer friendly API declarations
    My comment:
    To see a variety of system icons, test this code with Shell32.dll and Imageres.dll files located in System32 folder.

    Storing DLL icon resources in .ICO files

    * * *
    VFP versions 3..9 do not support callback functions. This prevents using the EnumResourceNames function to enumerate available resources in executable or dynamic library files. For that reason, the IconGroups class enumerates IconGroup resources with only integer identifiers in 1..0xffff range.

    Read on MSDN:
  • Icons in Win32
  • Using Icons
  • 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-2017 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.34), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (54.147.244.157)
    1 sec.Function: 'getsockopt'
    2 sec.Example: 'How to create non-blocking Winsock server'
    Language: 'C++'
    4 sec.Example: 'HOWTO: Use the Win32 API to Access File Dates and Times'
    6 sec.Example: 'Opening access to the Microsoft Internet functions for the application'
    9 sec.Example: 'How to obtain Content-Type value for a file type from the System Registry'
    10 sec.Example: 'How to change display settings: screen resolution, screen refresh rate'
    12 sec.Function: 'waveInGetErrorText'
    Function group: 'Windows Multimedia'
    13 sec.Function: 'LsaClose'
    14 sec.
    Function group: 'Process and Thread'
    16 sec.Example: 'PocketPC: custom RAPI class for executing routines on remote Windows CE device'
    Google
    Advertise here!