>cUrl = "www.msn.com" >for i = 1 to 100 > *-- Call the cUrl as if a browser is opened and the cURL is entered. This is what I don't know how to do. > wait(20) >next >To open a URL with the default browser you need to first find out the associated browser (exe) on the users machine which is used for URLs. To do that I use the ShellExecute () function in the Windows API. To declare that function in VFP:
* * ShellExecute - SHELL EXECUTE FUNCTION IN SHELL32 * * Copied (and adapted) from the UniversalThread (FAQ#190, by Gérald Santerre) * According to the author, opens an HTML document or mail. * Actually helps to open *any* document with its default association. * * nShowWindow = ... * * 0 Hides the window and passes activation to another window. * 1 Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position (same as 9). * 2 Activates a window and displays it as an icon. * 3 Activates a window and displays it as a maximized window. * 4 Displays a window in its most recent size and position. The window that is currently active remains active. * 5 Activates a window and displays it in its current size and position. * 6 Minimizes the specified window and activates the top-level window in the system's list. * 7 Displays a window as an icon. The currently active window remains active. * 8 Displays a window in its current state. The window that is currently active remains active. * 9 Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position (same as 1). * DECLARE INTEGER ShellExecute IN SHELL32.DLL ; INTEGER nWinHandle , ; STRING cOperation , ; STRING cFileName , ; STRING cParameters , ; STRING cDirectory , ; INTEGER nShowWindowThen to call it you simple use:
SHELLEXECUTE( 0, "Open", "https://duckduckgo.com", "", "", 1 ) && Enter whatever URL as appropriate