Click to See Complete Forum and Search --> : Update 'Start in' for the Icon


sgg245
October 11th, 2006, 02:29 AM
When an application is running, I provide a path. Now this path should be set for 'Start in' property of the icon from which this is application is being run.

Suppose,
I have shortcut X.lnk on the desktop. I double-click to run an application A.exe with data folder as C:\data.

But now the user changes X.lnk name as Y.lnk

Now when the application is running, thru some interface I provide new data folder.

I need to updata 'Start in' value as new data folder provided for the icon Y.lnk on the desktop.

kirants
October 12th, 2006, 12:12 AM
It is not clear what you are trying to do. At one time you say, you provide a path when the application is running and again you say, the path is set in 'Start In' .

Again, you talk of some interface. What is this interface ? Please explain the current situation and how you would like it to work clearly.

sgg245
October 12th, 2006, 11:45 PM
It is not clear what you are trying to do. At one time you say, you provide a path when the application is running and again you say, the path is set in 'Start In' .

Again, you talk of some interface. What is this interface ? Please explain the current situation and how you would like it to work clearly.


I have an application which has following details:
Exe stored at path d:\wm\wm.exe
Data stored path d:\data

I have an icon of my wm.exe on the desktop, say wmrun.lnk
The "Start in" property of this icon will be d:\data.

Now I run my application by double-clicking on wmrun.lnk
Application starts and I hav an interface which prompts for entering new data folder.
I enter data folder = e:\datawm and press OK on this dialog.

On pressing OK, my program should detect from which icon this application has been started. After getting the icon name, it should update the "Start in" property of the application icon from "d:\data" to "e:\datawm".

I think this should be clear and explanatory.
Hoping for an early response & solution.
Thanx.

kirants
October 13th, 2006, 12:11 AM
are you sure you want to use the Start In for that ? Do you have a registry location for your software settings ?

sgg245
October 13th, 2006, 12:20 AM
are you sure you want to use the Start In for that ? Do you have a registry location for your software settings ?

Yes, I want to update "Start in" property of the icon by detecting from which icon the application has been started.

I do have registry entry for my application. But wat I have observed that
for my icon wm.lnk on the desktop, if I change the "Start in" property by right-click -> properties (i.e. manually) the value of the parameter (data location of the application) in the registry is not updated.

Can u guide me more on this line / information??
Thanx in advance.

kirants
October 13th, 2006, 12:32 AM
Yes, I want to update "Start in" property of the icon by detecting from which icon the application has been started.

Not to be argumentative. But are you sure this is what you want ? i.e. shortcuts to the same application from different locations have different behavior ? Wouldn't it be confusing for the user ?

I do have registry entry for my application.
Where is it ? Is it under HKEY_CURRENT_USER\SOFTWARE\[YourCompany]\[something] ?

the value of the parameter (data location of the application) in the registry is not updated.
What parameter ? Is it a registry value you maintain for the data location ? Note that updating the .lnk does not do any changes to your application registry. Windows is simply not aware of this relation to do anything like that.

sgg245
October 13th, 2006, 01:32 AM
Not to be argumentative. But are you sure this is what you want ? i.e. shortcuts to the same application from different locations have different behavior ? Wouldn't it be confusing for the user ?


Where is it ? Is it under HKEY_CURRENT_USER\SOFTWARE\[YourCompany]\[something] ?


What parameter ? Is it a registry value you maintain for the data location ? Note that updating the .lnk does not do any changes to your application registry. Windows is simply not aware of this relation to do anything like that.

Dont get confused. I dont want to create another icon of same application with different data folder on the desktop. I just want to updated existing icons "Start in" property.

But before updating i need to know the name of the icon from which is application has been started.

kirants
October 13th, 2006, 01:42 AM
got it. But isn't it better to have a registry setting to store the location of data ? Your application would then read and write to the registry location rather than the shortcut.

kirants
October 13th, 2006, 01:57 AM
BTW, you can still do this, though I would recommend a shortcut-update independent method.

See here:
http://www.codeguru.com/cpp/com-tech/shell/article.php/c1337__1