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, 24 May 2008 16:27:00 -0700,    group: microsoft.public.platformsdk.shell        back       


OPENFILENAME, modify defaults   
To Jim barry.

Hi Jim, 

I have been struggling with Paul DiLascia's March 2004 C++ Q&A article for 
more information and some example code, as you suggested on march 13, 2008: 

I am not familiar enogh with MFC to make it work 

Is there an equivalent way to accomplish this wit API approah? 
#include <commdlg.h> 
OPENFILENAME structure 
GetOpenFileName (&ofn) 

Specifically, I can not translate code below into C++ code
 
	CWnd* pshell = GetParent()->GetDlgItem(lst2);
	if (pshell) {
		// SHELLDLL_DefView window found: send it the command.
		pshell->SendMessage(WM_COMMAND, 0x702d);
		return TRUE;
	}

Would you help me to translate this in C++ form ?

I wonder if there is a way to access something like WM_INITDIALOG in API 
approach. 

Thank you, Jim 
Chang 

I am listing essence of DiLucca' code, 

BOOL CMyOpenDlg::OnInitDialog() 
{ 
CFileDialog::OnInitDialog(); 
PostMessage(MYWM_POSTINIT,0,0); 
return TRUE; 
} 
// Handle CDN_INITDONE: shows that list view still not created yet. 
// 
void CMyOpenDlg::OnInitDone() 
{ 
CFileDialog::OnInitDone(); 
} 

// Handle MYWN_POSTINIT: finally, the list view is created. 
// 
LRESULT CMyOpenDlg::OnPostInit(WPARAM wp, LPARAM lp) 
{ 
// SetListView(ODM_VIEW_DETAIL); // this will succeed 
SetListView(LISTVIEWCMD(0x702d)); // this will succeed 
return 0; 
/* 
//LISTVIEWCMD //ODM_VIEW_LIST 
enum LISTVIEWCMD 
{ ODM_VIEW_ICONS = 0x7029, 
ODM_VIEW_LIST = 0x702b, 
ODM_VIEW_DETAIL= 0x702c, 
ODM_VIEW_THUMBS= 0x702d, 
ODM_VIEW_TILES = 0x702e, 
}; 
*/ 
} 

// Change the list view to desired mode if the view exists. 
// Display TRACE diagnostics either way. 
// 
BOOL CMyOpenDlg::SetListView(LISTVIEWCMD cmd){ 
// Note real dialog is my parent, not me! 
CWnd* pshell = GetParent()->GetDlgItem(lst2); 
if (pshell) { 
// SHELLDLL_DefView window found: send it the command. 
pshell->SendMessage(WM_COMMAND, cmd); 
return TRUE; 
} 
return FALSE; 
}
date: Sat, 24 May 2008 16:27:00 -0700   author:   ChangChiTheGraphics

Re: OPENFILENAME, modify defaults   
ChangChiTheGraphics wrote:

> Is there an equivalent way to accomplish this wit API approah? 

see API ng (comp.os.ms-windows.programmer.win32)
where it has been posted many times...
date: Sun, 25 May 2008 09:52:21 +0200   author:   David

Re: OPENFILENAME, modify defaults   
Hi David,

Please forgive my ignorance.
API ng (comp.os.ms-windows.programmer.win32)
Is this a web site, or book?
what does ng stand for?
I tried comp.os.ms-windows.programmer.win32
and www.comp.os.ms-windows.programmer.win32
and I could not get any return.

Please give me a little more guidance.

Thank you,
Chang ChiThe Graphics


"David" wrote:

> ChangChiTheGraphics wrote:
> 
> > Is there an equivalent way to accomplish this wit API approah? 
> 
> see API ng (comp.os.ms-windows.programmer.win32)
> where it has been posted many times...
>
date: Mon, 26 May 2008 01:12:02 -0700   author:   ChangChiTheGraphics

Re: OPENFILENAME, modify defaults   
ChangChiTheGraphics wrote:
> Hi David,
> 
> Please forgive my ignorance.
> API ng (comp.os.ms-windows.programmer.win32)
> Is this a web site, or book?
> what does ng stand for?

???
ng = newsgroup
microsoft.public.platformsdk.shell is a newsgroup (ms)
comp.os.ms-windows.programmer.win32 is a newsgroup (google groups, ...)
date: Mon, 26 May 2008 20:57:52 +0200   author:   David

Google
 
Web ureader.com


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