forked from CobaltFusion/DebugViewPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.cpp
More file actions
45 lines (38 loc) · 981 Bytes
/
Copy pathWindow.cpp
File metadata and controls
45 lines (38 loc) · 981 Bytes
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
42
43
44
45
// (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) == 0)
{
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) == 0)
{
ThrowLastError("GetCursorPos");
}
return pos;
}
} // namespace Win32
} // namespace fusion