Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Obtaining Shell32.dll version
Removing FTP directory
Retrieving Network Provider information
Storing registration key in the resources of an executable file
Testing MS Internet Explorer version installed
Enumerating ODBC Data Sources available on the local computer
How to obtain the number of rows affected by remote UPDATE, INSERT or DELETE statement
Initiating Inet connection using a modem
Monitoring changes in a directory
Retrieving a universal form for the drive-based path for a network resource
Retrieving configuration information for the specified server (Win98/Me)
Retrieving configuration information for the specified workstation (Win2000/XP)
Using shared memory to exchange data between two FoxPro applications
Wininet last error description
Enumerating files opened on the network
Extracting the name and extension parts of a path string
High-powered ALLTRIM
How to get Special Folders paths
Quering Audio Mixer Device
Reading parameters of streams in AVI file
Accessing Windows Control Panel from VFP Application
GDI+: converting image file to another graphics format
How to browse and connect to printers on a network (WinNT)
How to perform Base64 encoding/decoding using Cryptography API Functions
Retrieving information about the main VFP window

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
 
#DEFINE GWL_WNDPROC -4
#DEFINE GWL_HINSTANCE -6
#DEFINE GWL_HWNDPARENT -8
#DEFINE GWL_STYLE -16
#DEFINE GWL_EXSTYLE -20
#DEFINE GWL_USERDATA -21
#DEFINE GWL_ID -12
 
DO declare
 
LOCAL hWindow
hWindow = GetActiveWindow()
 
? "Window procedure:", GetWindowLong (m.hWindow, GWL_WNDPROC)
? "Application instance:", GetWindowLong (m.hWindow, GWL_HINSTANCE)
? "Parent window:", GetWindowLong (m.hWindow, GWL_HWNDPARENT)
? "Window styles:", GetWindowLong (m.hWindow, GWL_STYLE)
? "Extended window styles:", GetWindowLong (m.hWindow, GWL_EXSTYLE)
? "User data associated:", GetWindowLong (m.hWindow, GWL_USERDATA)
? "Identifier of the window:", GetWindowLong (m.hWindow, GWL_ID)
? "Class name:", GetClsName(m.hWindow)
?
 
? "*** Application handle returned by:"
? "    GetModuleHandle:", GetModuleHandle(NULL)
? "    GetWindowLong:", GetWindowLong (m.hWindow, GWL_HINSTANCE)
?
 
* E_MAGIC
* the GetModuleHandle actually returns the address 
* the executable is mapped into memory
LOCAL hModule, cBuffer
hModule = GetModuleHandle(NULL)
cBuffer = REPLICATE(CHR(0),2)
= MemToStr(@cBuffer, hModule, LEN(cBuffer))
 
* as you may expect, the signature is "MZ", 
* the initials of Mark Zbikowski, one of the original architects of MS-DOS.
? "MS-DOS signature:", cBuffer
 
* end of main
 
FUNCTION GetClsName(hWindow)
    LOCAL nBufsize, cBuffer
    cBuffer = Repli(Chr(0), 250)
    nBufsize = GetClassName(hWindow, @cBuffer, Len(cBuffer))
RETURN SUBSTR(cBuffer, 1, nBufsize)
 
PROCEDURE declare
    DECLARE INTEGER GetModuleHandle IN kernel32 STRING @lpModuleName 
    DECLARE INTEGER GetActiveWindow IN user32
 
    DECLARE INTEGER GetClassName IN user32;
        INTEGER hWnd, STRING lpClassName, INTEGER nMaxCount
 
    DECLARE INTEGER GetWindowLong IN user32;
        INTEGER hWindow, INTEGER nIndex
 
    DECLARE RtlMoveMemory IN kernel32 As MemToStr;
        STRING @dst, INTEGER src, INTEGER nLength
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1919 bytes  
Created: 2001-08-21 12:00:00  
Modified: 2005-11-23 16:47:56  
Visits in 7 days: 74  
Listed functions:
GetActiveWindow
GetClassName
GetModuleHandle
GetWindowLong
Printer friendly API declarations
My comment:
Recommended reading:
An In-Depth Look into the Win32 Portable Executable File Format by Matt Pietrek
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.108.167)
13.45 min.Example: 'How to enumerate, add and delete shares on the local computer (WinNT/XP)'
13.5 min.Function: 'FatalAppExit'
Function group: 'Error Handling'
1.05 hrs.Function: 'GetConsoleWindow'
 Example: 'How to access a file using not its name but an alias (hard link)'
 Example: 'One more way to retrieve environment strings'
2.74 hrs.Example: 'How to print FoxPro form -- II'
 Example: 'Converting an HTTP time/date string to a SYSTEMTIME structure'
4.37 hrs.
Function group: 'GDI+ Graphics'
 Example: 'Retrieving IP statistics for the computer'
6.15 hrs.Function: 'MAPISendMail'
Google
Advertise here!