Author: Jonas Bilinkevicius
How can I get the identifier of a given control, which is part of a predefined
windows dialog such as open/ save dialogs? I need to alter text in the edit control
and/ or alter captions on buttons before the dialog closes. Can this be
accomplished with API calls and/ or messages to the dialog in question?
Answer:
With WinSight for example. Anyway, there are some of them (Open/ Save dialog
controls ID's):
"Look in" - ID 1137 , classname "ComboBox"
"Files of type" - ID 1136 , classname "ComboBox"
"File Name" - ID 1152 , classname "Edit"
"Help" - ID 1038 , classname "Button"
"Open" - ID 1 , classname "Button"
"Cancel" - ID 2 , classname "Button"
"Open as Read only" - ID 1040 , classname "Button"
The usage - for example, to alert the text of "File name" Edit - is like this:
1 { ... }2 var3 MyText: string;
4 begin5 MyText := 'Hello!';
6 SendMessage(Windows.GetParent(Self.Handle), CDM_SETCONTROLTEXT,
7 1152, Integer(PChar(MyText)));
8 { ... }