Solved

Opening of  File folder from OnMouseDown event of Shape1 object

Posted on 2007-11-22
2
187 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
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: …

691 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