Sign in to follow this  
Followers 0
fxm

Accessing Win_7 DirectUIHWND like SysListView32

1 post in this topic

#1 ·  Posted (edited)

Background:

I had a working application on multiple XP/Vista systems which I was trying to run on Win_7.

Using references pfovided by Ascend4nt and code provided by Ascend4nt, KaFu, and klaus.s (see ) [thanks again to all!] I was able to get just enough of the application to work with DirectUIHWND - albeit somewhat inelegantly - while learning something about objects and a little about the shell.

Now, however, the scope of the task has changed and I am sorely feeling the [apparent] lack of some SysListView32 methods that I had taken for granted would be available somewhere in the DirectUIHWND environment - but have not been able to find.

The clearest example is the "FindItemWithText()" method - implemented in ControlListView() as the "FindItem" 'command'.

Issues:

1. I was prepared to emulate that method on DirectUIHWND using only the primitive methods in the sample code, but before slogging through such a brute force attack [iterating a FolderItems collection, applying ParseName(), etc.] I was hoping that someone might suggest a less tedious/crude solution.

2. Since writing the previous paragraph and - luckily - before I actually started trying to grind out the code, I was cautiously excited to find the IFolderViewOptions interface, which has Get/Set methods to manpulate the FOLDERVIEWOPTIONS enumeration

typedef enum FOLDERVIEWOPTIONS {
  FVO_DEFAULT            = 0x00000000,
  FVO_VISTALAYOUT        = 0x00000001,
  FVO_CUSTOMPOSITION      = 0x00000002,
  FVO_CUSTOMORDERING      = 0x00000004,
  FVO_SUPPORTHYPERLINKS   = 0x00000008,
  FVO_NOANIMATIONS      = 0x00000010,
  FVO_NOSCROLLTIPS      = 0x00000020
} FOLDERVIEWOPTIONS;

The item in that list of interest to me in solving my problem is FVO_VISTALAYOUT (Use the Windows Vista list view). If that works as I hope, I will be back in the land of SysListView32 - and as the old joke goes, I have already solved that case.

Questions:

1. Can anyone tell me whether there is an obvious [to everyone but me] simpler approach - possibly using a different object reference or even an existing DirectUIHWND method that I have missed?

2a. Assuming that I have a shell object pointing to a window displaying the desired folder, would this

$rtn = $oShellToFilelist.IfolderViewOptions.SetFolderViewOptions(1,1)
do what I want? [i may be missing a qualification level and I'm not at all sure of the format of the parameters (must I use an array or struct?)].

2b. Can that be done on the fly? Or do I have to do it when the window is created? If on the fly, do I have to refresh the window for it to take effect? [My apologies for asking these three questions - I don't have a Win_7 system on which to test.]

3. [related but strictly-speaking not on topic for this forum] I gather that there is some sort of "compatibility" setting on Win_7. Is it possible that marking my .exe on the Win_7 system in some way as requiring Vista-compatibility would make this problem go away with no programming on my part?

Edited by fxm

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0