Re: Win2k API "open file" dialogue box help
From: dearmrf (dearmrf_at_yahoooooo.com)
Date: 10/16/03
- Next message: Richard Heathfield: "Re: US programmers = Dodo bird?"
- Previous message: Richard Heathfield: "Re: Programming 64 bit windows? (and Pentium 5)"
- In reply to: Alf P. Steinbach: "Re: Win2k API "open file" dialogue box help"
- Next in thread: Alf P. Steinbach: "Re: Win2k API "open file" dialogue box help"
- Reply: Alf P. Steinbach: "Re: Win2k API "open file" dialogue box help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 16 Oct 2003 00:06:01 GMT
On Tue, 14 Oct 2003 02:04:34 GMT, alfps@start.no (Alf P. Steinbach)
wrote:
>On Mon, 13 Oct 2003 22:56:25 GMT, dearmrf <dearmrf@yahoooooo.com> wrote:
>>
>> I want to set the default Win2k "open file" dialogue box to SHOW
>>DETAILS every time it opens, by default....instead of having to click
>>the little icon every time so I can see the dates/filesize etc of
>>whatever I'm opening.....small but very annoying problem when you have
>>to pick thru lots of files repeatedly when opening them.
>>
>> for some reason windows doesn't remember this setting each time you
>>use the "open" function.
>>
>> I couldn't find any options in the OS or using any of the
>>tweakUI/X-tech utils I've looked at either: seems like you can only do
>>it by modifying the API?
>>
>> unfortunately I don't have a clue how to do that....
>>
>>
>> does anyone know how to change the w2k API so it either remembers
>>previous settings, or sets it to default of "show details"?
>
>The only way I can find is using some undocumented functionality
>(which of course may change in the future...), see below.
>
>
>
>> hope I'm in the right newsgroup, thx for any tips!
>
>I've crossposted this answer to [comp.os.ms-windows.programmer.win32].
>
>However, it may be that in spite of posting to [comp.programming] you're
>not asking a programming question but a Windows configuration question,
>in which case both the answer and the new group is probably irrelevant...
>
>
>
>==========================================================================
>#include <cstddef> // std::size_t
>
>#define STRICT
>#include <windows.h>
>
>#define _WIN32_WINNT 0x501 // XP or better
>#include <commctrl.h> // LVM_SETVIEW
>
>UINT const wmSetViewMode = WM_APP + 1; // Arbitrary
>
>
>template< typename T, std::size_t N >
>std::size_t elemCount( T const (&)[N] ){ return N; }
>
>static UINT_PTR CALLBACK ofnHookProc(
> HWND hdlg,
> UINT uiMsg,
> WPARAM wParam,
> LPARAM lParam
> )
>{
> if( uiMsg == WM_NOTIFY && reinterpret_cast<LPNMHDR>(lParam)->code == CDN_INITDONE )
> {
> PostMessage( hdlg, wmSetViewMode, 0, 0 );
> }
> else if( uiMsg == wmSetViewMode )
> {
> HWND const dlg = GetParent( hdlg );
> HWND const defView = GetDlgItem( dlg, lst2 );
> SendMessage( defView, WM_COMMAND, 28716, 0 );
> }
> return 0;
>} // ofnHookProc
>
>int main()
>{
> char fileSpec[MAX_PATH] = ""; // Must be initialized.
>
> OPENFILENAME dialogData =
> {
> sizeof( dialogData ),
> 0, // Owner window handle
> 0, // Instance handle for template
> "All [*.*]\0*.*\0", // Filters
> NULL, // Custom filter memory
> 0, // Size in tchars of custom filter memory
> 1, // Filter index, 1-based
> fileSpec, // Buffer for user's choice
> static_cast<DWORD>( elemCount( fileSpec ) ),
> NULL, // Buffer for non-qualified filename
> 0, // Size in tchars of above buffer
> "c:\\", // Initial directory
> "A title",
> 0
> //| OFN_DONTADDTORECENT
> | OFN_ENABLESIZING
> | OFN_EXPLORER
> | OFN_PATHMUSTEXIST
> | OFN_ENABLEHOOK,
> 0, // Output filename offset
> 0, // Output file extension offset
> NULL, // Default filename extension
> 0, // Hook data
> &ofnHookProc, // Hook
> NULL // Template name
> };
>
> GetOpenFileName( &dialogData );
>}
( I already replied to this, but I'll try again, since it's not
showing up in either group??)
that's great, thx!!
problem is I'm not a programmer, so I don't know what to do with all
that?
I did copy it into notepad, but do I have to run it as a script or
something? how can I set it up so it runs when I trigger the "open
file" dialogue?
I'm not above figuring it out myself, if someone wants to just submit
a basic prohramming link?
thx
fwiw I'm pretty sure it's not a windows configuration issue, I've
looked all over the net and win2k for any reference to this. out of
sheer desperation I figured I'd post to a programming NG, figured
somebody out there would know somewthing about it?
thx again, much appreciated!!
- Next message: Richard Heathfield: "Re: US programmers = Dodo bird?"
- Previous message: Richard Heathfield: "Re: Programming 64 bit windows? (and Pentium 5)"
- In reply to: Alf P. Steinbach: "Re: Win2k API "open file" dialogue box help"
- Next in thread: Alf P. Steinbach: "Re: Win2k API "open file" dialogue box help"
- Reply: Alf P. Steinbach: "Re: Win2k API "open file" dialogue box help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|