|
// *********************************************************
// ウインドウの位置とサイズを初期化ファイルより復帰
// 戻り値 : 通常は true, Left エントリが無かった場合は false
// でなにもしない
// *********************************************************
BOOL LboxWintool::RestorePositonAndSize( LPTSTR lpSection, LboxInifile *obj )
{
int x,y,w,h;
char szWork[20],szSize[20];
obj->GetString( lpSection, "Left", "NOTHING", szWork, 20 );
if ( lstrcmp( szWork, "NOTHING" ) == 0 ) {
return false;
}
else {
x = StrToInt( szWork );
}
obj->GetString( lpSection, "Top", "0", szWork, 20 );
y = StrToInt( szWork );
HWND hDesktop;
RECT rt;
hDesktop = GetDesktopWindow( );
GetWindowRect( hDesktop, &rt );
wsprintf( szSize, "%d", rt.right );
obj->GetString( lpSection, "Width", szSize, szWork, 20 );
w = StrToInt( szWork );
wsprintf( szSize, "%d", rt.bottom - 32 );
obj->GetString( lpSection, "Height", szSize, szWork, 20 );
h = StrToInt( szWork );
LboxWintool::MoveWindow( x, y );
LboxWintool::ChangeWindowSize( w, h );
return true;
}
| |