0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

c++ builder > form > モニタ解像度の取得 > Screen->Monitors[0]->Width; / ->Height; // Screen->PrimaryMonitor->

Last updated at Posted at 2015-10-08
動作確認
C++ Builder XE4

モニタ解像度を取得したい。
過去に作ったプログラムのソースを参考にした。

// 1. Monitors[]使用
	int width = Screen->Monitors[0]->Width;
	int height = Screen->Monitors[0]->Height;

	String msg = String().sprintf(L"W%d x H%d", width, height);
	Memo1->Lines->Add(msg);

// 2. PrimaryMonitor使用
	width = Screen->PrimaryMonitor->Width;
	height = Screen->PrimaryMonitor->Height;
	msg = String().sprintf(L"W%d x H%d", width, height);
	Memo1->Lines->Add(msg);
結果(Memo1:TMemo)
Memo1
W1920 x H1080
W1920 x H1080

モニタが複数ある場合は Monitors[]を使えば2つ目も扱える。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?