Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Start an executable from VFP application by using the CreateProcess
Storing the environment strings in cursor
Testing Clipboard functions: emptying the clipboard
Using the Semaphore object to allow only one instance of VFP application running
Connecting a local device to a network resource
Disabling mouse and keyboard input for the main VFP window (with the app still running)
How to adjust monitor brightness (Vista, monitor with DDC support)
How to delete all print jobs for a printer
How to disable the Windows Clipboard (VFP9)
How to display a Task Dialog (Vista)
How to obtain the number of rows affected by remote UPDATE, INSERT or DELETE statement
How to Start a Process as Another User (NT/XP/2K)
How to write and read Window Properties for the specified window
Number of clipboard formats available
Quering waveform-audio output devices
Reading parameters of streams in AVI file
Retrieving the interface–to–IP address mapping table
Setting the volume label
Terminating all running applications from a VFP program
Testing serial ports
Tracking mouse movement to detect when to start dragging
Converting command-line string to a set of Unicode argument strings
Enumerating global and local group accounts on a server (WinNT/XP/2K)
Pocket PC: enumerating mounted database volumes and databases in the Object Store
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: 55  
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.34), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.205.43.70)
4 sec.Function: 'RegCreateKeyEx'
11 sec.Function: 'PageSetupDlg'
14 sec.Function: 'CryptHashData'
Function group: 'Cryptography Reference'
17 sec.Function: 'InternetGoOnline'
Function group: 'Internet Functions (WinInet)'
21 sec.Solution: 'Extended MessageBox Library (assembly) for .NET'
24 sec.Function: 'midiOutGetDevCaps'
Function group: 'Windows Multimedia'
31 sec.Function: 'HeapFree'
34 sec.Function: 'send'
Function group: 'Windows Sockets 2 (Winsock)'
37 sec.Function: 'CopyIcon'
41 sec.Example: 'How to change display settings: screen resolution, screen refresh rate'
Google
Advertise here!