forked from redcode/SpecEmu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockWindow.asm
76 lines (55 loc) · 3.05 KB
/
DockWindow.asm
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
TWINSIZE STRUCT
WRect RECT <>
WWidth DWORD ?
WHeight DWORD ?
TWINSIZE ENDS
GetWindowSize PROTO :DWORD,:PTR TWINSIZE
; structure for external debugger dialogs
TDEBUGDIALOG STRUCT
hWnd DWORD ? ; window handle of this dialog box
Menu_ID DWORD ? ; menu ID of this dialog's activation item in main debugger window's menu
lpName DWORD ? ; ptr to text string defining the name of this dialog (for LOAD/SAVE STATE messages)
WinSize TWINSIZE <> ; current position & size of this dialog
Visible BYTE ? ; TRUE if visible, else FALSE
IsInitWinSize BYTE ? ; TRUE if initial window size has been setup in WM_INITDIALOG in custom message handler
TDEBUGDIALOG ENDS
TogglePopupStyle PROTO :PTR TDEBUGDIALOG
.data?
align 4
DIALOGARRAY LABEL BYTE
FindDLG TDEBUGDIALOG <?>
SourceRipperDLG TDEBUGDIALOG <?>
RegistersDLG TDEBUGDIALOG <?>
Plus3DLG TDEBUGDIALOG <?>
IDEDLG TDEBUGDIALOG <?>
MemoryDLG TDEBUGDIALOG <?>
PCHistoryDLG TDEBUGDIALOG <?>
BreakpointsDLG TDEBUGDIALOG <?>
CommandParserDLG TDEBUGDIALOG <?>
NUMDIALOGS equ ($ - DIALOGARRAY) / sizeof TDEBUGDIALOG ; number of debugger dialogs
.code
ASSUME EBX: PTR TDEBUGDIALOG
TogglePopupStyle proc uses ebx,
hDialog: PTR TDEBUGDIALOG
LOCAL winStyle: DWORD,
winExStyle: DWORD
mov ebx, hDialog
mov winStyle, $fnc (GetWindowLong, [ebx].hWnd, GWL_STYLE)
mov winExStyle, $fnc (GetWindowLong, [ebx].hWnd, GWL_EXSTYLE)
mov eax, winStyle
test eax, WS_CHILD
.if ZERO?
and eax, NOT (WS_POPUP or WS_CAPTION or WS_SYSMENU)
or eax, (WS_CHILD or DS_CONTROL)
invoke SetWindowLong, [ebx].hWnd, GWL_STYLE, eax
.else
and eax, NOT (WS_CHILD or DS_CONTROL)
or eax, (WS_POPUP or WS_CAPTION or WS_SYSMENU)
invoke SetWindowLong, [ebx].hWnd, GWL_STYLE, eax
.endif
; Send the window a WM_NCCALCSIZE message because the frame style has changed
invoke SetWindowPos, [ebx].hWnd, 0, 0, 0, 0, 0,
SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER or SWP_NOACTIVATE or SWP_FRAMECHANGED
ret
TogglePopupStyle endp
ASSUME EBX: NOTHING