Page Menu
Home
desp's stash
Search
Configure Global Search
Log In
Files
F834922
WindowDeferrer.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
WindowDeferrer.cpp
View Options
#include
"WindowDeferrer.h"
WindowDeferrer
::
WindowDeferrer
(
HWND
parent
,
const
Deferrable
*
deferrables
,
size_t
count
)
:
parent
(
parent
),
deferrables
(
deferrables
),
count
(
count
)
{
hdwp
=
BeginDeferWindowPos
(
count
);
}
WindowDeferrer
::~
WindowDeferrer
()
{
EndDeferWindowPos
(
hdwp
);
}
bool
WindowDeferrer
::
defer
(
int
deltaX
,
int
deltaY
,
HWND
after
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
RECT
rectControl
;
HWND
control
=
GetDlgItem
(
parent
,
deferrables
[
i
].
id
);
GetWindowRect
(
control
,
&
rectControl
);
// Why doesn't GetClientRect work?
MapWindowPoints
(
HWND_DESKTOP
,
parent
,
(
POINT
*
)
&
rectControl
,
2
);
int
x
=
rectControl
.
left
;
int
y
=
rectControl
.
top
;
// calculate new width and height
int
cx
=
rectControl
.
right
-
rectControl
.
left
;
int
cy
=
rectControl
.
bottom
-
rectControl
.
top
;
if
(
deferrables
[
i
].
moveX
)
x
+=
deltaX
;
if
(
deferrables
[
i
].
moveY
)
y
+=
deltaY
;
if
(
deferrables
[
i
].
resizeX
)
cx
+=
deltaX
;
if
(
deferrables
[
i
].
resizeY
)
cy
+=
deltaY
;
hdwp
=
DeferWindowPos
(
hdwp
,
control
,
after
,
x
,
y
,
cx
,
cy
,
(
after
?
0
:
SWP_NOZORDER
)
|
SWP_NOACTIVATE
|
SWP_NOOWNERZORDER
);
}
return
true
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Mon, Aug 17, 1:56 AM (1 d, 10 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
28/14/17a7067d4c05f58a0f9981f5f55f
Attached To
rSCY Scylla
Event Timeline
Log In to Comment