Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Enumerating data formats currently available on the clipboard
Custom GDI+ class
Mapping and disconnecting network drives
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Winsock: sending email messages (SMTP, port 25)
How to display the Properties dialog box for a file (ShellExecuteEx)
Disk in drive A:
Using Font and Text functions
Detecting changes in connections to removable drives (VFP9)
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
How to download a file from the FTP server using FtpGetFile
How to play AVI file on the _screen
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Using EnumPrinters function to enumerate locally installed printers
Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
Subclassing CommandButton control to create BackColor property
Splash Screen for the VFP application
Creating irregularly shaped FoxPro form using transparency color key
Vertical Label control
Converting Unicode data from the Clipboard to a character string using a given code page
Creating a console window for Visual FoxPro application
Enumerating network resources
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: 104  
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 (72.44.48.122)
4 sec.Example: 'GDI+: copying to the Clipboard (a) image of active FoxPro window/form, (b) image file'
41.07 min.Function: 'SetWaitableTimer'
41.1 min.
41.17 min.Example: 'How to hot-track menu item selection in top-level form (requires VFP9)'
1.38 hrs.Example: 'How to fill a buffer with random bytes using Cryptography API Functions'
 Function: 'WaitForSingleObject'
 Example: 'How to delete all print jobs for a printer'
2.32 hrs.Example: 'Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)'
 Function: 'LsaLookupSids'
Function group: 'Security'
 Function: 'WTSUnRegisterSessionNotification'
Google
Advertise here!