Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening an existing explorer window
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01434702
Message ID:
01434723
Views:
142
This message has been marked as the solution to the initial question of the thread.
>i would like to bring to forefront an actual connection that is currently in the background.
>So let's say i have already made conection to 'https://this is my site.com/main.html' and it opens in a window smply called
>"This is my site - Windows Internet Explorer" as the title of the explorer window. Neither will actually appear in the forefront
>with the code below. Is there a way to open this secondary window? thanks k
>
>this is the code with the problems shown to the right or each solution
>#DEFINE SW_SHOWNORMAL 1
>lcUrl = "This is my site - Windows Internet Explorer" &&& this is the window name -- error not a file
>lcUrl = 'https://this is my site.com/main.html' &&& this is the window url conection --- makes the internet connection again so that i have two.
>
>oShell = Createobject("wscript.shell")
>oShell.Run(lcUrl)
>DECLARE INTEGER ShellExecute IN "Shell32.dll" ;
> INTEGER hwnd, STRING lpVerb, STRING lpFile, ;
> STRING lpParameters, STRING lpDirectory, LONG nShowCmd
>ShellExecute(0, "Open", lcUrl, "", "", SW_SHOWNORMAL)


See if this is what you need:
oCollection = CreateObject( "Shell.Application" )

FOR ia=0 to oCollection.Windows.Count-1
	WITH oCollection.Windows(ia)
		?.FullNAme
		iF "iexplore.exe"$LOWER(.FullNAme) and "window title fragment"$lower(.locationName)
			*all properties and Methods of InternetExplorer.Application"
			* could go here
			?"Title: ",  	.locationName		&&Window Title
			?"URL: ",		.LocationUrl	&&URL
			?"Type: ", 		.Type		&&HTML DOcument
			?"Handle: ",	.HWND		&&Handle
			
	* maximize INternet Explorer, UT Message 684936  
			DECLARE INTEGER ShowWindow IN WIN32API ;
					INTEGER hWnd, Integer nCmd
			cnSW_MAXIMIZE = 3

			ShowWindow(.hWnd, cnSW_MAXIMIZE)
                                                      EXIT

		endif

	ENDwith
ENDFOR

oCollection=.null.
RELEASE oCollection
Good Luck
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform