Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Creating a unique filename based on existing filename
Displaying the drive type value
Retrieving list of all active RAS connections
Using the RestartDialog function -- restarting Windows
Drawing standard Windows icons
Obtaining I/O counts for the current process
Reading header information from AVI file
Using the DrawText function
Using the MessageBox Win32 function
Creating a directory on the FTP
How to view system icons for the classes installed on the local machine
Obtaining Shell32.dll version
Pocket PC: Folder Viewer
Retrieving information about MS-DOS device names using QueryDosDevice (WinNT only)
Tracking mouse movement to detect when to start dragging
Wininet last error description
Disk in drive A:
Enumerating ports that are available for printing on a specified server
Enumerating print processors and supporting data types installed on the specified server
Enumerating Volumes and Volume Mounting Points (NTFS)
GDI+: enumerating fonts installed on the system
Reading VFP settings from the Windows Registry
The DetectAutoProxyUrl function identifies the auto-config script location
Using FtpCommand
Obtaining some properties for the Windows desktop using the GetWindowPlacement function

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
Versions:
click to open
Before you begin:
One more way to obtain display resolution for your system.
 
DO decl
 
*| typedef struct _WINDOWPLACEMENT { 
*|     UINT  length;              0:4
*|     UINT  flags;               4:4
*|     UINT  showCmd;             8:4
*|     POINT ptMinPosition;      12:8
*|     POINT ptMaxPosition;      20:8
*|     RECT  rcNormalPosition;   28:16
*| } WINDOWPLACEMENT; total bytes = 44 bytes
#DEFINE WINDOWPLACEMENT_SIZE  44
 
LOCAL hWindow, lcBuffer, lnShowCmd
hWindow = GetDesktopWindow()
 
lcBuffer = Chr(WINDOWPLACEMENT_SIZE) +;
    Repli(Chr(0), WINDOWPLACEMENT_SIZE-1)
 
= GetWindowPlacement (hWindow, @lcBuffer)
? "Minimized window flags:", buf2dword(SUBSTR(lcBuffer, 5,4))
 
* for the Windows Desktop it is usually SW_SHOWNORMAL = 1
? "Window show state:", buf2dword(SUBSTR(lcBuffer, 9,4))
 
? "Minimized position upper-left:", buf2dword(SUBSTR(lcBuffer, 13,4)),;
    buf2dword(SUBSTR(lcBuffer, 17,4))
 
? "Maximized position upper-left:", buf2dword(SUBSTR(lcBuffer, 21,4)),;
    buf2dword(SUBSTR(lcBuffer, 25,4))
 
* one more way to obtain display resolution for your system
? "Restored position rectangle:", buf2dword(SUBSTR(lcBuffer, 29,4)),;
    buf2dword(SUBSTR(lcBuffer, 33,4)), buf2dword(SUBSTR(lcBuffer, 37,4)),;
    buf2dword(SUBSTR(lcBuffer, 41,4))
 
FUNCTION  buf2dword (lcBuffer)
#DEFINE MAX_DWORD 0xffffffff
#DEFINE MAX_LONG 0x7FFFFFFF
    LOCAL lnResult
    lnResult = Asc(SUBSTR(lcBuffer, 1,1)) + ;
        Asc(SUBSTR(lcBuffer, 2,1)) * 256 +;
        Asc(SUBSTR(lcBuffer, 3,1)) * 65536 +;
        Asc(SUBSTR(lcBuffer, 4,1)) * 16777216
RETURN Iif(lnResult>MAX_LONG, lnResult-MAX_DWORD, lnResult)
 
PROCEDURE decl
    DECLARE INTEGER GetDesktopWindow IN user32
 
    DECLARE INTEGER GetWindowPlacement IN user32;
        INTEGER hWnd, STRING @lpwndpl
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1690 bytes  
Created: 2002-01-25 19:41:29  
Modified: 2005-12-27 10:48:40  
Visits in 7 days: 108  
Listed functions:
GetDesktopWindow
GetWindowPlacement
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.226.79.204)
9 sec.Example: 'Reading the structure of VFP main menu'
Google
Advertise here!