Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > Apps

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-28-2011, 05:10 PM
robinhickman robinhickman is offline
Junior Member
 
Join Date: Sep 2011
Posts: 2
Question Can a Delphi app "see" what drive opened it via Autoplay?

I am working on an app for my photography studio that manages image files. I have set Autoplay to open the app (I used TweakUI to add my app to the list in Windows) when a card is inserted into the card reader. Since I have several card readers attached, I would like to know which drive activated the app so it can start processing the right files without user input to select the correct drive. I am using Delphi 7 on Windows XP Pro SP3.

Thanks!!
Reply With Quote
  #2  
Old 11-01-2011, 04:16 PM
dj_sherbu dj_sherbu is offline
Junior Member
 
Join Date: Nov 2007
Posts: 19
Default

Can you use TweakUI to add a shortcut to the app to the autoplay list, instead of the main application exe?
If yes, the you can use a shortcut with a parameter to launch the main exe. The paramater will be the letter of the drive.
The downside of this solution is that you will have to create a shotcut for each card reader.

A tutorial on how to pass parameters to delphi apps can be found here. it works, i've tested it.

Passing a parameter to an app using a shortcut is done with a line like this:
"C:\Program Files\MyFolder\myapp.exe" -parameter
(this should be in the "Target" field from the shortcuts properties)
Reply With Quote
  #3  
Old 11-01-2011, 04:21 PM
robinhickman robinhickman is offline
Junior Member
 
Join Date: Sep 2011
Posts: 2
Default

Thanks, I'll give that a try. It sounds like it should work. Appreciate it!!
Reply With Quote
Reply

Tags
autoplay

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:15 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.