|
// *********************************************************
// Windows ディレクトリのパスを取得
// 戻り値 : 取得した文字列の長さ
// 戻り値 : 失敗した場合は 0
// *********************************************************
int LboxInfo::WindowsDirectory( LboxString *LString )
{
UINT nLen;
while( 1 ) {
nLen = GetWindowsDirectory(
LString->szLboxString,
(UINT)(LString->nLboxString)
);
if ( nLen == 0 ) {
return 0;
}
if ( (int)nLen >= (int)(LString->nLboxString) - 2 ) {
if ( LString->nLboxString > LBOX_STRINGMAX ) {
break;
}
LString->Resize( LString->nLboxString + MAX_PATH );
continue;
}
break;
}
return (int)nLen;
}
int LboxInfo::WindowsDirectory( LPTSTR lpBuffer, int nSize )
{
int ret;
UINT uRet;
uRet = GetWindowsDirectory(
lpBuffer,
0
);
if ( uRet > (UINT)nSize ) {
return 0;
}
ret = (int)GetWindowsDirectory(
lpBuffer,
(UINT)nSize
);
return ret;
}
| |