Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Converting path to original case
Deleting a file stored on the FTP server
How to download a file from HTTP server using URL Monikers functions
Retrieving long values associated with the class of the VFP window
Retrieving the priority class for the current process
Retrieving top-child window for the VFP form
Uploading file to the FTP server using InternetWriteFile
URL: splitting into its component parts
Displaying Windows shell folders in TreeView control with Visual FoxPro FLL
How to find when the application started
MapiSendMail class for Visual FoxPro application
URL: converting unsafe characters and spaces into escape sequences
Using FrameRgn for displaying system colors
Yet another modal dialog: now HTML-based
Converting a decimal string to an integer
Converting long file names to the short format and vice versa
Copying strings through the global memory block
GDI+: Color Transparency
GDI+: cropping images
How to position the GETPRINTER() dialog
How to start the screen saver and how to find whether the screen saver is active
Loading a string resource from an executable file
Testing an ODBC connection for supporting specific functionality
Using GetSysColor
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: 88  
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 (184.73.74.47)
4 sec.Example: 'How to retrieve configuration data for a specified printer stored in the registry (PrinterDriverData key)'
5.74 hrs.Example: 'How to print FoxPro form'
 Example: 'Reading VFP settings from the Windows Registry'
7.2 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'
7.77 hrs.Example: 'How to display the port-configuration dialog box for a port on the specified server'
9.05 hrs.Example: 'Drawing Windows predefined bitmaps using the LoadBitmap functions'
9.06 hrs.
16.28 hrs.Function: 'inet_ntoa'
Function group: 'Windows Sockets 2 (Winsock)'
 Function: 'waveOutReset'
Function group: 'Windows Multimedia'
Google
Advertise here!