Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Converting characters to upper or lower case
Accessing the list of Windows Recent Documents
Copying files as a transacted operation (Vista)
Dynamic strings implemented through VFP Custom class
Retrieving statistics for the TCP protocol running on the local computer
Retrieving the path of the printer-driver directory and printer-processor directory
Creating a file, then moving it to another destination
Listing device drivers in the system: load addresses, names
Retrieving national language settings
GDI+: loading image file, drawing on it, saving the result to another file
Obtaining window class name for the main VFP window
Searching for the specified file using the SearchPath
Retrieving default spooling directory name
Enumerating Performance Counters
Joining local computer to a domain (XP/2000)
Finding the application, icon and friendly names associated with a file name
How to access a file using not its name but an alias (hard link)
Using ActiveX control for adding a menu directly to a FoxPro MDI form
Obtaining the System and Windows folder names
PocketPC: creating directories and files
Using GetCompressedFileSize (WinNT only)
How to fill a buffer with random bytes using Cryptography API Functions
Setting the last-error code for the FoxPro
Displaying the color palette stored in an image file
Retrieving geometrical parameters of the system desktop window

User rating: 10/10 (1 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
 
DECLARE INTEGER GetDesktopWindow IN user32
DECLARE SHORT GetWindowRect IN user32 INTEGER hwnd, STRING @ lpRect
DECLARE SHORT GetClientRect IN user32 INTEGER hwnd, STRING @ lpRect  
 
lpRect = REPLI (Chr(0), 16)  
= GetWindowRect (GetDesktopWindow(), @lpRect)
= _show (lpRect, "*** Desktop window rectangle")
 
lpRect = REPLI (Chr(0), 16)  
= GetClientRect (GetDesktopWindow(), @lpRect)
= _show (lpRect, "*** Desktop window client rectangle")
 
? "*** _SCREEN properties"
WITH _SCREEN
    ? "    left:   " + STR(.Left,   6)  
    ? "    top:    " + STR(.Top,    6)  
    ? "    right:  " + STR(.Left + .Width - 1,  6)  
    ? "    bottom: " + STR(.Top + .Height - 1, 6)  
    ? "    width:  " + STR(.Width,  6)  
    ? "    height: " + STR(.Height, 6)  
ENDWITH
 
PROCEDURE  _show (lpRect, lcTitle)
    lnWinLeft   = buf2dword(SUBSTR(lpRect,  1,4))  
    lnWinTop    = buf2dword(SUBSTR(lpRect,  5,4))  
    lnWinRight  = buf2dword(SUBSTR(lpRect,  9,4))  
    lnWinBottom = buf2dword(SUBSTR(lpRect, 13,4))  
    lnWinWidth  = lnWinRight - lnWinLeft + 1  
    lnWinHeight = lnWinBottom - lnWinTop + 1  
 
    ? lcTitle
    ? "    left:   " + STR(lnWinLeft,   6)  
    ? "    top:    " + STR(lnWinTop,    6)  
    ? "    right:  " + STR(lnWinRight,  6)  
    ? "    bottom: " + STR(lnWinBottom, 6)  
    ? "    width:  " + STR(lnWinWidth,  6)  
    ? "    height: " + STR(lnWinHeight, 6)  
    ?
 
FUNCTION  buf2dword (lcBuffer) 
RETURN; 
    Asc(SUBSTR(lcBuffer, 1,1)) + ; 
    Asc(SUBSTR(lcBuffer, 2,1)) * 256 +; 
    Asc(SUBSTR(lcBuffer, 3,1)) * 65536 +; 
    Asc(SUBSTR(lcBuffer, 4,1)) * 16777216 
 
 

User rating: 10/10 (1 votes)
Rate this code sample:
  • ~
1517 bytes  
Created: 2001-08-04 12:00:00  
Modified: 2001-09-28 16:45:27  
Visits in 7 days: 69  
Listed functions:
GetClientRect
GetDesktopWindow
GetWindowRect
Printer friendly API declarations
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 (54.234.126.92)
33.12 min.
Function group: 'Dialog Box'
33.17 min.Example: 'How to empty the Recycle Bin'
4.61 hrs.Example: 'Displaying icons in the system tray (VFP9)'
Language: 'Visual FoxPro'
 Example: 'Enumerating servers of the specified type (e.g. SQL Server) in the primary domain'
5.43 hrs.Function: 'CeWriteFile'
Function group: 'Remote Application Programming (RAPI)'
7.04 hrs.Example: 'Printing text on the main VFP window'
8.93 hrs.Function: 'ExitWindows'
1 day(s)Function: 'StrTrim'
Function group: 'String'
 Function: 'GetProp'
 Function: 'MonitorFromWindow'
Google
Advertise here!