 |
|
|
|
| Author |
Message |
Rick
Joined: 04 Oct 2007 Posts: 90
|
Posted: Wed Dec 22, 2004 11:39 am Post subject: API to modify OR create desktop short cut. |
|
|
I have an Access database that I have converted to an MDE. I have a bunch of
users all over the place who use this DB via a desktop short cut.
In an effort to stream line the transition I am hoping to find an API that
will save me (or someone else) from having to go to every location the
database is used, and create a new shortcut simply changing the "B" to an "E"
in the shortcuts "target".
There are several options that I see as having different problems depending
on which are even possible.
1. Somehow programmatically finding and identifying the short cut (or *.ico
file) on the desk top that contains the name of my database in the "target"
property, reading that string and simply replacing the "d" with an "e". This
seems the best, IF it is even possible because there are several different
variations of this shortcut in existence since some of the users already had
access runtime on their machines, some have full blown access, and for other
reasons the path to the msaccess.exe is varied.
2. COPY their existing Icon somehow, replacing the "d" with an "e", actually
now that I think about it if this is possible the above is possible.
3. Simply writing something that adds a short cut and removes the old,
assuming that this will work for some but not all users, then manually fixing
the ones that don't.
Anyone have any suggestions? In the mean time I will have my nose in
Applemans!!
Rick
Archived from group: microsoft>public>vb>winapi |
|
| Back to top |
|
 |
alpine
Joined: 04 Oct 2007 Posts: 620
|
Posted: Wed Dec 22, 2004 1:52 pm Post subject: Re: API to modify OR create desktop short cut. |
|
|
On Wed, 22 Dec 2004 06:39:11 -0800, "Rick"
wrote:
>I have an Access database that I have converted to an MDE. I have a bunch of
>users all over the place who use this DB via a desktop short cut.
>
>In an effort to stream line the transition I am hoping to find an API that
>will save me (or someone else) from having to go to every location the
>database is used, and create a new shortcut simply changing the "B" to an "E"
>in the shortcuts "target".
>
>There are several options that I see as having different problems depending
>on which are even possible.
>
>1. Somehow programmatically finding and identifying the short cut (or *.ico
>file) on the desk top that contains the name of my database in the "target"
>property, reading that string and simply replacing the "d" with an "e". This
>seems the best, IF it is even possible because there are several different
>variations of this shortcut in existence since some of the users already had
>access runtime on their machines, some have full blown access, and for other
>reasons the path to the msaccess.exe is varied.
>
>2. COPY their existing Icon somehow, replacing the "d" with an "e", actually
>now that I think about it if this is possible the above is possible.
>
>3. Simply writing something that adds a short cut and removes the old,
>assuming that this will work for some but not all users, then manually fixing
>the ones that don't.
>
>Anyone have any suggestions? In the mean time I will have my nose in
>Applemans!!
>
>Rick
Have a look at the IShellLnk example project that came on your VB6 CD.
HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas |
|
| Back to top |
|
 |
Rick
Joined: 04 Oct 2007 Posts: 90
|
Posted: Wed Dec 22, 2004 1:23 pm Post subject: Re: API to modify OR create desktop short cut. |
|
|
I have the Interdev 6.0 Pro CD set, Could it be called something different? I
assume this set has VB6, it has a bunch of samples, but none named that??? I
should have a VB6 Pro disk around here SOMEWHERE!
Thanks!
"alpine" wrote:
> On Wed, 22 Dec 2004 06:39:11 -0800, "Rick"
> wrote:
>
> >I have an Access database that I have converted to an MDE. I have a bunch of
> >users all over the place who use this DB via a desktop short cut.
> >
> >In an effort to stream line the transition I am hoping to find an API that
> >will save me (or someone else) from having to go to every location the
> >database is used, and create a new shortcut simply changing the "B" to an "E"
> >in the shortcuts "target".
> >
> >There are several options that I see as having different problems depending
> >on which are even possible.
> >
> >1. Somehow programmatically finding and identifying the short cut (or *.ico
> >file) on the desk top that contains the name of my database in the "target"
> >property, reading that string and simply replacing the "d" with an "e". This
> >seems the best, IF it is even possible because there are several different
> >variations of this shortcut in existence since some of the users already had
> >access runtime on their machines, some have full blown access, and for other
> >reasons the path to the msaccess.exe is varied.
> >
> >2. COPY their existing Icon somehow, replacing the "d" with an "e", actually
> >now that I think about it if this is possible the above is possible.
> >
> >3. Simply writing something that adds a short cut and removes the old,
> >assuming that this will work for some but not all users, then manually fixing
> >the ones that don't.
> >
> >Anyone have any suggestions? In the mean time I will have my nose in
> >Applemans!!
> >
> >Rick
>
>
> Have a look at the IShellLnk example project that came on your VB6 CD.
>
> HTH,
> Bryan
> ____________________________________________________________
> New Vision Software "When the going gets weird,"
> Bryan Stafford "the weird turn pro."
> alpine_don'tsendspam@mvps.org Hunter S. Thompson -
> Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
> |
|
| Back to top |
|
 |
