PathParseIconLocationA 関数 (shlwapi.h)

ファイルの場所とアイコン インデックスを含むファイルの場所の文字列を解析し、個別の値を返します。

構文

int PathParseIconLocationA(
  [in, out] LPSTR pszIconFile
);

パラメーター

[in, out] pszIconFile

種類: LPTSTR

ファイルの場所の文字列を含む長MAX_PATHの null で終わる文字列へのポインター。 "path,iconindex" という形式にする必要があります。 関数が戻ると、 pszIconFile はファイルのパスを指します。

戻り値

型: int

有効なアイコン インデックス値を返します。

注釈

この関数は、 SHGetValue によってレジストリから取得された DefaultIcon 値を取得し、アイコン インデックスをパスから分離する場合に便利です。

#include <windows.h>
#include <iostream.h>
#include "Shlwapi.h"

void main(void)
{
// Path to parse for file and icon index.
char buffer_1[ ] = "C:\\TEST\\sample.txt,3"; 
char *lpStr1;
lpStr1 = buffer_1;

// Return value from "PathParseIconLocation".
int retval;

// Search a path to parse for file and icon index.
retval = PathParseIconLocation(lpStr1);
cout << "The path to parse for file and icon index is   : " << lpStr1 << endl;
cout << "PathParseIconLocation returns the icon index of: " << retval << endl;
}

OUTPUT:
==========
The path to parse for file and icon index is   : C:\TEST\sample.txt
PathParseIconLocation returns the icon index of: 3

Note

shlwapi.h ヘッダーは、PathParseIconLocation をエイリアスとして定義します。このエイリアスは、UNICODE プリプロセッサ定数の定義に基づいて、この関数の ANSI または Unicode バージョンを自動的に選択します。 encoding-neutral エイリアスの使用を encoding-neutral ではないコードと混在すると、コンパイル エラーまたはランタイム エラーが発生する不一致が発生する可能性があります。 詳細については、「 関数プロトタイプの規則」を参照してください。

要件

要件
サポートされている最小のクライアント Windows 2000 Professional、Windows XP [デスクトップ アプリのみ]
サポートされている最小のサーバー Windows 2000 Server [デスクトップ アプリのみ]
対象プラットフォーム Windows
ヘッダー shlwapi.h
Library Shlwapi.lib
[DLL] Shlwapi.dll (バージョン 4.71 以降)