?
Solved

Problem with OpenDialog component: ofEnableIncludeNotify property and IncludeItem event

Posted on 2004-09-01
2
Medium Priority
?
543 Views
Last Modified: 2010-04-04
How to make the event IncludeItem of TOpenDialog work?

I have set the ofEnableIncludeNotify property to true and written this code.......

procedure TForm1.OpenDialog1IncludeItem(const OFN: TOFNotifyEx;
  var Include: Boolean);
begin
 Include:=False;
end;

However, still all files are displayed when I execute the OpenDialog. The above code does get trigerred for every file, but soemhow the Include variable has no effect.

I know it is a bug in Microsoft implementation, (plenty of websites on internet refer to this)........... but does anyone know of a work around?

I am using Delphi 7 on Windows XP. Application deployment would be on Windows 2000 & XP, XP SP1, XPSP2 machines.
0
Comment
Question by:GSPannu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
vadim_ti earned 2000 total points
ID: 11956404
It is not exactly what you want, but may be you can apply
filter. In this sample only
a.*
b.*
*.tiff
files will be displayed.


procedure TForm1.Button1Click(Sender: TObject);
var
  ofn:tagOFNA;
  szFile: array [0..260] of char;
begin
  inherited;

FillChar(ofn, sizeof(tagOFNA), 0);
ofn.lStructSize := sizeof(tagOFNA);
ofn.hwndOwner := handle;
ofn.lpstrFile := szFile;
ofn.lpstrFile[0] := #0;
ofn.nMaxFile := sizeof(szFile);
ofn.lpstrFilter := 'My Files'#0'a*.*;b*.*;*.tiff'#0;
ofn.nFilterIndex := 1;
ofn.lpstrFileTitle := nil;
ofn.nMaxFileTitle := 0;
ofn.lpstrInitialDir := nil;
ofn.Flags := OFN_PATHMUSTEXIST or OFN_FILEMUSTEXIST or OFN_EXPLORER ;
  GetOpenFileName(ofn);
end;
0
 

Author Comment

by:GSPannu
ID: 11961670
Dear Vadim,

Thank you for your quick response.

Could you email me (guru.pannu@pri.co.uk) a complete Delphi project (.pas, .dfm, .dpr) explaining what you have just written?

I haven't been able to understand your answer fully.

Thx. Guru
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question