 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Edward Guest
|
Posted: Tue Jul 25, 2006 9:16 pm Post subject: how to select a file in Explorer? |
|
|
Hello, everybody!
Does anybody know how to programmatically launch Windows Explorer and then
select an existing file in its list view pane?
The following code:
ShellExecute(<hwnd>, "explore", <folder>, NULL, "", SW_SHOWNORMAL);
does half the task - it launches Explorer and opens the specified <folder>.
But how to make Explorer select some file in this folder?
Any help will be appreciated.
Thank you.
Edward. |
|
| Back to top |
|
 |
Minas Guest
|
Posted: Tue Jul 25, 2006 11:58 pm Post subject: Re: how to select a file in Explorer? |
|
|
"Edward" <edw_s (AT) pochta (DOT) ru> wrote
| Quote: | Does anybody know how to programmatically launch Windows Explorer and then
select an existing file in its list view pane?
The following code:
ShellExecute(<hwnd>, "explore", <folder>, NULL, "", SW_SHOWNORMAL);
|
you can use the following
ShellExecute(Handle,"","explorer","/select,C:\\FullPathHere\\YourFile.Ext",NULL,SW_SHOWNORMAL);
_minas
------
"Only the virtue's conquests have certainty" Sofokleous Erephyle |
|
| Back to top |
|
 |
Edward Guest
|
Posted: Wed Jul 26, 2006 4:35 pm Post subject: Re: how to select a file in Explorer? |
|
|
Thank you, Minas,
It's so simple...
I tried it under XP and this works. But will it work under 98 and Me?
"Minas" <(min_charATyahooPUTADOTgr)(HellenicFire)> wrote in message
news:44c669fd (AT) newsgroups (DOT) borland.com...
| Quote: |
"Edward" <edw_s (AT) pochta (DOT) ru> wrote
Does anybody know how to programmatically launch Windows Explorer and
then select an existing file in its list view pane?
The following code:
ShellExecute(<hwnd>, "explore", <folder>, NULL, "", SW_SHOWNORMAL);
you can use the following
ShellExecute(Handle,"","explorer","/select,C:\\FullPathHere\\YourFile.Ext",NULL,SW_SHOWNORMAL);
_minas
------
"Only the virtue's conquests have certainty" Sofokleous Erephyle
|
|
|
| Back to top |
|
 |
Minas Guest
|
Posted: Wed Jul 26, 2006 8:55 pm Post subject: Re: how to select a file in Explorer? |
|
|
"Edward" <edw_s (AT) pochta (DOT) ru> έγραψε στο μήνυμα
news:44c7537e (AT) newsgroups (DOT) borland.com...
| Quote: | I tried it under XP and this works. But will it work under 98 and Me?
|
the folllowing works in winxp and win98
ShellExecute(NULL,"open","explorer","
/select,C:\\FullPathHere\\YourFile.Ext","",SW_SHOWNORMAL);
The only *problem* in WIN98 I got is that if you include the /e switch the
file is not
highlighted but the selection remains on the folder in the left pane.
What I mean for /e switch
ShellExecute(NULL,"open","explorer","
/e,/select,C:\\FullPathHere\\YourFile.Ext","",SW_SHOWNORMAL);
in WINXP shows also folders pane with file selected and current folder
grayed but in WIN98 the
selection appears only on the folder
So better don't use /e (show folders pane) switch if you plan it
for older systems.
_minas
------
"Only the virtue's conquests have certainty" Sofokleous Erephyle |
|
| Back to top |
|
 |
Edward Guest
|
Posted: Thu Jul 27, 2006 12:45 am Post subject: Re: how to select a file in Explorer? |
|
|
Thank you Minas,
It really helped me.
Edward.
"Minas" <(min_charATyahooPUTADOTgr)(HellenicFire)> wrote in message
news:44c7905f$1 (AT) newsgroups (DOT) borland.com...
| Quote: | "Edward" <edw_s (AT) pochta (DOT) ru> έγραψε στο μήνυμα
news:44c7537e (AT) newsgroups (DOT) borland.com...
I tried it under XP and this works. But will it work under 98 and Me?
the folllowing works in winxp and win98
ShellExecute(NULL,"open","explorer","
/select,C:\\FullPathHere\\YourFile.Ext","",SW_SHOWNORMAL);
The only *problem* in WIN98 I got is that if you include the /e switch the
file is not
highlighted but the selection remains on the folder in the left pane.
What I mean for /e switch
ShellExecute(NULL,"open","explorer","
/e,/select,C:\\FullPathHere\\YourFile.Ext","",SW_SHOWNORMAL);
in WINXP shows also folders pane with file selected and current folder
grayed but in WIN98 the
selection appears only on the folder
So better don't use /e (show folders pane) switch if you plan it
for older systems.
_minas
------
"Only the virtue's conquests have certainty" Sofokleous Erephyle
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|