Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Setting properties of the window: caption and user-defined value
Storing screen shot of a form to enhanced metafile (*.emf)
Displaying animated images on FoxPro form with BitBlt and StretchBlt functions
Enumerating the subkeys for a given registry key
FindText -- the hopeless and useless Common Dialog
How to enumerate sessions and processes on a specified terminal server
How to retrieve the number of print jobs queued for the printer
Monitoring changes occurring within a directory
Obtaining addresses for the adapters on the local computer (Win XP/2003/Vista)
Shortcut Menu Class
The original LoadPicture() function in VFP returns valid handles to bitmaps, icons, cursors, and metafiles
Using custom Simple MapiSendMail class
Using the GradientFill function
Using the SystemParametersInfo function
GDI+: printing vertical text on VFP reports via generated images (VFP8)
How to play a waveform sound (a WAV file in particular)
How to retrieve network parameters for the local computer (including Host name, Domain name, and DNS Server)
How to write and read Window Properties for the specified window
Retrieving information about the specified icon
Testing Clipboard functions: emptying the clipboard
Using the MessageBox Win32 function
Adding supplementary data to AVI files
How to delete all print jobs for a printer
How to enumerate cookies and URL History entries in the cache of the local computer
Class library providing access to the System 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
Versions:
click to open
Before you begin:
The following code includes classes registry, regkey, regkeys, regvalue and regvalues. All together they provide view, read, write and delete functionality for the System Registry. Examples showing how to use this class are coming soon.

Create Registry object before using any other class from this library. This object contains API declarations the other classes use.

LOCAL rg As Registry
rg = CREATEOBJECT("Registry")

The next snip opens Software key in HKEY_LOCAL_MACHINE and adds _test subkey to it.

LOCAL rgkey As regkey
rgkey = CREATEOBJECT("regkey",;
        HKEY_LOCAL_MACHINE, "Software")

WITH rgkey
        IF .OpenKey()
                .CreateSubkey("_test", "")
        ENDIF
ENDWITH

And the last one adds several values to a key.

WITH rgkey
        IF .OpenKey()
                .SetValue("TestValue0", 0, 16) && REG_NONE
                .SetValue("TestValue1", 1, "abc") && REG_SZ
                .SetValue("TestValue3", 3, "abc") && REG_BINARY
                .SetValue("TestValue4", 4, "128") && REG_DWORD
        ENDIF
ENDWITH
 
  Members area. Log in to view this example.
 
  User name:
  Password:
 
 
  Forgot your password?
 
  Sign up for
the Membership
 
 


User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
8250 bytes  
Created: 2004-10-18 19:25:31  
Modified: 2011-12-10 09:20:22  
Visits in 7 days: 82  
Listed functions:
RegCloseKey
RegCreateKeyEx
RegDeleteKey
RegDeleteValue
RegEnumKeyEx
RegEnumValue
RegOpenKeyEx
RegQueryInfoKey
RegSetValueEx
Printer friendly API declarations
My comment:
RegDeleteKey: the subkey to be deleted must not have subkeys. CeRegDeleteKey (Windows CE, RAPI) deletes the subkey regardless of whether it has its own subkeys.
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)
1.34 hrs.Function: 'midiOutShortMsg'
Function group: 'Windows Multimedia'
2.82 hrs.Example: 'Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)'
3.93 hrs.Function: 'mmioWrite'
Function group: 'Windows Multimedia'
 Example: 'Printing text on the client area of the main VFP window'
3.94 hrs.Example: 'How to retrieve the number of print jobs queued for the printer'
Language: 'C++'
5.27 hrs.Example: 'Placing an arbitrary rectangular area of main VFP window on the Clipboard'
 Example: 'Converting strings between ANSI and OEM'
 Function: 'RegQueryInfoKey'
Function group: 'Registry'
5.71 hrs.Function: 'SHBrowseForFolder'
Function group: 'Shell Functions'
 Example: 'Setting the last-error code for the FoxPro'
Google
Advertise here!