🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages Started by nicolasr Wed, 16 Apr 2003 20:37
Open Windows Explorer in report view mode
#16956
Author: nicolasr
Date: Wed, 16 Apr 2003 20:37
15 lines
1326 bytes
Hi,

from my application I want to open a Windows Explorer window showing
the contents of my log directory. I used ShellExecute to open the
Explorer:

ShellExecute(Handle, "open", "C:\\mylogs\\", NULL, "C:\\mylogs\\,
SW_SHOWNORMAL);

However, the default view mode is large icons. Does anyone know of a
way to tell Explorer to open in report view mode? Or to change the
view programmatically after the window opened?

thanks for any idea,
Nick
Re: Open Windows Explorer in report view mode
#16957
Author: Remy Lebeau (TeamB)
Date: Wed, 16 Apr 2003 20:56
26 lines
1751 bytes
"nicolasr" <nicolasrNOSPAMATSIGNgmx.net> wrote in message
news:3e9dbef1@newsgroups.borland.com...

> Does anyone know of a way to tell Explorer to
> open in report view mode?

You have no control over that directly.

> Or to change the view programmatically after the window opened?

You have to first locate its HWND window (which you have to do manually),
then you can use Get/SetWindowLong() to adjust the window's style bits, ie:

    HWND hWnd = the listview handle;

    long style = GetWindowLong(hWnd, GWL_STYLE);
    if( (style & LVS_TYPEMASK)  != LVS_REPORT )
    {
        style &= ~LVS_TYPEMASK;
        style |= LVS_REPORT;
        SetWindowLong(hWnd, GWL_STYLE, style);
    }


Gambit
Re: Open Windows Explorer in report view mode
#16961
Author: Martin Golm
Date: Thu, 17 Apr 2003 07:46
9 lines
1288 bytes
nicolasr wrote:
> However, the default view mode is large icons. Does anyone know of a
> way to tell Explorer to open in report view mode? Or to change the
> view programmatically after the window opened?

Maybe this link would help: http://tinyurl.com/9pw6
Have a look at the "Command Line Switches for Windows Explorer" section.

Martin
Re: Open Windows Explorer in report view mode
#16887
Author: nicolasr
Date: Fri, 18 Apr 2003 23:44
4 lines
1087 bytes
thanks for the code example,
I will try it this way.

Nick
Re: Open Windows Explorer in report view mode
#16888
Author: nicolasr
Date: Fri, 18 Apr 2003 23:49
7 lines
1248 bytes
thanks for the reply. I read through the MSDN
article but there seems to be no switch for the
view mode of the list view. So I will try to change
it after starting Explorer.

thanks,
Nick
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads