Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using Multimedia Command Strings to play MIDI files
Winsock: initializing the service in the VFP application
Enumerating MIDI output devices
How to write and read Window Properties for the specified window
Pocket PC: creating new database in the Object Store and copying Contacts Database records into it
Reading data from INI files
Retrieving geometrical parameters of the system desktop window
Running a regular FoxPro form while main VFP window is minimized
Accessing a CD device (cdaudio) with Multimedia Command Strings
Current directory of the application
Managing Cookies
Retrieving configuration information for the specified server (Win98/Me)
GDI+: converting text strings to images and saving in a graphics file
How to hide your program from the Close Program dialog (Win9* only)
Saving available locale records into a cursor
Copying files as a transacted operation (Vista)
GDI+: loading image file, drawing on it, saving the result to another file
Retrieving the IP-to-physical address mapping table
Retrieving the rectangle area where the mouse cursor is confined
Current System information
Obtaining the bounding rectangle for the specified device context
Retrieving top-child window for the VFP form
Retrieving window and menu help context identifiers
Simple MAPI: how to pick an email recipient from Outlook Express address book
Pocket PC: Folder Viewer

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 testing the following code.

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

Note that this class creates several Collections, which makes it unusable in older Visual FoxPro versions.

 
oForm = CREATEOBJECT("Tform")
oForm.Show(1)
* end of main
 
DEFINE CLASS Tform As Form
PROTECTED root, rapi
    Height=419
    Width=400
    BorderStyle=2
    AutoCenter=.T.
    Caption="Folder Viewer for Windows CE-based device"
    MaxButton=.F.
    ADD OBJECT tree As Ttree WITH Top=0, Left=0, Height=396, Width=400
    ADD OBJECT sbar As Tbar WITH Top=398, Left=0, Height=21, Width=685
 
PROCEDURE Init
    SET PROCEDURE TO clsRapiFiles ADDITIVE
    THIS.rapi = CREATEOBJECT("Trapi")
 
    IF NOT THIS.rapi.connected
        = MESSAGEBOX("Mobile device is unavailable.     ",;
            48, "Error")
    ELSE
        THIS.root = THIS.addnode(Null,"\")
        THIS.root.text = "MyDevice"
        THIS.root.expanded = .T.
    ENDIF
 
PROCEDURE addnode(ParentNode, cFolderName)
    LOCAL cNodeKey, oNode
    cNodeKey = SYS(2015)
    oNode = THIS.tree.Nodes.Add(ParentNode, 4, cNodeKey, cFolderName)
    oNode.Tag = STRTRAN(oNode.fullpath, "\\", "\")
 
    LOCAL oFiles, oFolder
    oFiles = CREATEOBJECT("Tfiles")
    oFiles.GetFolders(oNode.Tag)
    oFiles.KeySort=2
    FOR EACH oFolder IN oFiles
        THIS.addnode(oNode, oFolder.filename)
    ENDFOR
RETURN oNode
 
PROCEDURE onnodeclick(oNode)
    THIS.sbar.Panels(1).Text = oNode.Tag
ENDDEFINE
 
DEFINE CLASS Ttree As OleControl
    OleClass="MSComctlLib.TreeCtrl"
PROCEDURE Init
    THIS.PathSeparator="\"
    THIS.Style=7
    THIS.LineStyle=0
    THIS.LabelEdit=1
    THIS.Indentation=12
 
PROCEDURE Collapse(node)
    ThisForm.OnNodeClick(node)
PROCEDURE NodeClick(node)
    ThisForm.OnNodeClick(node)
ENDDEFINE
 
DEFINE CLASS Tbar As OleControl
    OleClass="MSComctlLib.SBarCtrl.2"
PROCEDURE Init
    THIS.Height=21
    THIS.Panels(1).Width = 800
ENDDEFINE
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1643 bytes  
Created: 2004-07-04 10:27:33  
Modified: 2011-01-08 08:19:24  
Visits in 7 days: 103  
Listed functions:
Printer friendly API declarations
My comment:
API functions used in the base class:
CeFindAllFiles
CeGetLastError
CeRapiFreeBuffer
CeRapiInitEx
CeRapiUninit
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 (54.235.20.17)
3 sec.Example: 'Printing text on the main VFP window'
1.49 hrs.Example: 'Creating a device context for the specified printer'
3.51 hrs.Example: 'How to find the application associated with a file name'
 Example: 'Programmatically removing submenus from VFP main menu'
3.52 hrs.Example: 'Using mailslots to send messages on the network'
4.39 hrs.Function: 'GdipGetPropertyItem'
Function group: 'GDI+ Image'
 Example: 'Writing to INI file'
Language: 'C#'
5.89 hrs.Example: 'Using the ChooseColor function'
12.71 hrs.Function: 'UrlGetPart'
Function group: 'Shell Lightweight Utility APIs -- Path Functions'
 Example: 'Pocket PC: base class'
Google
Advertise here!