Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Confining Windows calculator inside the VFP main window
How to make a VFP form fading out when released (GDI+ version)
Minimizing all running applications
Extended MessageBox Class
Semi-transparent Form
Bitmap Class for Visual FoxPro application
How to remove a directory that is not empty
Placing On-screen Alert on top of all windows
How to change the name and the size of the font in the MessageBox dialog
How to print FoxPro form
Building a tree of subdirectories for a given path using FindFile functions
Creating a mailslot
Reading list of folders and files on FTP server
Using the ChooseColor function
Attaching menu to a top-level form
Compressing and decompressing files with Windows API Runtime Library routines
Retrieving the interface–to–IP address mapping table
Round FoxPro form
Using WM_COPYDATA for interprocess communication (VFP9)
Converting image file to .ICO file
Windows Shell Icons displayed and exported to ICO files (Vista)
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
How to print picture stored in enhanced-format metafile (*.emf)
Using the NetMessageBufferSend to send messages on the network
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: 100  
    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-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 (50.16.36.153)
    4 sec.Function: 'GdipCreateFromHDC'
    Function group: 'GDI+ Graphics'
    19.13 min.Example: 'Accessing Windows Control Panel from VFP Application'
    19.2 min.Function: 'GdipSaveImageToFile'
    19.25 min.Example: 'How to fill a buffer with random bytes using Cryptography API Functions'
    32.43 min.Example: 'Simple MAPI: how to pick an email recipient from Outlook Express address book'
    32.53 min.Function: 'InternetOpenUrl'
    1.57 hrs.Example: 'Round FoxPro form'
     Example: 'Using the IsWindowEnabled function'
    2.56 hrs.Example: 'Displaying system dialog that selects a folder'
     Example: 'How to display Windows On-Screen Keyboard'
    Language: 'C#'
    Google
    Advertise here!