Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Enumerating data formats currently available on the clipboard
Custom GDI+ class
Mapping and disconnecting network drives
Winsock: sending email messages (SMTP, port 25)
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Converting Unicode data from the Clipboard to a character string using a given code page
Disk in drive A:
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
How to display the Properties dialog box for a file (ShellExecuteEx)
Enumerating network resources
Detecting changes in connections to removable drives (VFP9)
How to download a file from the FTP server using FtpGetFile
Splash Screen for the VFP application
Using Font and Text functions
Using EnumPrinters function to enumerate locally installed printers
How to play AVI file on the _screen
Retrieving the name of the network resource associated with a local device
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
Creating irregularly shaped FoxPro form using transparency color key
Creating a console window for Visual FoxPro application
How to put a horizontal text scrolling on the form (a news line)
Pocket PC: modifying keys in 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
Before you begin:
Start ActiveSync and establish connection with your Pocket PC before the testing.

The code is based on custom RAPI class. Download the class module first and save it in clsRapiReg.prg file.


IMPORTANT: this code, if run successfully, adds key
HKEY_CURRENT_USER\Software\News2News
to the System Registry on your mobile device.

Even after being tested carefully on my own hardware it may contain errors, which may damage the registry information. I suggest you to backup the System Registry before the testing.
 
SET PROCEDURE TO clsRapiReg ADDITIVE
#DEFINE HKEY_CURRENT_USER   0x80000001
 
LOCAL oRapi, oKey, cKeyName, cSubkeyName, oSubkey
oRapi = CREATEOBJECT("Trapi")
 
IF NOT oRapi.Connected
    = MESSAGEBOX("Mobile device is unavailable.     ", 48, "Error")
    RETURN
ENDIF
 
cKeyName = "Software"
cSubkeyName = "News2News\winapi\membership"
 
oKey = CREATEOBJECT("Tkey", HKEY_CURRENT_USER, cKeyName)
IF NOT oKey.OpenKey()
    = MESSAGEBOX("Could not open the specified key.     ", 48, "Error")
ENDIF
 
IF oKey.CreateSubkey(cSubkeyName, "")
    oSubkey = CREATEOBJECT("Tkey", HKEY_CURRENT_USER,;
        cKeyName+"\"+cSubkeyName)
 
    IF oSubkey.OpenKey()
        oSubkey.SetValueStr("account", SYS(0))
        oSubkey.SetValueStr("group", "guest")
 
        oSubkey.SetValueInt("start", VAL(SYS(11, DATE())))
        oSubkey.DeleteValue("start")  && value deleted immediately
    ENDIF
ENDIF
 
* delete the subkey when it is no longer needed
*oKey.DeleteSubkey("news2news")
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
950 bytes  
Created: 2004-06-28 13:54:04  
Modified: 2009-02-15 19:30:38  
Visits in 7 days: 48  
Listed functions:
Printer friendly API declarations
My comment:
API functions used in the base class:
CeRapiInitEx
CeRapiUninit
CeRegCloseKey
CeRegCreateKeyEx
CeRegDeleteKey
CeRegDeleteValue
CeRegEnumKeyEx
CeRegEnumValue
CeRegOpenKeyEx
CeRegQueryInfoKey
CeRegSetValueEx
WaitForSingleObject

#kwd: sln_pocketpc.
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)
14.13 min.Example: 'Displaying bitmap using the AlphaBlend function'
5.27 hrs.Example: 'Using the GradientFill function'
 Example: 'How to adjust monitor brightness (Vista, monitor with DDC support)'
7.02 hrs.Function: 'CryptProtectData'
Function group: 'Cryptography Reference'
8.38 hrs.Function: 'CreateFont'
Function group: 'Font and Text'
13.02 hrs.Function: 'MAPILogon'
15.25 hrs.Function: 'GdipSetPageUnit'
Function group: 'GDI+ Graphics'
 Example: 'Getting a bit more than the _CLIPTEXT offers'
 Example: 'Using the FindMediaType function'
15.71 hrs.Example: 'How to view icons stored in executable files (Icon Viewer)'
Google
Advertise here!