Solved

Opening of  File folder from OnMouseDown event of Shape1 object

Posted on 2007-11-22
2
186 Views
Last Modified: 2010-04-05
I would like to make a form with picture in backraund. And on this picture i'll have same shapes which will connect me to defined folders when it would be clicked on the shapes.

Thank you




For example would like to open folder :  D:\pc1Lo
 from the event OnMouseDown kliking on shape1.
0
Comment
Question by:pr2501
[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
 

Author Comment

by:pr2501
ID: 20337679


For example would like to open folder :  D:\pc1Lo

 from the event OnMouseDown kliking on shape1.
0
 
LVL 19

Accepted Solution

by:
MerijnB earned 125 total points
ID: 20337798
see attached example:
uses ShellAPI;
 
{$R *.dfm}
 
procedure OpenFolder(FolderName: string);
begin
 Screen.Cursor := crHourGlass;
 
 try
  ShellExecute(0, 'open', PChar(FolderName), '', '', SW_SHOWNORMAL);
 finally
  Screen.Cursor := crDefault;
 end;
end;
 
procedure TForm2.Shape1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 OpenFolder('D:\pc1Lo');
end;

Open in new window

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Intraweb download file link ? 1 167
Strange behavior when a form is closed 6 69
How to debug For loops? 3 63
tidtcpserver connection lost handle 2 110
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
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