Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Custom GDI+ class
Converting Unicode data from the Clipboard to a character string using a given code page
Custom FTP Class for Visual FoxPro application
Custom HttpRequest class (WinINet)
Displaying animated images on FoxPro form with BitBlt and StretchBlt functions
Establishing connection using the SQLDriverConnect
How to put a vertical text scrolling on the form (a movie cast)
Splash Screen for the VFP application
How to make a VFP form fading out when released (GDI+ version)
How to make a VFP form fading out when released (GDI version)
Using FlashWindowEx to flash the taskbar button of the VFP application
Winsock: sending email messages (SMTP, port 25)
How to create non-blocking Winsock server
Creating a mailslot
Peer-to-peer LAN messenger built with Mailslot API functions
Using WM_COPYDATA for interprocess communication (VFP9)
How to print a bitmap file
Sending a standard message with one or more attached files using default email client
Class for sound recording
GDI+: copying to the Clipboard (a) image of active FoxPro window/form, (b) image file
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
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: 90  
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 (50.17.109.248)
6 sec.Function: 'GetKeyNameText'
Function group: 'Keyboard Input'
8.77 min.Function: 'WNetGetConnection'
8.83 min.Function: 'SetClipboardViewer'
56.82 min.Example: 'An alternative way of setting Form.Closable to False'
6.24 hrs.Function: 'GetDoubleClickTime'
Function group: 'Mouse Input'
Google
Advertise here!