2008. január 18., péntek
How to get the control identifier of Windows dialogs
Problem/Question/Abstract:
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:
{ ... }
var
MyText: string;
begin
MyText := 'Hello!';
SendMessage(Windows.GetParent(Self.Handle), CDM_SETCONTROLTEXT,
1152, Integer(PChar(MyText)));
{ ... }
Feliratkozás:
Megjegyzések küldése (Atom)
Nincsenek megjegyzések:
Megjegyzés küldése