Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Sat, 8 Mar 2008 19:44:01 -0800,    group: microsoft.public.platformsdk.gdi        back       


OPENFILENAME   
I used 
      OPENFILENAME structure
and  
      GetOpenFileName (&ofn)

I get a dialog box similar to windows explorer.
But the default setting of the dialog box is “list”.
I like to set the default setting to “Thumbnails”.

At this time I have to click “View” button and then select “Thumbnail” 

It is desirable to open the dialog box with “Thumbnail” as default.

I platform is windows XP service pack 2.

Is it possible to do this?

SpottyThe Dog

My setup for OPENFILENAME structure is the following:

     static char szFilter[] = "Picture Files (*.bmp 
*.jpg...)\0*.bmp;*.jpg\0"  \
                              "Text Files (*.TXT)\0*.txt\0"  \
                              "ASCII Files (*.ASC)\0*.asc\0" \
                              "All Files (*.*)\0*.*\0\0" ;

     ofn.lStructSize       = sizeof (OPENFILENAME) ;
     ofn.hwndOwner         = hwnd ;
     ofn.hInstance         = NULL ;
     ofn.lpstrFilter       = szFilter ;
     ofn.lpstrCustomFilter = NULL ;
     ofn.nMaxCustFilter    = 0 ;
     ofn.nFilterIndex      = 0 ;
     ofn.lpstrFile         = NULL ;  
     ofn.nMaxFile          = _MAX_PATH ;
     ofn.lpstrFileTitle    = NULL ;        
     ofn.lpstrInitialDir   = NULL ;
     ofn.lpstrTitle        = NULL ;
     ofn.Flags             = 0 ;
     ofn.nFileOffset       = 0 ;
     ofn.nFileExtension    = 0 ;
     ofn.lpstrDefExt       = "txt" ;
     ofn.lCustData         = 0L ;
     ofn.lpfnHook          = NULL ;
     ofn.lpTemplateName    = NULL ;
     }
	strcpy(initdr,"C:\\Documents and Settings\\chchi\\My           
             Documents\\My Pictures");
     ofn.lStructSize       = sizeof (OPENFILENAME) ;
     ofn.hwndOwner         = hwnd ;
     ofn.hInstance         = NULL ;

     ofn.lpstrFilter       = szFilter ;
     ofn.lpstrCustomFilter = NULL ;
     ofn.nMaxCustFilter    = 0 ;


     ofn.lpstrInitialDir   = initdr ;
     ofn.nFilterIndex      = 1 ;
     ofn.lpstrFile         = pstrFileName ;
     ofn.lpstrFileTitle    = pstrTitleName ;
     ofn.Flags = OFN_HIDEREADONLY | OFN_CREATEPROMPT |   
            OFN_ALLOWMULTISELECT | OFN_EXPLORER;
date: Sat, 8 Mar 2008 19:44:01 -0800   author:   ChangChiTheGraphics

Re: OPENFILENAME   
ChangChiTheGraphics  wrote:
>
>I used 
>      OPENFILENAME structure
>and  
>      GetOpenFileName (&ofn)
>
>I get a dialog box similar to windows explorer.
>But the default setting of the dialog box is “list”.
>I like to set the default setting to “Thumbnails”.
>
>At this time I have to click “View” button and then select “Thumbnail” 
>
>It is desirable to open the dialog box with “Thumbnail” as default.
>
>I platform is windows XP service pack 2.
>
>Is it possible to do this?

I'm curious to know why you would choose a GDI newsgroup for this question?

There's no direct way to do this.  However, you can try using
OFN_ENABLEHOOK to intercept the window messages in the dialog and see if
you can force the change that way.
-- 
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
date: Mon, 10 Mar 2008 23:14:42 -0700   author:   Tim Roberts

Re: OPENFILENAME   
Thank you Tim,

I am new to the use of news groups.
Could you suggest which news group this issue should be posted?
This is a "user Interface" issue, I think.

I am also following your suggestion with OFN_ENABLEHOOK flag
I hope to inform you the outcome.
ChangChiTheGraphics





"Tim Roberts" wrote:

> ChangChiTheGraphics  wrote:
> >
> >I used 
> >      OPENFILENAME structure
> >and  
> >      GetOpenFileName (&ofn)
> >
> >I get a dialog box similar to windows explorer.
> >But the default setting of the dialog box is “list”.
> >I like to set the default setting to “Thumbnails”.
> >
> >At this time I have to click “View” button and then select “Thumbnail” 
> >
> >It is desirable to open the dialog box with “Thumbnail” as default.
> >
> >I platform is windows XP service pack 2.
> >
> >Is it possible to do this?
> 
> I'm curious to know why you would choose a GDI newsgroup for this question?
> 
> There's no direct way to do this.  However, you can try using
> OFN_ENABLEHOOK to intercept the window messages in the dialog and see if
> you can force the change that way.
> -- 
> Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.
>
date: Tue, 11 Mar 2008 01:50:01 -0700   author:   ChangChiTheGraphics

Re: OPENFILENAME   
It's a shell issue. Try posting to microsoft.public.platformsdk.shell.

I imagine there is a solution relating to the ICommDlgBrowser interface.

ICommDlgBrowser Interface:
http://msdn2.microsoft.com/en-us/library/bb776141(VS.85).aspx

"ChangChiTheGraphics"  wrote 
in message news:D0EFE9F3-1369-4C57-B66B-64CEFD5E6172@microsoft.com...
> Thank you Tim,
>
> I am new to the use of news groups.
> Could you suggest which news group this issue should be posted?
> This is a "user Interface" issue, I think.
>
> I am also following your suggestion with OFN_ENABLEHOOK flag
> I hope to inform you the outcome.
> ChangChiTheGraphics
>
>
>
>
>
> "Tim Roberts" wrote:
>
>> ChangChiTheGraphics  
>> wrote:
>> >
>> >I used
>> >      OPENFILENAME structure
>> >and
>> >      GetOpenFileName (&ofn)
>> >
>> >I get a dialog box similar to windows explorer.
>> >But the default setting of the dialog box is "list".
>> >I like to set the default setting to "Thumbnails".
>> >
>> >At this time I have to click "View" button and then select "Thumbnail"
>> >
>> >It is desirable to open the dialog box with "Thumbnail" as default.
>> >
>> >I platform is windows XP service pack 2.
>> >
>> >Is it possible to do this?
>>
>> I'm curious to know why you would choose a GDI newsgroup for this 
>> question?
>>
>> There's no direct way to do this.  However, you can try using
>> OFN_ENABLEHOOK to intercept the window messages in the dialog and see if
>> you can force the change that way.
>> -- 
>> Tim Roberts, timr@probo.com
>> Providenza & Boekelheide, Inc.
>>
date: Tue, 11 Mar 2008 13:35:24 -0400   author:   Paul Baker [MVP, Windows - SDK] am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us