Page 2 of 2

Posted: Wed Aug 28, 2002 1:25 am
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

Posted: Wed Aug 28, 2002 2:23 am
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.

Posted: Wed Aug 28, 2002 2:28 am
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

Posted: Wed Aug 28, 2002 5:12 am
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)

Posted: Wed Aug 28, 2002 9:57 am
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)

Posted: Wed Aug 28, 2002 10:05 am
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

Posted: Wed Aug 28, 2002 10:25 am
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:

Posted: Wed Aug 28, 2002 1:28 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

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

Fred - AlphaSND

Posted: Wed Aug 28, 2002 4:13 pm
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.

Posted: Wed Aug 28, 2002 7:38 pm
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)

Posted: Wed Aug 28, 2002 9:16 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

I tough you have done a lib command :).

Fred - AlphaSND

Posted: Thu Aug 29, 2002 6:22 pm
by BackupUser
Restored from previous forum. Originally posted by ricardo.

Danilo, im waiting your code

Posted: Fri Aug 30, 2002 7:43 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

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

cya,
...Danilo :)

(registered PureBasic user)

Posted: Sat Aug 31, 2002 11:20 am
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)