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 open a TOpenDialog in detail view 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
10-Jan-03
Category
Dialogs
Language
Delphi 2.x
Views
201
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Lou Adler

I use the standard OpenDialog to select a file to open. To see the creation date of 
a file, I have to change the view to Details (in fact my preferred view) every 
time. I was looking for an attribute (in the Options) to configure, that always 
detail view is selected when the OpenDialog is activated. However I didn't find 
anything. Does somebody have a hint for this problem?

Answer:

Add this code to the OnFolderChange event of the dialog:
1   
2   procedure TForm1.OpenDialog1FolderChange(Sender: TObject);
3   var
4     H, H2: THandle;
5   begin
6     H := FindWindowEx(GetParent(OpenDialog1.Handle), 0, PChar('SHELLDLL_DefView'), 
7   nil);
8     H2 := FindWindowEx(H, 0, PChar('SysListView32'), nil);
9     if (H <> 0) and (H2 <> 0) then
10    begin
11      SendMessage(H, WM_COMMAND, $702C, 0);
12      Windows.SetFocus(H2);
13      PostMessage(H2, WM_KEYDOWN, VK_SPACE, 0);
14    end;
15  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