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
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Winsock: sending email messages (SMTP, port 25)
Mapping and disconnecting network drives
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Custom GDI+ class
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
How to play AVI file on the _screen
Using EnumPrinters function to enumerate locally installed printers
Retrieving the name of the network resource associated with a local device
Custom HttpRequest class (WinHTTP)
Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
Creating a console window for Visual FoxPro application
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Creating irregularly shaped FoxPro form using transparency color key
The DetectAutoProxyUrl function identifies the auto-config script location

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:
Citing from the WLUG Wiki:
   Internet Explorer has an [x] Automatically detect settings check box. This will cause the browser to search for the configuration file.

If your DomainName is machine.something.meta.net.nz then InternetExplorer will request the following urls until it finds a WPAD configuration file.

http://wpad.something.meta.net.nz/wpad.dat
http://wpad.meta.net.nz/wpad.dat
http://wpad.net.nz/wpad.dat
http://wpad.nz/wpad.dat


WPAD stands for Web Proxy Auto-Discovery.

 
DO decl
 
LOCAL lcRmScript, lcLocal
lcRmScript = Repli(Chr(0), 250)
 
* dwDetectFlags = 1, 2
* PROXY_AUTO_DETECT_TYPE_DHCP
* PROXY_AUTO_DETECT_TYPE_DNS_A
IF DetectAutoProxyUrl(@lcRmScript, Len(lcRmScript), 2) = 0
    WAIT WINDOW NOWAIT "Not detected. "
    RETURN
ENDIF
 
lcRmScript = STRTRAN(lcRmScript, Chr(0), "")
 
IF Not EMPTY(lcRmScript)
    = MessageB("Location of a WPAD autoproxy script:     " +;
        Chr(13)+Chr(13) + lcRmScript, 64, " DetectAutoProxyUrl")
 
    WAIT WINDOW NOWAIT "Donwloading from URL... "
    lcLocal = SYS(2003) + "\autoscript.txt"
    URLDownloadToFile(0, lcRmScript, lcLocal, 0,0)
    WAIT WINDOW NOWAIT "Downloaded from " + lcRmScript + "   "
 
    IF FILE(lcLocal)
        MODI FILE (lcLocal) NOMODI NOWAIT
    ENDIF
ENDIF
* end of main
 
PROCEDURE decl
    DECLARE INTEGER GetLastError IN kernel32
 
    DECLARE INTEGER DetectAutoProxyUrl IN wininet;
        STRING @lpszAutoProxyUrl, LONG dwAutoProxyUrlLength,;
        LONG dwDetectFlags
 
    DECLARE INTEGER URLDownloadToFile IN urlmon;
        INTEGER pCaller, STRING szURL, STRING szFileName,;
        INTEGER dwReserved, INTEGER lpfnCB
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1094 bytes  
Created: 2002-11-13 14:03:10  
Modified: 2009-01-03 15:26:33  
Visits in 7 days: 106  
Listed functions:
DetectAutoProxyUrl
GetLastError
URLDownloadToFile
Printer friendly API declarations
My comment:
An example of WPAD.DAT file:

function FindProxyForURL(url, host)
{
        // We only cache http and ftp
        if (url.substring(0, 5) == "http:" || url.substring(0, 4) == "ftp:")
                return "PROXY cache:8080; DIRECT";

        // Otherwise use direct connection
        return "DIRECT";
}


#kwd: sln_http.
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.234.67.55)
54.38 min.Example: 'How to display a dialog box with which the user can add a data source (DSN)'
1.49 hrs.Example: 'How to put a horizontal text scrolling on the form (a news line)'
2.88 hrs.Function: 'CryptGetKeyParam'
Function group: 'Cryptography Reference'
 Example: 'Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)'
3.92 hrs.Example: 'How to retrieve information about a cache entry (Internet Explorer)'
 Example: 'Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window'
8.02 hrs.Example: 'GDI+: Using Scale and Shear transformations'
 Example: 'Locking the workstation'
14.8 hrs.Function: 'GdipCreateFromHWND'
14.91 hrs.Example: 'Using the GetLogicalDriveStrings'
Google
Advertise here!