desktop, programs, etc. shortcut

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> I think I have a workaround for that [XP not creating EXE shortcuts].

Nope, what I tried failed miserably. :cry: XP = eXtra Problems.


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ricardo.
Nope, what I tried failed miserably. :cry: XP = eXtra Problems.
Thats why i want to write directly the lnk files.
My experience shows me that if i resolve some problem with a "trick" maybe it works on my machine or in some machines but will fail in many others.
I think that the cleanest solution is to write it directly from PB.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> Thats why i want to write directly the lnk files.

Yeah, I know. It'd definitely be safer.

But, thinking about it, the only difference between XP and all other
versions of Windows is that it doesn't allow EXEs to be added to the
Recent Documents menu... and in my experience this sort of thing is
just due to a simple Registry setting. If we could find this setting
and disable it... :)


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

I think the only right way is by using the IShellLink interface
for this.
With this interface you can set and get all possible stuff
in the Link file.

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

OK, i wrote a procedure now that creates a shortcut
by using the IShellLink interface (COM/OOP).

ATM it looks like this:

Code: Select all

CreateLink("D:\BASIC\PureBasic\purebasic.exe", "c:\pb.lnk", "my Description")
This creates a shortcut "PB.lnk" to my PureBasic.exe

But you cant only set the Description.
You can Set:

Code: Select all

- CommandLine Arguments
- Description
- HotKey
- Icon (in a file, with index)
- ShowCommand (Normal, Maximized, Minimized)
- Working Directory
Now i think that a command like

Code: Select all

[b]CreateLink("D:\purebasic.exe", "c:\pb.lnk", "Command Line", "Description", Hotkey, "...icon.ico",1, #SHOW_NORMAL, "Working Directory")[/b]
is simply too long.

What do you think about it ??

I think the best would be to use a structure, like:

Code: Select all

[b]
var.ShellLink
var\file$        = "D:\whatever\purebasic.exe"
var\link$        = "c:\PB.lnk"
var\Description$ = "Start PureBasic" ; this is the Tooltip
 
CreateLink(var)[/b]
With this method, you can GET a link easily with

Code: Select all

[b]GetLink("c:\my.lnk", var.ShellLink)[/b]
All members are filled then and you can change it
or do whatever you want with it.

Please tell me your opinion !!

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> What do you think about it ??

I prefer the longer command method, instead of structure.


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TronDoc.

how about a short version that omits all of the frills like this one: CreateLink("D:\BASIC\PureBasic\purebasic.exe", "c:\pb.lnk", "my Description")
and if you want all of the extra stuff have a structure method also ??? too much? just my 2 cents.. ..Joe

elecTRONics DOCtor
{registeredPB}P150 32Mb w98/DOS/Linux NO DirX NO IE :wink:
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Optionnals parameters have been created to avoid this case...

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ricardo.
Originally posted by Danilo

OK, i wrote a procedure now that creates a shortcut
by using the IShellLink interface (COM/OOP).
Excellent Danilo !!!

I think that the structure will be right, but both ways ar ok.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

> Optionnals parameters have been created to avoid this case...

How to use it with Procedures ??

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

I tough you have done a lib command :).

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ricardo.

Danilo, im waiting your code
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Ohhh... you need it NOW ??
Very urgent ??

cya,
...Danilo :)

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Sorry, i really dont have much time atm (work on weekend etc..)

So i wrote a small example now:
viewtopic.php?t=1971

I think you can modify this very easily
because the source is clean and easy to read.

Well, thats COM/OOP... :)

Sorry for not having much time atm!

cya,
...Danilo

(registered PureBasic user)
Post Reply