15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CFileDialog Files of Type selections

Tony D. Abel -- tabel@pacbell.net
Sunday, November 24, 1996

Environment: VC++ 4.2-flat, Windows NT 4.0

After the construction of the explore style dialog box upon a change of the
File of Type selection I wish to display the selected *.ext in the file name
edit box. The default behavior of this dialog leaves the file type edit box
blank after a new File of Type selection. Must I construct a new template or
is there a way to get the resource ID of the edit box so as to change the
text I would like to ensure that if I hard code this ID in that microsoft
does not change it in the future :-). I would like my file open dialog to
function like the file open dialog in Word.

Thanks in advance......


Sincerely,


Tony D. Abel




Brad P. Exchange -- Brad.P.Smith@Cognos.COM
Monday, November 25, 1996

[Mini-digest: 2 responses]

Take a look at CFileDialog::OnTypeChange for access to the notification.

As for the control IDs, they're documented in the Win32 Programmer's
Reference. I'm getting it through books online, and a search for the
title "Explorer-Style Control Identifiers" will show you what you need.
>From there you can also get to the documentation for CDM_SETCONTROLTEXT.

The documentation is all there, but sometimes a bit scattered. You need
to make judicious use of the Books Online (or MSDN) query capability to
spelunk for all of the info you need. :-)

Brad.
--
Brad P. Smith - Software Designer
Cognos Inc.; 3755 Riverside Dr.; Ottawa, Ontario, CANADA; K1G 4K9
Voice: (613) 738-1440 ext 3702      FAX: (613) 738-0002
Internet: smithb@bpsmicro.com   or  smithb@cognos.com



>----------
>From: 	Tony D. Abel[SMTP:tabel@pacbell.net]
>Sent: 	Sunday, November 24, 1996 14:05
>To: 	mfc-l@netcom.com
>Subject: 	CFileDialog Files of Type selections
>
>Environment: VC++ 4.2-flat, Windows NT 4.0
>
>After the construction of the explore style dialog box upon a change of the
>File of Type selection I wish to display the selected *.ext in the file name
>edit box. The default behavior of this dialog leaves the file type edit box
>blank after a new File of Type selection. Must I construct a new template or
>is there a way to get the resource ID of the edit box so as to change the
>text I would like to ensure that if I hard code this ID in that microsoft
>does not change it in the future :-). I would like my file open dialog to
>function like the file open dialog in Word.
>
>Thanks in advance......
>
>
>Sincerely,
>
>
>Tony D. Abel
>
>
-----From: John Young 

Hi Tony,

I found this in the SDK docs in MSDN ...

"The Win32 SDK provides the default dialog box template for the old-style 
dialog boxes, but does not include the default template for the Explorer-
style dialog boxes. This is because the Explorer-style dialogs allow you to 
add your own controls but do not support modifying the template for the 
standard controls. However, in some cases, you may need to know the control 
identifiers used in the default templates. For example, the CDM_HIDECONTROL 
and CDM_SETCONTROLTEXT messages require a control identifier. 

"The following table shows the identifiers of the standard controls in the 
Explorer-style Open and Save As dialog boxes. The identifiers are constants 
defined in DLGS.H and WINUSER.H.

Identifier	Description

cmb2		Drop-down combo box that displays the current drive or folder,
		and that allows the user to select a drive or folder to open
stc4		Label for the cmb2 combo box
lst1		List box that displays the contents of the current drive or 
		folder
stc1		Label for the lst1 list box
edt1		Edit control that displays the name of the current file, or in 
		which the user can type the name of the file to open
stc3		Label for the edt1 edit control
cmb1		Drop-down combo box that displays the list of file type filters
stc2		Label for the cmb1 combo box
chx1		The read-only check box
IDOK		The OK command button (push button)
IDCANCEL	The Cancel command button (push button)
pshHelp	The Help command button (push button)"
 

"edt1" looks like the edit control that you want, and it's documented, so
Microsoft won't change it!  8-)

-John
John Young, Yaesu Musen Co., Ltd., Japan.
If only computers did what you wanted, not what you tell them.





| Вернуться в корень Архива |