Solved

Opening of  File folder from OnMouseDown event of Shape1 object

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Save pdf file to other location 3 79
Sending Gmail through Delphi 3 91
Reconfigure Delphi Install? 2 45
Base1 Encode/Decode 3 67
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…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

930 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

11 Experts available now in Live!

Get 1:1 Help Now