C++Builder Tips


デスクトップ領域のサイズ取得


デスクトップ領域(タスクバーやOfficeショートカットバーを除いた領域)のサイズを取得するサンプルです。


//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  int iScreenWidth;
  int iScreenHeight;

  iScreenWidth = GetSystemMetrics(SM_CXFULLSCREEN);
  iScreenHeight = GetSystemMetrics(SM_CYFULLSCREEN);

  ShowMessage("デスクトップ領域の大きさは" +
            IntToStr(iScreenWidth) +
            "×" +
            IntToStr(iScreenHeight) +
            "です。");

}
//---------------------------------------------------------------------------


DownLoad bcbtips069.lzh 4KB(BCB5)