Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Activating 'Open With' dialog after it's been launched
Message
 
À
27/04/2005 10:02:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
01008829
Message ID:
01008983
Vues:
20
This message has been marked as the solution to the initial question of the thread.
Malcolm,

Try this:
lcfile=.....

oShell = CreateObject("WScript.Shell")
* activate the dialog to choose from the List or from the WEB
oShell.Run("rundll32.exe shell32.dll, OpenAs_RunDLL " +lcfile)
WAIT WINDOW TIMEOUT 1.0 ""
IF oShell.AppActivate("Windows")  
	oShell.Sendkeys("S~")  && force to open the List
	WAIT WINDOW TIMEOUT 1.0 ""
	IF oShell.AppActivate("Open With")
		?"OK"
	endif
endif
>Is there any generic, locale and OS indepedent way to invoke the "Open With" dialog and have it gain focus? (I'm using the SW_SHOWNORMAL constant from Winuser.h for my ShellExec call).
>
>Background:
>
>I'm using the code at the following URL to display the "Open With" dialog box.
>http://support.microsoft.com/default.aspx?scid=kb;en-us;192352
>
>This code works great, except on my XP SP 2 system, the "Open With" dialog box is opened behind all my other windows. Even worse, this dialog does not place an icon in the task bar, so if you don't Alt+Tab look for it, you won't even know it's there! Confession: Spent some head scratching on that one! ;p
>
>News2News's has an interesting article on using "rundll32.exe" (see url below) but the article doesn't discuss the issue of bringing the Control Panel dialogs to the foreground.
>http://news2news.com/vfp/?function=-1&example=391
>
>I believe(?) I could find the window by searching on window titlebars for "Open With", but then this solution won't port to other locales with a different translation for "Open With". I'm looking a generic solution.
>
>Thank you,
>Malcolm
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform