Re: Opening a folder and auto-selecting file in it by Steve
Steve
Sat Oct 11 13:43:16 CDT 2008
mayayana wrote:
> I tested this on XP. It does work. However,
> the flag parameter is a bit confusing. A flag of
> 4 is supposed to "Deselect all but the specified item."
> But it does not select the specific item! On the
> other hand, if you just use a flag of 1 (Select
> the item), the selection will be added to any
> current selection. So to select one and only one
> item, it needs two calls:
>
> SFV.SelectItem FI, 4
> SFV.SelectItem FI, 17
>
> object.SelectItem vItem, dwFlags
>
> dwFlags:
>
> 0 Deselect the item.
> 1 Select the item.
> 3 Put the item in edit mode.
> 4 Deselect all but the specified item.
> 8 Ensure the item is displayed in the view.
> 16 Give the item the focus.
It is a bit cryptic, but I suspect that a single call with 5 (1 + 4) would get
it done, or if you want focus as well, 21 (1 + 4 + 16) would work as well. Just
4 would leave it selected if it already was selected, but not select it if it
was not.