Solved

Opening of  File folder from OnMouseDown event of Shape1 object

Posted on 2007-11-22
2
182 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
2 Comments
 

Author Comment

by:pr2501
Comment Utility


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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now