Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
The DetectAutoProxyUrl function identifies the auto-config script location
Using custom Simple MapiSendMail class
Accessing examples contained in this reference from a VFP application
Creating a unique filename based on existing filename
How to make the caption of a VFP application flashing in the Windows task bar
How to read email messages using Simple MAPI
Listing child windows for the Windows desktop
Obtaining names and positions for shortcuts located on the Windows Desktop
Opening the Page Setup dialog box to specify the attributes of a printed page
Quering a waveform-audio input device
Setting the date and time that a file was created
Simple Window Viewer
Using GetFileSize
Using MessageBeep
Winsock: resolving an address to a host name
Displaying dimmed window behind VFP top-level form
GDI+: saving image of FoxPro form to graphics file (BMP, GIF, JPG, PNG, TIF)
Using the heap of the calling process to allocate memory blocks
Enumerating print processors and supporting data types installed on the specified server
GDI+: Drawing a Pie Chart
Printing text on the client area of the main VFP window
Quering waveform-audio output devices
Retrieving Window Class information for the VFP window
Setting the volume label
Reading VFP settings from the Windows Registry

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
Before you begin:

 
#DEFINE ERROR_SUCCESS 0
#DEFINE KEY_READ 0x020019
#DEFINE KEY_ALL_ACCESS 0x0F003F
#DEFINE HKEY_CURRENT_USER 0x80000001
 
DO declare
 
hBaseKey = 0
 
*!*    lcBaseKey = "Software\Microsoft\VisualFoxProΛ.0\Options"
*!*    lcBaseKey = "Software\Microsoft\VisualFoxProΝ.0\Options"
*!*    lcBaseKey = "Software\Microsoft\VisualFoxProΞ.0\Options"
*!*    lcBaseKey = "Software\Microsoft\VisualFoxProΟ.0\Options"
lcBaseKey = "Software\Microsoft\VisualFoxProΠ.0\Options"
*!*    lcBaseKey = "Software\Microsoft\VisualFoxProΡ.0\Options"
 
*!*    * try this option too
*!*    lcBaseKey = "Software\ODBC\ODBC.INI\ODBC Data Sources"
 
IF RegOpenKeyEx(HKEY_CURRENT_USER, lcBaseKey,;
    0, KEY_ALL_ACCESS, @hBaseKey) <> ERROR_SUCCESS
    ? "Error opening registry key"
    RETURN
ENDIF
 
CREATE CURSOR cs (valuename C(50), valuevalue C(200))
 
dwIndex = 0
DO WHILE .T.
    lnValueLen = 250
    lcValueName = Repli(Chr(0), lnValueLen)
    lnType = 0  
    lnDataLen = 250
    lcData = Repli(Chr(0), lnDataLen)
 
    lnResult = RegEnumValue(hBaseKey, dwIndex,;
        @lcValueName, @lnValueLen, 0,;
        @lnType, @lcData, @lnDataLen)
 
    * for this case on return the type of data (lnType) 
    * is always equal to 1 (REG_SZ)
    * that means null-terminated string
 
    IF lnResult <> ERROR_SUCCESS
        EXIT
    ENDIF
 
    lcValueName = Left(lcValueName, lnValueLen)
    lcData = Left(lcData, lnDataLen-1)
    INSERT INTO cs VALUES (lcValueName, lcData)
 
    dwIndex = dwIndex + 1
ENDDO
 
= RegCloseKey(hBaseKey)
SELECT cs
INDEX ON valuename TAG valuename
GO TOP
BROW NORMAL NOWAIT
 
PROCEDURE declare
    DECLARE INTEGER RegCloseKey IN advapi32 INTEGER hKey
 
    DECLARE INTEGER RegOpenKeyEx IN advapi32;
        INTEGER hKey, STRING lpSubKey, INTEGER ulOptions,;
        INTEGER samDesired, INTEGER @phkResult
 
    DECLARE INTEGER RegEnumValue IN advapi32;
        INTEGER hKey, INTEGER dwIndex, STRING @lpValueName,;
        INTEGER @lpcValueName, INTEGER lpReserved, INTEGER @lpType,;
        STRING @lpData, INTEGER @lpcbData
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1965 bytes  
Created: 2001-09-03 12:00:00  
Modified: 2005-12-12 11:37:17  
Visits in 7 days: 105  
Listed functions:
RegCloseKey
RegEnumValue
RegOpenKeyEx
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 (107.20.129.212)
4 sec.Function: 'GetDIBits'
2.21 hrs.Example: 'Enumerating servers of the specified type (e.g. SQL Server) in the primary domain'
3.97 hrs.Example: 'How to detect if additional monitor is connected and active'
 Function: 'GetComputerName'
6.84 hrs.Example: 'Retrieving long values associated with the class of the VFP window'
6.85 hrs.Example: 'How to download this reference`s archive through WinInet functions using InternetOpenUrl'
8.71 hrs.Example: 'Scanning a hierarchy of child windows down from the Windows Desktop'
 Example: 'How to put a vertical text scrolling on the form (a movie cast)'
9.74 hrs.Function: 'CryptStringToBinary'
 Example: 'Disabling drawing in the VFP form'
Google
Advertise here!