#include "WindowsScreenService.h"
#include <ShellScalingApi.h>
namespace
{
namespace
{
namespace
{
::
()
{
}
::
()
{
;
info
.
=
sizeof
(
);
GetMonitorInfo(monitor, &info);
return
(
info
.
.
,
info
.
.
,
info
.
.
,
info
.
.
);
}
::
()
{
;
info
.
=
sizeof
(
);
GetMonitorInfo(monitor, &info);
return
(
info
.
.
,
info
.
.
,
info
.
.
,
info
.
.
);
}
::
()
{
;
info
.
=
sizeof
(
);
GetMonitorInfo(monitor, &info);
wchar_t
[
sizeof
(
info
.
)/
sizeof
(*
info
.
)+
1
];
(
buffer
,
0
,
sizeof
(
buffer
));
(
buffer
,
info
.
,
sizeof
(
info
.
));
return
buffer
;
}
bool
::
()
{
;
info
.
=
sizeof
(
);
GetMonitorInfo(monitor, &info);
return info.dwFlags==MONITORINFOF_PRIMARY;
return
info
.
==
0x00000001
;
}
double
::
()
{
=
0
,
=
0
;
DpiAwared_GetDpiForMonitor
(
, &
x
, &
y
);
return
x
/
96.0
;
}
double
::
()
{
=
0
,
=
0
;
DpiAwared_GetDpiForMonitor
(
, &
x
, &
y
);
return
y
/
96.0
;
}
::
(
)
:handleRetriver(
)
{
}
BOOL CALLBACK WindowsScreenService::MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
{
*
=(
*)
;
if
(
data
->
==
data
->
->
.
())
{
data
->
->
.
(
new
());
}
data
->
->
data
->
]
=
;
data
->
++;
}
void
::
()
{
for
(
=
0
;
i
<
.
();
i
++)
{
screens[i]->monitor=NULL;
}
;
data
.
=
this
;
data
.
=
0
;
EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)(&data));
}
::
()
{
();
return GetSystemMetrics(SM_CMONITORS);
}
*
::
(
)
{
();
return
].
();
}
*
::
(
*
)
{
();
=
(
);
if
(
hwnd
)
{
HMONITOR monitor=MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL);
{
for
(
=
0
;
i
<
.
();
i
++)
{
if
(
i
]
==
monitor
)
{
return
i
].
();
}
}
}
}
return
0
;
}
}
}
}