Stefan Küng wrote:
> Valik wrote:
>> Stefan Küng wrote:
>>>
>>> AFAIK, there's no official way to open the explorer and select a 
>>> file. And I won't implement some kind of hack to do that.
>>>
>> Sure there is.  See this link:
>> http://support.microsoft.com/default.aspx?scid=kb;EN-US;q152457
>>
>> The /select,<object> will select the specified object in the new 
>> explorer window.
>>
> 
> But that would mean hard coding to use the windows explorer. Currently 
> we're using ShellExecuteEx() with the "explore" verb. And that will open 
> the default explorer the user has set.
> 
> Stefan
> 
That's a good point - a point so good that saying "Selecting an item is 
incompatible with non-Windows Explorer shells so we won't implement 
this" should be your official response.
That being said, you might be able to take a long way around to use the 
Shell's object model to set focus.  The steps would be something like:
- Find the GUI thread in the ShellExecuteEx()'d process.
- Find the GUI HWND using GetGUIThreadInfo().
- Instantiate Shell.Application and iterate the Windows collection 
looking for the HWND.
- The Document property of the Internet Explorer object the Windows 
collection returns (for an Explorer window) is IShellFolderViewDual2 so 
you now have access to the folder object and can set the selection.
I don't know how replacement shell's are implemented and whether or not 
they have to implement the COM interfaces used above.  Even if they do 
not, you could still detect Windows Explorer being used by checking the 
class and perform the above steps on it.  Admittedly, it's a long way 
around for such a non-critical feature.
-- 
- Valik
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Tue Jun 27 20:37:06 2006