Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Opening access to the Microsoft Internet functions for the application
Printing text on the main VFP window
Using FtpCommand
Using InternetGoOnline function
Extracting the name and extension parts of a path string
How to find which fonts Windows uses for drawing captions, menus and message boxes
Semi-transparent Form
Storing the environment strings in cursor
Using an Event Object. Part B: running an application responding to events
Winsock: retrieving information about available transport protocols
Animating a transition of the VFP form (a wire-frame rectangle)
Drawing icons associated with the VFP main window
How to hide your program from the Close Program dialog (Win9* only)
How to intercept window messages sent to VFP form
Memory usage info for current VFP session (WinNT only)
Removing FTP directory
Using an Event Object. Part A: running an application that creates an Event object
Using the GetTempFileName
Wininet last error description
Determining if an Active Network Connection is Available
Retrieving configuration information for the specified workstation (Win2000/XP)
Retrieving the names of all sections in an initialization file
Retrieving the state of your Internet connection
Winsock: how to retrieve the protocol information corresponding to a protocol name
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: 102  
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 (184.73.74.47)
1.46 hrs.Example: 'Using FlashWindowEx to flash the taskbar button of the VFP application'
 Example: 'Running a regular FoxPro form while main VFP window is minimized'
2.03 hrs.Example: 'How to display the port-configuration dialog box for a port on the specified server'
3.31 hrs.Example: 'Drawing Windows predefined bitmaps using the LoadBitmap functions'
 
10.54 hrs.Function: 'inet_ntoa'
Function group: 'Windows Sockets 2 (Winsock)'
 Function: 'waveOutReset'
Function group: 'Windows Multimedia'
13.55 hrs.Function: 'GetPrivateProfileSectionNames'
15.19 hrs.Example: 'Getting a bit more than the _CLIPTEXT offers'
 Function: 'InternalGetWindowText'
Google
Advertise here!