Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Converting characters in a URL into corresponding escape sequences and backwards
Converting long file names to the short format and vice versa
Converting twips to pixels and vice versa
Deleting files into the Recycle Bin
Drawing icons associated with the VFP main window
Enumerating ODBC drivers available on the local computer
Enumerating ports that are available for printing on a specified server
GDI+: converting image file to another graphics format
GDI+: retrieving list of available image encoders and image decoders
GetFocus returns a HWND value
How to delete a service object
How to obtain Content-Type value for a file type from the System Registry
How to Start a Process as Another User (NT/XP/2K)
Locking the workstation
Managing Cookies
One more way to retrieve environment strings
Opening the Page Setup dialog box to specify the attributes of a printed page
Printing text on the client area of the main VFP window
Reading and setting Environment variables
Retrieving window and menu help context identifiers
Simple Window Viewer
Storing registration key in the resources of an executable file
Subclassing CommandButton control to create BackColor property
Testing Clipboard functions: emptying the clipboard
Converting characters in a URL into corresponding escape sequences and backwards

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:
Similar example using InternetCanonicalizeUrl function.
 
#DEFINE URL_ESCAPE_PERCENT         0x1000
#DEFINE URL_ESCAPE_SEGMENT_ONLY    0x2000
#DEFINE URL_ESCAPE_SPACES_ONLY     0x4000000
#DEFINE URL_UNESCAPE_INPLACE       0x100000
#DEFINE URL_INTERNAL_PATH          0x800000
#DEFINE URL_DONT_ESCAPE_EXTRA_INFO 0x2000000
#DEFINE URL_DONT_SIMPLIFY          0x8000000
 
LOCAL cSource
 
cSource = "http://xyz.com/test/t%e< s t.asp >?" +;
    "url=/{ex% ample < /abc.asp?frame=true#fr%agment"
? "*** Source:"
? cSource
?
 
? "*** UrlEscape:"
? GetEscaped(cSource, URL_ESCAPE_SPACES_ONLY)
? GetEscaped(cSource, URL_ESCAPE_PERCENT)
cSource = GetEscaped(cSource, URL_ESCAPE_SEGMENT_ONLY)
? cSource
?
? "*** UrlUnescape:"
? GetUnescaped(cSource, 0)
* end of main
 
FUNCTION GetEscaped(cSource, nFlag)
    DECLARE INTEGER UrlEscape IN shlwapi;
        STRING pszURL, STRING @pszEscaped,;
        INTEGER @pcchEscaped, INTEGER dwFlags
 
    LOCAL cTarget, nBufsize
    nBufsize = Len(cSource) * 4
    cTarget = Repli(Chr(0), nBufsize)
    = UrlEscape(cSource, @cTarget, @nBufsize, nFlag)
RETURN Left(cTarget, nBufsize)
 
FUNCTION GetUnescaped(cSource, nFlag)
    DECLARE INTEGER UrlUnescape IN shlwapi;
        STRING pszURL, STRING @pszUnescaped,;
        INTEGER @pcchUnescaped, INTEGER dwFlags
 
    LOCAL cTarget, nBufsize
    nBufsize = Len(cSource) * 4
    cTarget = Repli(Chr(0), nBufsize)
    = UrlUnescape(cSource, @cTarget, @nBufsize, nFlag)
RETURN Left(cTarget, nBufsize)
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1399 bytes  
Created: 2003-04-03 17:47:59  
Modified: 2003-04-03 18:03:51  
Visits in 7 days: 20  
Listed functions:
UrlEscape
UrlUnescape
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-2010 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.0.85), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (38.107.191.108)
10.97 min.Function: 'waveInOpen'
Function group: 'Windows Multimedia'
39.02 min.Example: 'How to view icons stored in executable files (Icon Viewer) - II'
40.77 min.Function: 'waveOutUnprepareHeader'
Function group: 'Windows Multimedia'
59.4 min.
1.05 hrs.
Function group: 'String'
1.16 hrs.Example: 'Printing Image File, programmatically set print page orientation to landscape'
2 day(s)Function: 'GetErrorMode'
 
Function group: 'File Mapping'
 Function: 'GetObject'
 Function: 'AVIStreamGetFrameOpen'
Function group: 'Windows Multimedia'
Google
Advertise here!