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;
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.
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. >
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. >>