|  |  | 
|  | 
|  | 
|  Alfred
 Wagner
 | | Have one Problemchen with folgendem code CompileMarkSeparation
 ######################################################
Eine Verknüpfung anlegen
######################################################
Original von Andreas Miethe * Juli 2002
######################################################
Geändert von Alfred Wagner * April 2007
######################################################
Definitionen
DEF MultiByteToWideChar(6) ! Kernel32,MultiByteToWideChar
DEF CoInitialize(1)        ! OLE32,CoInitialize
DEF CoUnInitialize(0)      ! OLE32,CoUninitialize
DEF CoCreateInstance(5)    ! OLE32,CoCreateInstance
Konstanten
DEF &PShell_Release     8
DEF &PShell_SetDescription 28
DEF &PShell_SetWorkingDirectory 36
DEF &PShell_SetArguments 44
DEF &PShell_SetIconLocation 68
DEF &PShell_SetPath 80
DEF &PFile_Release 8
DEF &PFile_Save 24
globale Variablen
Declare CLSID_IShellLink#
Declare IID_IShellLink#
Declare IID_IPersistFile#
Proc CreateLink
    Declare Pshell&,PFile&,Command&
    Declare WideFile$
    Parameters Verknüpfung$,Datei$,Beschreibung$,Arbeitsordner$,Argumentenliste$,IconFile$,IconNo&
    Dim CLSID_IShellLink#,16
    Long CLSID_IShellLink#,0 = $00021401
    Word CLSID_IShellLink#,4 = $0000
    Word CLSID_IShellLink#,6 = $0000
    Byte CLSID_IShellLink#,8 = $C0
    Byte CLSID_IShellLink#,9 = $00
    Byte CLSID_IShellLink#,10 = $00
    Byte CLSID_IShellLink#,11 = $00
    Byte CLSID_IShellLink#,12 = $00
    Byte CLSID_IShellLink#,13 = $00
    Byte CLSID_IShellLink#,14 = $00
    Byte CLSID_IShellLink#,15 = $46
    Dim IID_IShellLink#,16
    Long IID_IShellLink#,0 = $000214EE
    Word IID_IShellLink#,4 = $0000
    Word IID_IShellLink#,6 = $0000
    Byte IID_IShellLink#,8 = $C0
    Byte IID_IShellLink#,9 = $00
    Byte IID_IShellLink#,10 = $00
    Byte IID_IShellLink#,11 = $00
    Byte IID_IShellLink#,12 = $00
    Byte IID_IShellLink#,13 = $00
    Byte IID_IShellLink#,14 = $00
    Byte IID_IShellLink#,15 = $46
    Dim IID_IPersistFile#,16
    Long IID_IPersistFile#,0 = $0000010b
    Word IID_IPersistFile#,4 = $0000
    Word IID_IPersistFile#,6 = $0000
    Byte IID_IPersistFile#,8 = $C0
    Byte IID_IPersistFile#,9 = $00
    Byte IID_IPersistFile#,10 = $00
    Byte IID_IPersistFile#,11 = $00
    Byte IID_IPersistFile#,12 = $00
    Byte IID_IPersistFile#,13 = $00
    Byte IID_IPersistFile#,14 = $00
    Byte IID_IPersistFile#,15 = $46
    CoInitialize(0)
    CoCreateInstance(CLSID_IShellLink#,0,1,IID_IShellLink#,Addr(PShell&))
    Command& = Long(Pshell&,0)
    CALL(LONG(COMMAND&,0),PShell&,IID_IPersistFile#,Addr(PFile&))QueryInterface ermitteln
    CALL(LONG(COMMAND&,&PShell_SetPath),PShell&,Addr(Datei$))Datei
    CALL(LONG(COMMAND&,&PShell_SetDescription),PShell&,Addr(Beschreibung$))Beschreibung
    CALL(LONG(COMMAND&,&PShell_SetWorkingDirectory),PShell&,Addr(Arbeitsordner$))Arbeits-Ordner
    CALL(LONG(COMMAND&,&PShell_SetArguments),PShell&,Addr(Argumentenliste$))Argumentenliste
    CALL(LONG(COMMAND&,&PShell_SetIconLocation),PShell&,Addr(IconFile$),IconNo&)IconLocation
    WideFile$ = Space$(Len(Verknüpfung$)*2)
    MultiByteToWideChar(0,1,addr(Verknüpfung$),-1,addr(WideFile$),Len(WideFile$))LinkFile umwandeln
    Command& = Long(PFile&,0)
    CALL(LONG(COMMAND&,&PFile_Save),PFile&,Addr(WideFile$),1)LinkFile speichern
    Command& = Long(PShell&,0)
    CALL(LONG(COMMAND&,&PShell_Release),PShell&)
    Command& = Long(PFile&,0)
    CALL(LONG(COMMAND&,&PFile_Release),PFile&)
    CoUnInitialize()
    Dispose CLSID_IShellLink#
    Dispose IID_IShellLink#
    Dispose IID_IPersistFile#
EndProc
DEF @GSFP(4) ! Shell32,SHGetSpecialFolderPathA
Declare Verknüpfung$,Datei$,Beschreibung$,Arbeitsordner$,Argumentenliste$,IconFile$,IconNo&,Inifile$
Def Home(0) Translate$(Upper$(Par$(0)),Upper$(FindFirst$(Par$(0))),)
IniFile$ = Home()+ Profan.exe
Proc Link_erstellen
    Datei$ = IniFile$
    Beschreibung$ =
    IconFile$ =
    IconNo& = 1
    Arbeitsordner$ =
    Argumentenliste$ =
    Verknüpfung$ = Space$(255)
    GSFP(0,ADDR(Verknüpfung$),2,0)Pfad zu Startmenü-Programme
    GSFP(0,ADDR(Verknüpfung$),5,0)Pfad zu Eigene Dateien
    GSFP(0,ADDR(Verknüpfung$),6,0)Pfad zu Favorieten
    GSFP(0,ADDR(Verknüpfung$),7,0)Pfad zu Autostart
    GSFP(0,ADDR(Verknüpfung$),8,0)Pfad zu Recent
    GSFP(0,ADDR(Verknüpfung$),9,0)Pfad zu Senden an
    GSFP(0,ADDR(Verknüpfung$),11,0)Pfad zu Startmenü
    GSFP(0,ADDR(Verknüpfung$),0,0)Pfad zu Desktop
    ***************  PROBLEM  ************************************************************************************
    Hier wird Hier sollte Profan stehen (oder was man sonst vor dem .lnk hinschreibt)
    unter das Icon auf dem Desktop geschrieben!
    Hat jemand eine Lösung wie Profan ohne das (+\Hier sollte Profan stehen.lnk) geschrieben werden kann?
    Verknüpfung$ = Trim$(Verknüpfung$)+\Hier sollte Profan stehen.lnk
    Problem ENDE
    Link anlegen
    CreateLink Verknüpfung$,Datei$,Beschreibung$,Arbeitsordner$,Argumentenliste$,IconFile$,IconNo&
Endproc
Link_erstellen
Cls
Print IniFile$ +
Verknüpfung der Profan.exe auf dem Desktop erstellen
Print
Print Bitte Beachten !
Print Das zu verknüpfende Programm muß sich im selben Ordner befinden wie
das ausführende (hier die Prfrun32.exe)
Print
Print Die Verknüpfung wird bei einem beliebigen Tastendruck wieder gelöscht
Waitinput
Link löschen
Assign #1, Verknüpfung$
Erase #1
End
functions correct only how can I the in the code angesprochene trouble solve?
 white someone council
 
 mfg.
 Alfred with family
 | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  | | If the trouble in the code is then write it time simply to go there - if it goes with something others Worten I the trouble in the Rem not really understand. | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  Alfred
 Wagner
 | | Hello IF 
 it deals itself under the Text under the Veknüpfung
 
 link$ = Trim$(link$)+\here ought to Profan stand.lnk
 
 How could one a Text under The link bring the from the File read becomes (means the name the File).
 
 thereabouts
 
 link$ = Trim$(link$)+\name$.lnk
 
 hope Have me verständlich framed (be no great writer)
 
 mfg.
 
 Alöfred with family
 | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  | | I mean I habs not yet kappiert. 
 Dou you mean
 
 name$=meinName
 link$ = Trim$(link$)+\+name$+.lnk
 
 ?
 | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  | | Übrigens - I had a couple Fehlerchen in Andreas seinem code found (no idea More which) and therefore a Shortcut-Unit built. I personally use therefore rather my Unit. 
 go too time into Profileinstellungen (supra right green Popupmenü) and schreib in your Signatur the OS and the XProfanVersion. the having we here so angewöhnt.
  | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  Alfred
 Wagner
 | | 
 I mean I habs not yet kappiert.
 
 Dou you mean
 
 name$=meinName
 link$ = Trim$(link$)+\+name$+.lnk
 
 Yes very IF the wars THANK YOU
 sorry my late response (Have it first not so correctly. überissen!)
 
 mfg
 
 Alfred with family
 | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 |