Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using IsChild() for testing ThisForm.ShowWindow property
Winsock: retrieving the host information corresponding to a network address
Winsock: retrieving Web pages using sockets (HTTP, port 80)
Yet another modal dialog: now HTML-based
Accessing examples contained in this reference from a VFP application
Enumerating ports that are available for printing on a specified server
How to delete all print jobs for a printer
How to delete file on FTP server
How to display advanced Task Dialog (Vista)
How to enumerate, add and delete shares on the local computer (WinNT/XP)
How to obtain Content-Type value for a file type from the System Registry
HOWTO: Use the Win32 API to Access File Dates and Times
Retrieving System Error message strings
Storing the environment strings in cursor
Using GetSysColor
Using the heap of the calling process to allocate memory blocks
Connecting a local device to a network resource
Extended OS Version info
Extracting the name and extension parts of a path string
How to browse and connect to printers on a network (WinNT)
How to test file attributes (key method for FileExists and DirectoryExists routines)
Obtaining MAC address through Address Resolution Protocol (ARP) request
Placing a button on the VFP form as a new child window
Retrieving long values associated with the class of the VFP window
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: 53  
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-2015 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.5.43), 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.Example: 'How to change display settings: screen resolution, screen refresh rate'
Language: 'C++'
49 sec.Function: 'DeleteDC'
14.23 hrs.Example: 'Winsock: connecting to a news server (NNTP, port 119)'
14.24 hrs.Example: 'How to print FoxPro form'
14.25 hrs.Function: 'inet_ntoa'
Function group: 'Windows Sockets 2 (Winsock)'
14.28 hrs.Function: 'RasPhonebookDlg'
Advertise here!