Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
The DetectAutoProxyUrl function identifies the auto-config script location
Adding a background image to VFP report (VFP9, ReportListener)
Adding printer to the list of supported printers for the specified server
Dragging files from Explorer window and dropping them on FoxPro control (requires VFP9)
How to play MIDI notes
How to print FoxPro form -- II
Setting the date and time that a file was created
Deleting files into the Recycle Bin
Quering waveform-audio output devices
Adding and deleting User Accounts
How to display a dialog box with which the user can add a data source (DSN)
How to play AVI file on the _screen
Quering a waveform-audio input device
How to make application automatically close all documents it opened
How to retrieve adapter information for the local computer (including MAC address)
Reading data from INI files
Monitoring changes occurring within a directory
Retrieveing information about the active window (even if it is not owned by the calling process)
Reading metrics for the currently selected font
Retrieving list of available disk drives
Terminating all running applications from a VFP program
How to enumerate logon sessions on local computer
Using File Mapping for enumerating files opened by Visual FoxPro
Disk in drive A:
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: 161  
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-2014 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.204.200.90)
4 sec.Function: 'NetUserGetGroups'
Function group: 'Network Management'
6 sec.Function: 'IpRenewAddress'
Function group: 'IP Helper'
8 sec.Example: 'How to retrieve adapter information for the local computer (including MAC address)'
13 sec.Example: 'Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)'
15 sec.Function: 'SearchPath'
Function group: 'File Management'
17 sec.Function: 'InternetCrackUrl'
Function group: 'Internet Functions (WinInet)'
22 sec.Example: 'A client for testing non-blocking Winsock server'
29 sec.Example: 'Opening access to the Microsoft Internet functions for the application'
11.18 hrs.Example: 'How to display Windows On-Screen Keyboard'
 Example: 'Using the DeleteFile'
Google
Advertise here!