phpbar.de logo

Mailinglisten-Archive

[php] Windows .lnk erzeugen

[php] Windows .lnk erzeugen

Boris Penck php_(at)_phpcenter.de
Wed, 16 May 2001 12:56:02 +0200


> Mit PHP wirst DU wohl keine Chance haben. Oder hat PHP Zugriff auf die API
> von Windows ?

Wieso ICH ?
Ich habe bereits schon einen g�ltigen Header, Footer und mit welchem
Programm
es aufgreufen wird, das Problem ist jetzt noch die Pfadangabe, weil deren
L�nge doch
sehr Variabel ist, hier meine bisherigen Funktionen f�r Windows Shortcuts
... Achtung
funktioniert noch nicht ohne einen g�ltigen Link  :

function lnkHeader() {

 // magic L
 $header  = pack("ssss", 0x4C, 0x0, 0x0, 0x0);

 // GUID of shortcut files
 $header .= pack("ssss", 0x1, 0x4, 0x2, 0x0);
 $header .= pack("ssss", 0x0, 0x0, 0x0, 0x0);
 $header .= pack("ssss", 0xC0, 0x0, 0x0, 0x0);
 $header .= pack("ssss", 0x0, 0x0, 0x0, 0x46);

 // flags
 $header .= pack("ssss", 0x81, 0x0, 0x0, 0x0);

 // file attributes => Archive
 $header .= pack("ssss", 0x10, 0x0, 0x0, 0x0);

 // time 1
 $header .= pack("ssss", 0xC0, 0x0E, 0x82, 0xD5);
 $header .= pack("ssss", 0xC1, 0x20, 0xBE, 0x1);

 // time 2
 $header .= pack("ssss", 0x0, 0x8, 0xBF, 0x46);
 $header .= pack("ssss", 0xD5, 0x20, 0xBE, 0x1);

 // time 3
 $header .= pack("ssss", 0x0, 0x47, 0xAA, 0xEC);
 $header .= pack("ssss", 0xEC, 0x15, 0xBE, 0x1);

 // file lenght => 0 for an directory
 $header .= pack("ssss", 0x0, 0x0, 0x0, 0x0);

 // icon => 0 Folder Icon
 $header .= pack("ssss", 0x5, 0x0, 0x0, 0x0);

 // normal window => 1
 $header .= pack("ssss", 0x1, 0x0, 0x0, 0x0);

 // hotkey => we dont want any => 0
 $header .= pack("ssss", 0x0, 0x0, 0x0, 0x0);

 // free lines => reason unknown => must be microsoft :)
 $header .= pack("ssss", 0x0, 0x0, 0x0, 0x0);
 $header .= pack("ssss", 0x0, 0x0, 0x0, 0x0);

 return $header;
}

function lnkFooter() {
 $footer = pack("ssss", 0x0, 0x0, 0x0, 0x0);
 return $footer;
}

function lnkCommandLine() {
 $comline = pack("ss", 0x6, 0x0);
 $comline .= pack("ssssss", 0x2F, 0x63, 0x6C, 0x6F, 0x73, 0x65);
 $comline .= pack("ss", 0x15, 0x0);
 // open with: C:\WINNT\explorer
 $comline .= pack("sssssss", 0x43, 0x3A, 0x5C, 0x57, 0x49, 0x4E, 0x4E);
 $comline .= pack("sssssss", 0x54, 0x5C, 0x65, 0x78, 0x70, 0x6C, 0x6F);
 $comline .= pack("sssssss", 0x72, 0x65, 0x72, 0x2E, 0x65, 0x78, 0x65);
 return $comline;
}

Soweit so gut, ist schon einen basis. Der rest wird auch noch gehen




php::bar PHP Wiki   -   Listenarchive