Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
PocketPC: custom RAPI class for executing routines on remote Windows CE device
Converting long file names to the short format and vice versa
Drawing Windows frame controls using the DrawFrameControl function
Enumerating forms supported by a specified printer
How to make application automatically close all documents it opened
How to release and renew a lease on an IP address previously obtained through Dynamic Host Configuration Protocol (DHCP)
How to retrieve the number of print jobs queued for the printer
Retrieving the rectangle area where the mouse cursor is confined
Writing to INI file
Obtaining physical parameters for a drive: sectors, clusters, cylinders...
Winsock: retrieving the standard host name and IP address for the local machine
Adding supplementary data to AVI files
Enumerating network sessions established on a server
How to save registry key including its subkeys and values to a file
Using an Event Object. Part A: running an application that creates an Event object
Connecting a local device to a network resource
Dragging files from Explorer window and dropping them on FoxPro control (requires VFP9)
Form Magnifier
GDI+: custom Slider control
GDI+: Storing content of the Clipboard to a bitmap file
Pocket PC: custom RAPI class for operating with the System Registry
Retrieving Window Class information for the VFP window
Setting properties of the window: caption and user-defined value
Adding user-defined items to the Control Menu of VFP form (requires VFP9)
The original LoadPicture() function in VFP returns valid handles to bitmaps, icons, cursors, and metafiles

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:
Provide valid file names when calling this function.


* provide valid file names

= LoadObject("badge.bmp")
= LoadObject("BACKGRND.GIF")
= LoadObject("BD04956_.WMF")
= LoadObject("FILES10.ICO")
= LoadObject("H_POINT.CUR")

PROCEDURE LoadObject (lcFilename)
    LOCAL obj
    ? "Filename:", FULLPATH(lcFilename)

    IF FILE(lcFilename)
        obj = LoadPicture (lcFilename)

    IF TYPE("obj") = "O"
        ? "Handle:", obj.handle
        ? "Handle type:", GetObjectType(obj.handle)
        ? "Width:", obj.width
        ? "Height:", obj.height
        ?? " -- not accessible"

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
640 bytes  
Created: 2002-03-31 14:09:12  
Modified: 2003-04-23 22:22:10  
Visits in 7 days: 42  
Listed functions:
Printer friendly API declarations
My comment:
The LoadPicture() function (note this is a VFP function, not Win32 one) loads bitmap files as well as GIF and JPEG files, converting them into memory bitmaps. So after all you get valid bitmap handle -- no need to implement Win32-based algorithms for reading GIFs and JPEGs.
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian 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 (
13 sec.Project
24 sec.Function: 'timeGetDevCaps'
Function group: 'Windows Multimedia'
36 sec.Function: 'SQLManageDataSources'
47 sec.
1.02 min.Function: 'GdipGetFontCollectionFamilyList'
Function group: 'GDI+ Font'
1.18 min.Example: 'Peer-to-peer LAN messenger built with Mailslot API functions'
1.45 min.Function: 'GdipRotateMatrix'
Function group: 'GDI+ Matrix'
1.65 min.Function: 'waveInReset'
Function group: 'Windows Multimedia'
1.85 min.Function: 'FindClose'
Function group: 'File Management'
2.08 min.Function: 'CryptUnprotectData'
Function group: 'Cryptography Reference'
Advertise here!