English
Source / code snippets

Desktop find Knownfolders Knownfoldersid Ole Ole32 Ordner Special Vista windows

 

Nico
Madysa

CompileMarkSeparation
' gilt ab Windows Vista oder höher
declare Long hShell32, hOle32

proc Init

    hOle32 = ImportDLL("OLE32", "ole.")
    hShell32 = ImportDLL("SHELL32", "shell.")
    ole.CoInitialize(0)

endproc

proc Exit

    ole.CoUnInitialize()
    FreeDLL hOle32
    FreeDLL hShell32

endproc

proc GetCurrentDesktopPath

    declare String KnownFoldersID_Desktop, Long pPath, String desktopPath
    /* Die KnownFolders IDs stehen (mehr oder weniger in Klartext)
    in Microsofts knownfolders.h Headerdatei. Es sind nichts
    Anderes als ein Haufen 16 Byte lange Konstanten. Aus
    ihnen wiederum können die Pfade der verschiedensten
    speziellen Ordner bezogen werden, selbst wenn diese vom
    Nutzer verschoben worden sind.                              */
    KnownFoldersID_Desktop = "\x3A\xCC\xBF\xB4\x2C\xDB\x4C\x42\xB0\x29\x7F\xE9\x9A\x87\xC6\x41"
    shell.SHGetKnownFolderPath(Addr(KnownFoldersID_Desktop), 0, 0, Addr(pPath))
    ' Die obige Funktion hat uns die Adresse eines neu
    ' erzeugten Strings gegeben. Wir basteln daraus
    ' wieder einen XProfan-String.
    desktopPath = StringW$(pPath, 0)
    ole.CoTaskMemFree(pPath)
    return desktopPath

endproc

cls
Init()
print GetCurrentDesktopPath()
Exit()
waitinput
end
 
02/28/14  
 




Jörg
Sellmeyer
for which Windowsversion counts the? with XP I get a Error Message, that The function shell.SHGetKnownFolderPath uncharted is.
Also is the Variable hShell32 not declared. For this becomes hUser32 not uses...

at least XP goes it so integrally easy:
CompileMarkSeparation
Def Desktop(0) ReadIni$("Hkey_1","Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")
Print Desktop()
waitinputre>
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
02/28/14  
 




Nico
Madysa
Jörg Sellmeyer (28.02.14)

for which Windowsversion counts the? with XP I get a Error Message, that The function shell.SHGetKnownFolderPath uncharted is.


ex windows 7 geht's what about me have none reason anzunehmen, that it under Vista works. have time "ab windows Vista" added.

Jörg Sellmeyer (28.02.14)

Also is the Variable hShell32 not declared. For this becomes hUser32 not uses...


my Error. Variable was wrong declared, hab's korrigiert. was already late, as i so rumgefummelt having.

Jörg Sellmeyer (28.02.14)

at least XP goes it so integrally easy:


be over these "Known Folders" thing in the MSDN stumbled and it has whom appearance, that the The of M$ bevorzugte method is, these special Paths abzugreifen.

One Blogartikel of 2003 [...]  declared, that the "Shell-Folders"-Registry-Key only from Kompatibilitätsgründen with irgendwelchen obskuren Programs from 1994 existing and not any more uses go ought to.
The function SHGetSpecialFolderLocation , The therein instead suggested becomes, is in the meantime over again  abgelöst been, and of course of SHGetKnownFolderPath  [...] , the function, The I supra uses have.

If I The Ressourcen to the Topic correctly. understood have, has the Registryschlüssel "Shell Folders" under windows presently about whom status, whom Add-, Sub- and the others antiquated functions in XProfan 10 had. whether You it moreover verwendest, is nevertheless your thing.
 
02/28/14  
 




Michael
Wodrich
probably has eachone Microsoft-colleagues there its Own routine. God Thanks are The not any so mitteilsam How a few ...
there had really a only Possibility fully ausgereicht. now white one again not, which the many Opportunities one benefit ought to.

your Fundstück runs on one Vista Ultimate integrally inspired.

the would Yes again Zündstoff for Forums:
- instead of: which Programming-Language is the best....
- simply: which SpecialFolder-routine ought to one prefer....

(is you incidentally already time noticed: Diejenigen, The these question to put dive then into subesquent 10.000 Postings not any more on...

Greeting
Michael Wodrich
 
XProfan X2
Windows (TM) Vista Ultimate, Core(TM) i7 920 @ 2.67GHz, 9206,26 MB

Programmieren, das spannendste Detektivspiel der Welt.
02/28/14  
 




Nico
Madysa
[OFFTOPIC]
Michael Wodrich (28.02.14)

(is you incidentally already time noticed: Diejenigen, The these question to put dive then into subesquent 10.000 Postings not any more on...


probably are the people, The just to quarrel Search.
[/OFFTOPIC]
 
02/28/14  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

10.206 Views

Untitledvor 0 min.
H.Brill02/22/22
p.specht11/20/21
Uwe Lang11/20/21
Manfred Barei11/19/21
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie