Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Retrieveing information about the active window (even if it is not owned by the calling process)
Shortcut Menu Class
Storing registration key in the resources of an executable file
The DetectAutoProxyUrl function identifies the auto-config script location
Dial the Net Automatically
Drawing a rectangle using Windows regular edges and borders
Finding the path to the VFP executable running
How to build UDP responder
Printing text with the Escape function
Reading and setting system access privileges for the current process
Retrieving list of all active RAS connections
Testing MS Internet Explorer version installed
Converting an HTTP time/date string to a SYSTEMTIME structure
Moving shortcut to a specified position on the Windows Desktop
Printing text on the main VFP window
Retrieving file information for the VFP executable running
Using GetFileSize
A client for testing non-blocking Winsock server
Creating a clipping region from the path selected into the device context of a form
Enumerating Volumes and Volume Mounting Points (NTFS)
Obtaining provider name for a specific type of network
Using mailslots to send messages on the network
Winsock: creating a socket that is bound to a specific service provider
Winsock: resolving an address to a host name
Using GetNearestColor

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
 
DO decl
 
    * defining a device context for the VFP Main window
    hWnd = GetActiveWindow () 
    hDc = GetDC (hWnd)
 
    crColor = RGB (16, 108, 231)
    matchColor = GetNearestColor (hDc, crColor)
    ? LTRIM(STR(crColor)) + " transformed to " + LTRIM(STR(matchColor))
 
    = ReleaseDC (hwnd, hdc)
 
PROCEDURE  decl
    DECLARE INTEGER GetDC IN user32 INTEGER hwnd 
    DECLARE INTEGER GetActiveWindow IN user32 
 
    DECLARE INTEGER ReleaseDC IN user32;
        INTEGER hwnd, INTEGER hdc 
 
    DECLARE INTEGER GetNearestColor IN gdi32;
        INTEGER hdc,;
        INTEGER crColor
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
569 bytes  
Created: 2001-07-15 12:00:00  
Modified: 2001-09-28 16:45:16  
Visits in 7 days: 77  
Listed functions:
GetActiveWindow
GetDC
GetNearestColor
ReleaseDC
Printer friendly API declarations
My comment:
I ran this code with two color resolutions.

With 32-bit True Color the result was:
15166480 to 15166480

With 256 colors it was:
15166480 to 8421376
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-2013 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.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (107.22.156.205)
1.74 hrs.Function: 'CeDeleteFile'
3.13 hrs.Example: 'Loading a string resource from an executable file'
 Example: 'Class library providing access to the System Registry'
4.04 hrs.Function: 'ShowHTMLDialog'
 Function: 'CountClipboardFormats'
Function group: 'Clipboard'
6.93 hrs.Function: 'NetMessageBufferSend'
 Example: 'Changing pitch and speed of a wave file'
8.56 hrs.Function: 'GetProfileString'
 Example: 'How to view icons stored in executable files (Icon Viewer)'
15.38 hrs.Example: 'Copying picture of the active form to the Clipboard using Enhanced Metafile API functions'
Google
Advertise here!