Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.
GetFileOwner - Get the owner of an NTFS file
Reading virtual key status values and key names
Setting and retrieving the double-click time for the mouse
Setting properties of the window: caption and user-defined value
Using an Event Object. Part A: running an application that creates an Event object
Using an Event Object. Part B: running an application responding to events
Using Custom FTP class (DEFINE CLASS ftp As Custom)
Enumerating servers of the specified type (e.g. SQL Server) in the primary domain
How to test file attributes (key method for FileExists and DirectoryExists routines)
Locking and unlocking file of a VFP table
Retrieving information about MS-DOS device names using QueryDosDevice (WinNT only)
Using Multimedia Command Strings to play MIDI files
Winsock: initializing the service in the VFP application
Creating hash values for the list of names
Enumerating MIDI output devices
Reading data from INI files
Retrieving geometrical parameters of the system desktop window
Retrieving the name of the primary domain controller (PDC) and join status information (NT/2000/XP)
Running a regular FoxPro form while main VFP window is minimized
Accessing a CD device (cdaudio) with Multimedia Command Strings
GDI+: converting text strings to images and saving in a graphics file
Pocket PC: creating new database in the Object Store and copying Contacts Database records into it
Retrieving configuration information for the specified server (Win98/Me)
Validating URLs using moniker functions

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
 
#DEFINE S_OK                   0
#DEFINE S_FALSE                1
#DEFINE E_INVALIDARG 0x80070057
 
DECLARE INTEGER IsValidURL IN urlmon;
    INTEGER pBC, STRING szURL, INTEGER dwReserved
 
= validateUrl ("http://www.news2news.com")
= validateUrl ("www.news2news.com")
= validateUrl ("http://if protocol prefix included it validates everything")
 
PROCEDURE  validateUrl (lcUrl)
    LOCAL lnResult
    lnResult = IsValidURL (0, a2w(lcUrl), 0)
 
    ? "Validating:", lcUrl, "-> "
    DO CASE
    CASE lnResult = S_OK
        ?? "URL is valid"
    CASE lnResult = S_FALSE
        ?? "URL is INvalid"
    CASE lnResult = E_INVALIDARG
        ?? "One of the parameters is invalid"
    OTHER
        ?? "Have no idea"
    ENDCASE
 
FUNCTION a2w (lcStr)
* converts source string to wide-chars
    LOCAL lcResult, ii
    lcResult = ""
    FOR ii=1 TO Len(lcStr)
        lcResult = lcResult + SUBSTR(lcStr, ii,1) + Chr(0)
    ENDFOR
RETURN lcResult+Chr(0)
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
904 bytes  
Created: 2001-11-14 19:22:01  
Modified: 2005-12-27 10:41:44  
Visits in 7 days: 85  
Listed functions:
IsValidURL
Printer friendly API declarations
My comment:
At least now this function does not look much useful to me.
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 (23.22.252.150)
3 sec.Function: 'WinExec'
6 sec.Example: 'GDI+: Storing DLL icon resources in image files'
7.07 min.Example: 'Retrieving information about the specified icon'
7.18 min.Function: 'ReleaseMutex'
Function group: 'Synchronization'
2.3 hrs.Example: 'Writing to INI file'
12.34 hrs.Example: 'How to make a VFP form fading out when released (GDI version)'
14.55 hrs.Example: 'Obtaining information about all user accounts on a server (WinNT only)'
 Function: 'GdipNewInstalledFontCollection'
1 day(s)Function: 'WNetGetUser'
 Example: 'Simple Window Viewer'
Google
Advertise here!