掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
HMONITOR、MONITORINFOのビルドエラーを解消するには (ID:66123)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
書き込みありがとうございます。 ●テスト用プロジェクト(MFC、ダイアログベース)で行った時は、こちらも 特に問題ありませんでした。 // TestDlg.cpp : インプリメンテーション ファイル // #include "stdafx.h" #include "Test.h" #include "TestDlg.h" #include "Dialog1.h" // start---- #define COMPILE_MULTIMON_STUBS #include <multimon.h> // end---- #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CTestDlg メッセージ ハンドラ BOOL CTestDlg::OnInitDialog() { // start---- CString strValue; CRect crectDialog; RECT rectDesktop; long x, y; HMONITOR MonitorHandle; MONITORINFO MonitorInfo; GetWindowRect(&crectDialog); // ダイアログサイズ SystemParametersInfo(SPI_GETWORKAREA, 0, &rectDesktop, 0); // 画面(プライマリ)サイズ:画面下タスクバーを除いたサイズ x = rectDesktop.right; y = rectDesktop.top; POINT Point = {x, y}; MonitorHandle = ::MonitorFromPoint(Point, MONITOR_DEFAULTTOPRIMARY); MonitorInfo.cbSize = sizeof(MonitorInfo); ::GetMonitorInfo(MonitorHandle, &MonitorInfo); SetWindowPos(&wndTop, MonitorInfo.rcWork.left, MonitorInfo.rcWork.top, MonitorInfo.rcWork.right - MonitorInfo.rcWork.left, MonitorInfo.rcWork.bottom, SWP_SHOWWINDOW); // end---- return TRUE; // TRUE を返すとコントロールに設定したフォーカスは失われません。 }
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.