Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Verküpfungsziel richtig erkennen (https://www.delphipraxis.net/15826-verkuepfungsziel-richtig-erkennen.html)

Flogo 4. Feb 2004 16:56


Verküpfungsziel richtig erkennen
 
Tachen zusammen
Ich hab versucht das Ziel eines Links zu bekommen und hab nur den kurzen (8.3) namen zurückbekommen. ich brauch aber undebingt den langen! hab schon nach funktionen gesucht den umzuwandeln aber das schein nicht richtig zu funktionieren. Vielleicht kennt ja jemand ne Methode die Einem den richten Namen zurückgibt? Ich hab dazu eine Jediunit genommen. :hi:

Christian Seehase 4. Feb 2004 23:55

Re: Verküpfungsziel richtig erkennen
 
Moin Flogo,

das hatten wir doch gerade gestern :gruebel: ;-)

Schau Dir mal die API GetLongPathname an.

Flogo 5. Feb 2004 06:35

Re: Verküpfungsziel richtig erkennen
 
Hoppla hab ich übersehen :oops:
Hatte vor ein paar Tagen schon mal gesucht und nix passendes gefunden. Hab nicht damit gerechnet dass es so schnell ne zweite Lösung gibt :dp:
Danke

Flogo 5. Feb 2004 11:51

Re: Verküpfungsziel richtig erkennen
 
Das ist jetzt wahrscheilich ne dumme Frage :duck: aber was muss ich denn für ne Unit einbinden damit des tut. Das ist so ein grundsätzliches Problem von mir: wo finde ich welche unit ich für einen Befehl brauche, der nicht in der Hilfe steht.
Hab mal gegooglet aber nur selbstgeschriebene Methoden gefunden die GetLongPathname hießen. und die scheinen bei mir nicht richtig zu funktionieren

Sharky 5. Feb 2004 11:52

Re: Verküpfungsziel richtig erkennen
 
Hai Flogo,

IMHO müsste es die ShellAPI sein, die brauchst Du immer wenn Du auf API-Funktionen zugreifen möchtest.

Flogo 5. Feb 2004 11:58

Re: Verküpfungsziel richtig erkennen
 
hmmm... die hab ich drin aber er gibt mir trotzdem den Fehler "Undeclared Identifier: GetLongPathname"

Sharky 5. Feb 2004 12:12

Re: Verküpfungsziel richtig erkennen
 
Ups,

habe es eben erst getestet. Bei mir auch. Laut SDK gibt es die Funktion.

Zitat:

Code:
[b]GetLongPathName[/b]
The GetLongPathName function converts the specified path to its long form. If no long path is found, this function simply returns the specified name.

DWORD GetLongPathName(
  LPCTSTR lpszShortPath, // file name
  LPTSTR lpszLongPath,  // path buffer
  DWORD cchBuffer       // size of path buffer
);
Parameters
lpszShortPath
[in] Pointer to a null-terminated path to be converted.
Windows 2000/XP: In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to nearly 32,000 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see File Name Conventions.

Windows 98/Me: This string must not exceed MAX_PATH characters.

lpszLongPath
[out] Pointer to the buffer to receive the long path. You can use the same buffer you used for the lpszShortPath parameter.
cchBuffer
[in] Specifies the size of the buffer, in TCHARs.
Return Values
If the function succeeds, the return value is the length of the string copied to the lpszLongPath parameter, in TCHARs. This length does not include the terminating null character.

If the lpszLongPath buffer is too small to contain the path, the return value is the size of the buffer, in TCHARs, required to hold the path. Therefore, if the return value is greater than cchBuffer, call the function again with a buffer that is large enough to hold the path.

If the function fails for any other reason, the return value is zero. To get extended error information, call GetLastError.

Remarks
Windows 98/Me: GetLongPathNameW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.

Requirements
  Windows NT/2000/XP: Included in Windows 2000 and later.
  Windows 95/98/Me: Included in Windows 98 and later.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Kernel32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows 2000/XP. Also supported by Microsoft Layer for Unicode.


Flogo 5. Feb 2004 12:19

Re: Verküpfungsziel richtig erkennen
 
Zitat:

Zitat von SDK
Requirements
Windows NT/2000/XP: Included in Windows 2000 and later.

Heißt das jetzt unter XP "ja" oder "nein"
wennn "ja", dann wie also mit welcher Unit??

Christian Seehase 5. Feb 2004 13:34

Re: Verküpfungsziel richtig erkennen
 
Moin Flogo,

dass heisst, dass es die Funktion ab Windows 2000 gibt. Da XP später herausgekommen ist, wird die Funktion dort auch unterstützt.
Ich vermute mal, dass es so keine Unit gibt, in der die Funktion enthalten ist.
Du müsstest sie selber importieren.

Flogo 5. Feb 2004 14:13

Re: Verküpfungsziel richtig erkennen
 
Ich glaub ich habs schon so gelöst (hab eine von den selbstgeschriebenen noch n bisschen erweitert) aber aus interesse: Wie kann ich die denn importieren?


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:11 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz