Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to enumerate cookies and URL History entries in the cache of the local computer
Setting the mouse capture to the specified window
Winsock: how to retrieve the protocol information corresponding to a protocol number
Winsock: resolving an address to a host name
Disabling mouse and keyboard input for the main VFP window (with the app still running)
Drawing Windows frame controls using the DrawFrameControl function
Enumerating network interfaces on the local computer
GDI+: Scrolling through large image using the mouse
Reading and setting Environment variables
Using GetFileSize
Enumerating servers of the specified type (e.g. SQL Server) in the primary domain
GDI+: cropping images
GetFocus returns a HWND value
How to block the PrintScreen key
How to create a desktop shortcut (shell link)
How to enumerate, add and delete shares on the local computer (WinNT/XP)
How to hide your program from the Close Program dialog (Win9* only)
Locking mouse and keyboard input for the VFP application
Pocket PC: base class
Retrieving long values associated with the class of the VFP window
Saving HKEY_LOCAL_MACHINE\\Software\\ODBC Registry Entries to an XML file
System and Local Time values
Deleting a file stored on the FTP server
How to enumerate terminal servers within the specified Windows domain
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: 61  
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.16.36.153)
3 sec.Function: 'GetShortPathName'
Function group: 'File Management'
24.78 min.Example: 'Setting the Window Region for a form'
24.83 min.Function: 'GetWindowContextHelpId'
24.88 min.Example: 'Class library providing access to the System Registry'
1.76 hrs.Function: 'midiOutShortMsg'
Function group: 'Windows Multimedia'
3.23 hrs.Example: 'Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)'
4.35 hrs.Function: 'mmioWrite'
Function group: 'Windows Multimedia'
 Example: 'Printing text on the client area of the main VFP window'
 Example: 'How to retrieve the number of print jobs queued for the printer'
Language: 'C++'
5.69 hrs.Example: 'Placing an arbitrary rectangular area of main VFP window on the Clipboard'
Google
Advertise here!