mr unreliable
Joined: 04 Oct 2007 Posts: 64
|
Posted: Wed Dec 22, 2004 11:15 pm Post subject: Re: API to modify OR create desktop short cut. |
|
|
hi Rick,
If you have scripting (v5.6) installed, you can use that.
It's simple to use, and doesn't require any api's.
You need to set a reference to wshom.ocx, listed in the references
dialog box as: "Windows Script Host Object Model"
--- ---
Dim wshShell As New wshShell
Private Sub Form_Load()
Dim strDesktop As String
Dim oShellLink As Object
Dim oURLLink As Object
' create app shortcut...
strDesktop = wshShell.SpecialFolders("Desktop")
Set oShellLink = wshShell.CreateShortcut(strDesktop & "\Launch
myApp.lnk")
oShellLink.TargetPath = "c:\myFolder\myApp.exe"
oShellLink.WindowStyle = wshNormalFocus ' from enum wshWindowStyle
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = "progman.exe, 4"
oShellLink.Description = "Launch myApp"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
' also, create URL-type shortcut...
Set oURLLink = wshShell.CreateShortcut(strDesktop & "\Microsoft Web
Site.url")
oURLLink.TargetPath = "http://www.microsoft.com"
oURLLink.Save
End Sub
--- ---
Note: to MODIFY an existing shortcut, you use "CreateShortcut",
giving it the path to an existing shortcut.
cheers, jw
"Rick" wrote in message@microsoft.com...
> Anyone have any suggestions? |
|
| Back to top |
|
 |
mayayana
Joined: 04 Oct 2007 Posts: 110
|
Posted: Thu Dec 23, 2004 9:12 am Post subject: Re: API to modify OR create desktop short cut. |
|
|
I have VS, which I think came with Interdev,
but I've never figured out what it is! I had the
impression that it was some sort of half-baked
DHTML editor for IE. In any case, I don't think
VB is with that.
The SHELLLNK project is in Tools\Unsupported
on the VB6 CD. It's a small sample project with
a 5 KB SHELLLNK.TLB that also needs to be
referenced.
Oddly enough, there's also LNK functionality
in VB6STKIT.DLL, the setup library that
the PDW uses to make links. It's got two
functions: fCreateShellLink and
fRemoveShellLink
The former is used in the PDW Setup1 project
code, found in the VB Wizards\PDWizard folder.
Aside from the setup1 code, though, I've never
seen any documentation for those functions.
--
_____________________________
mayayXXana1a@mindYYspring.com
For return email remove XX and YY.
_____________________________
Rick wrote in message@microsoft.com...
> I have the Interdev 6.0 Pro CD set, Could it be called something
different? I
> assume this set has VB6, it has a bunch of samples, but none named that???
I
> should have a VB6 Pro disk around here SOMEWHERE!
>
> Thanks!
>
> "alpine" wrote:
>
> > On Wed, 22 Dec 2004 06:39:11 -0800, "Rick"
> > wrote:
> >
> > >I have an Access database that I have converted to an MDE. I have a
bunch of
> > >users all over the place who use this DB via a desktop short cut.
> > >
> > >In an effort to stream line the transition I am hoping to find an API
that
> > >will save me (or someone else) from having to go to every location the
> > >database is used, and create a new shortcut simply changing the "B" to
an "E"
> > >in the shortcuts "target".
> > >
> > >There are several options that I see as having different problems
depending
> > >on which are even possible.
> > >
> > >1. Somehow programmatically finding and identifying the short cut (or
*.ico
> > >file) on the desk top that contains the name of my database in the
"target"
> > >property, reading that string and simply replacing the "d" with an "e".
This
> > >seems the best, IF it is even possible because there are several
different
> > >variations of this shortcut in existence since some of the users
already had
> > >access runtime on their machines, some have full blown access, and for
other
> > >reasons the path to the msaccess.exe is varied.
> > >
> > >2. COPY their existing Icon somehow, replacing the "d" with an "e",
actually
> > >now that I think about it if this is possible the above is possible.
> > >
> > >3. Simply writing something that adds a short cut and removes the old,
> > >assuming that this will work for some but not all users, then manually
fixing
> > >the ones that don't.
> > >
> > >Anyone have any suggestions? In the mean time I will have my nose in
> > >Applemans!!
> > >
> > >Rick
> >
> >
> > Have a look at the IShellLnk example project that came on your VB6 CD.
> >
> > HTH,
> > Bryan
> > ____________________________________________________________
> > New Vision Software "When the going gets weird,"
> > Bryan Stafford "the weird turn pro."
> > alpine_don'tsendspam@mvps.org Hunter S. Thompson -
> > Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
> > |
|
| Back to top |
|
 |
Rick
Joined: 04 Oct 2007 Posts: 90
|
Posted: Thu Dec 23, 2004 12:45 pm Post subject: Re: API to modify OR create desktop short cut. |
|
|
I am not sure if this will work for me. One of the reasons I was looking
straight at API was I am actually trying to do this via Access 97. I figured
that if it would work via VB it would work via Access (API anyway). My
intent was to embed the code in my database in a way that when the user used
the DB it would change the existing short cut on their desk top then notify
them that they needed to re launch.
The code you provided does look interesting though I will be very curious to
play with it!
Thanks.
Rick
"mr unreliable" wrote:
> hi Rick,
>
> If you have scripting (v5.6) installed, you can use that.
>
> It's simple to use, and doesn't require any api's.
>
> You need to set a reference to wshom.ocx, listed in the references
> dialog box as: "Windows Script Host Object Model"
>
> --- ---
> Dim wshShell As New wshShell
>
> Private Sub Form_Load()
> Dim strDesktop As String
> Dim oShellLink As Object
> Dim oURLLink As Object
>
> ' create app shortcut...
> strDesktop = wshShell.SpecialFolders("Desktop")
> Set oShellLink = wshShell.CreateShortcut(strDesktop & "\Launch
> myApp.lnk")
> oShellLink.TargetPath = "c:\myFolder\myApp.exe"
> oShellLink.WindowStyle = wshNormalFocus ' from enum wshWindowStyle
> oShellLink.Hotkey = "CTRL+SHIFT+F"
> oShellLink.IconLocation = "progman.exe, 4"
> oShellLink.Description = "Launch myApp"
> oShellLink.WorkingDirectory = strDesktop
> oShellLink.Save
>
> ' also, create URL-type shortcut...
> Set oURLLink = wshShell.CreateShortcut(strDesktop & "\Microsoft Web
> Site.url")
> oURLLink.TargetPath = "http://www.microsoft.com"
> oURLLink.Save
>
> End Sub
> --- ---
>
> Note: to MODIFY an existing shortcut, you use "CreateShortcut",
> giving it the path to an existing shortcut.
>
> cheers, jw
>
> "Rick" wrote in message
> @microsoft.com...
> > Anyone have any suggestions?
>
>
>
|
|
| Back to top |
|
 |
|
|
| Related Topics: | How do I create ShortCut on Desktop and a ShortCut on a Prog Hello Everyone: I would like to know how would I create shortcut on desktop and a shortcut on a program group I already tried using Windows Scripting Host Object model and I need to kow another way of accomplishing the task. An exe wi
short name for non-8dot3 file in win 2000 Hi, How to get the short name generated for non-8dot3 file names using VB? thanx
Please help to modify lParam Hi all. (Using VB6) I am tinkering with Subclassing. I have hooked into a window and am monitoring the lParam when the mouse is moving. I have found two functions for extracting the individual X and Y when the lParam is passed to them, they are:- Public
Get and modify proxy settings in IE Hi, I want to modify the proxy settings from IE when my program starts (it's a proxy server), then switch back to the old settings. The registry value for the LAN proxy is easy to get, but the dial-up settings are more complicated. They are stored under t
How to modify Date folder Hello, I want to modify the date of folders into VB 5 ou VB6 Is it possible ? Thanks Jean-Claude Click here to answer / cliquez ci dessous pour me repondre |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|