Solved

Problem with OpenDialog component: ofEnableIncludeNotify property and IncludeItem event

Posted on 2004-09-01
2
534 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 500 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

Technology Partners: 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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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