Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Accessing Adobe Reader 7.0 main menu from VFP application
Creating an Open dialog box to specify the drive, directory, and name of a file to open (Shell32 version)
Displaying Windows shell folders in TreeView control with Visual FoxPro FLL
Enumerating Processes -- Win9*
Simple MAPI: how to pick an email recipient from Outlook Express address book
Enumerating the subkeys of a user-specific key
Quering a waveform-audio input device
Simple printer queue monitor: deletes, pauses, resumes print jobs for local printer
Browsing Windows Known Folders (Special Folders)
Converting an HTTP time/date string to a SYSTEMTIME structure
Encapsulating access to the Windows Services in a class
Reading keys in the specified section of the Win.ini file
Time in milliseconds represented as string (e.g. 1 hour 24 min 36 sec)
Creating a console window for Visual FoxPro application
How to enumerate, add and delete shares on the local computer (WinNT/XP)
How to prevent users from accessing the Windows Desktop and from switching to other applications
Retrieving list of files on the FTP directory
Class library providing access to the System Registry
How to delete IE cookies, clear IE history and delete files in Temporary Internet Files directory
How to display the Properties dialog box for a file (ShellExecuteEx)
Displaying dimmed window behind VFP top-level form
How to release and renew a lease on an IP address previously obtained through Dynamic Host Configuration Protocol (DHCP)
Listing INF files in a specified directory
Number of clipboard formats available
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.
DECLARE INTEGER GetObjectType IN gdi32 INTEGER h
#DEFINE OBJ_BITMAP    7
#DEFINE OBJ_METAFILE  9

LOCAL obj

* 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)
    ENDIF

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


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: 265  
Listed functions:
GetObjectType
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  
FreeTranslation.com 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.1.68), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.83.167.135)
19 sec.Function: 'ReadProcessMemory'
44 sec.Function: 'NetScheduleJobEnum'
Function group: 'Network Management'
3.13 min.Function: 'getnameinfo'
Function group: 'Windows Sockets 2 (Winsock)'
12.02 hrs.Example: 'How to create MD-5 and SHA-1 hash values from a string'
 Example: 'Using Shell for performing operations on files'
 Function: 'CryptDeriveKey'
12.03 hrs.Function: 'mixerGetDevCaps'
Function group: 'Windows Multimedia'
Google
Advertise here!