forked from CobaltFusion/DebugViewPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Window.cpp
41 lines (34 loc) · 910 Bytes
/
Window.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// (C) Copyright Gert-Jan de Vos and Jan Wilmans 2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Repository at: https://github.com/djeedjay/DebugViewPP/
#include "stdafx.h"
#include "windowsx.h"
#include "Win32/Win32Lib.h"
#include "Win32/Window.h"
namespace fusion {
namespace Win32 {
WINDOWPLACEMENT GetWindowPlacement(HWND hwnd)
{
WINDOWPLACEMENT placement;
placement.length = sizeof(placement);
if (!::GetWindowPlacement(hwnd, &placement))
ThrowLastError("GetWindowPlacement");
return placement;
}
POINT GetMessagePos()
{
DWORD pos = ::GetMessagePos();
POINT pt = { GET_X_LPARAM(pos), GET_Y_LPARAM(pos) };
return pt;
}
POINT GetCursorPos()
{
POINT pos;
if (!GetCursorPos(&pos))
ThrowLastError("GetCursorPos");
return pos;
}
} // namespace Win32
} // namespace fusion