Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to drag a Form not using its Titlebar or Caption
How to position the GETPRINTER() dialog
Listing INF files in a specified directory
Loading a string resource from an executable file
Number of clipboard formats available
Obtaining heap handles and enumerating memory blocks for the current VFP session (WinNT only)
Reading and setting Environment variables
Retrieving IP statistics for the computer
Retrieving top-child window for the VFP form
Using Change Notification Objects to monitor changes to the printer or print server
Using shared memory to exchange data between applications (processes)
Using Shell for performing operations on files
Winsock: how to retrieve the protocol information corresponding to a protocol number
A procedure for setting file times
Accessing Windows Control Panel from VFP Application
Copying strings through the global memory block
Creating the Save dialog box to specify the drive, directory, and name of a file to save
Displaying all TCP connections for the local system
Enumerating Processes -- Win9*
Enumerating the subkeys for a given registry key
Extended OS Version info
GetProcessVersion points at target OS
How to download this reference`s archive through WinInet functions using InternetOpenUrl
How to enumerate, add and delete shares on the local computer (WinNT/XP)
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: 41  
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-2016 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.30), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.159.121.201)
19 sec.Example: 'How to control Adobe Reader 9.0 (SDI mode) from VFP application'
48 sec.Function: 'mmioDescend'
Function group: 'Windows Multimedia'
3.25 min.Example: 'Placing an arbitrary rectangular area of main VFP window on the Clipboard'
3 day(s)Example: 'Basic Volume information'
 
Function group: 'Windows Sockets 2 (Winsock)'
 Example: 'Displaying printer-properties Property Sheet for the specified printer'
 Example: 'Creating a file, then moving it to another destination'
Google
Advertise here!