Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to change standard Windows dialogs Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
18-Oct-03
Category
Dialogs
Language
Delphi 3.x
Views
302
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Igor Siticov

How to change text like "File name:", "File Type" and buttons' text in standard 
Windows dialogs?

Answer:

Some times we need to replace some text or something other in standard Windows 
Open/Save dialogs. Unfortunately, Delphi's dialogs components don't provide the 
access to all controls placed on Windows common dialogs. But we can perform this 
using Windows API. 

Example below demonstrates the changing all embedded text controls in Open dialog. 

First, we need to determine identifiers of dialog's controls, they are following: 

1   const
2     // LB_FOLDERS_ID = 65535;
3     LB_FILETYPES_ID = 1089; // "File types:" label
4     LB_FILENAME_ID = 1090; // "File name:" label
5     LB_DRIVES_ID = 1091; // "Look in:" label
6   
7   Second, we need to send message to dialog window for changing necessary controls, 
8   something like following: 
9   
10  procedure TForm1.OpenDialog1Show(Sender: TObject);
11  const
12    // LB_FOLDERS_ID = 65535;
13    LB_FILETYPES_ID = 1089;
14    LB_FILENAME_ID = 1090;
15    LB_DRIVES_ID = 1091;
16    Str1 = 'Four';
17    Str2 = 'Five';
18    Str3 = 'One';
19    Str4 = 'Two';
20    Str5 = 'Three';
21  begin
22    SendMessage(GetParent(OpenDialog1.Handle), CDM_SETCONTROLTEXT, IDOK,
23      LongInt(Pchar(Str1)));
24    SendMessage(GetParent(OpenDialog1.Handle), CDM_SETCONTROLTEXT, IDCANCEL,
25      LongInt(Pchar(Str2)));
26    SendMessage(GetParent(OpenDialog1.Handle), CDM_SETCONTROLTEXT, LB_FILETYPES_ID,
27      LongInt(Pchar(Str3)));
28    SendMessage(GetParent(OpenDialog1.Handle), CDM_SETCONTROLTEXT, LB_FILENAME_ID,
29      LongInt(Pchar(Str4)));
30    SendMessage(GetParent(OpenDialog1.Handle), CDM_SETCONTROLTEXT, LB_DRIVES_ID,
31      LongInt(Pchar(Str5)));
32  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC