Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cf4c3348
Commit
cf4c3348
authored
Mar 11, 2004
by
Robert Shearman
Committed by
Alexandre Julliard
Mar 11, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix subclassing to support nested messages.
parent
adc7a911
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
commctrl.c
dlls/comctl32/commctrl.c
+31
-3
No files found.
dlls/comctl32/commctrl.c
View file @
cf4c3348
...
...
@@ -114,6 +114,7 @@ extern void TREEVIEW_Unregister(void);
extern
void
UPDOWN_Register
(
void
);
extern
void
UPDOWN_Unregister
(
void
);
static
LRESULT
WINAPI
SubclassWndProc
(
HWND
hWnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
LPSTR
COMCTL32_aSubclass
=
NULL
;
HMODULE
COMCTL32_hModule
=
0
;
...
...
@@ -1108,10 +1109,10 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
/* set window procedure to our own and save the current one */
if
(
IsWindowUnicode
(
hWnd
))
stack
->
origproc
=
(
WNDPROC
)
SetWindowLongW
(
hWnd
,
GWL_WNDPROC
,
(
LONG
)
DefSubclass
Proc
);
(
LONG
)
SubclassWnd
Proc
);
else
stack
->
origproc
=
(
WNDPROC
)
SetWindowLongA
(
hWnd
,
GWL_WNDPROC
,
(
LONG
)
DefSubclass
Proc
);
(
LONG
)
SubclassWnd
Proc
);
}
else
{
WNDPROC
current
;
if
(
IsWindowUnicode
(
hWnd
))
...
...
@@ -1119,7 +1120,7 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
else
current
=
(
WNDPROC
)
GetWindowLongA
(
hWnd
,
GWL_WNDPROC
);
if
(
current
!=
DefSubclass
Proc
)
{
if
(
current
!=
SubclassWnd
Proc
)
{
ERR
(
"Application has subclassed with our procedure, then manually, then with us again. The current implementation can't handle this.
\n
"
);
return
FALSE
;
}
...
...
@@ -1263,6 +1264,33 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
/***********************************************************************
* SubclassWndProc (internal)
*
* Window procedure for all subclassed windows.
* Saves the current subclassing stack position to support nested messages
*/
static
LRESULT
WINAPI
SubclassWndProc
(
HWND
hWnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
LPSUBCLASS_INFO
stack
;
int
stackpos
;
LRESULT
ret
;
/* retrieve our little stack from the Properties */
stack
=
(
LPSUBCLASS_INFO
)
GetPropA
(
hWnd
,
COMCTL32_aSubclass
);
if
(
!
stack
)
{
ERR
(
"Our sub classing stack got erased for %p!! Nothing we can do
\n
"
,
hWnd
);
return
0
;
}
stackpos
=
stack
->
stackpos
;
stack
->
stackpos
=
stack
->
stacknum
;
ret
=
DefSubclassProc
(
hWnd
,
uMsg
,
wParam
,
lParam
);
stack
->
stackpos
=
stackpos
;
return
ret
;
}
/***********************************************************************
* DefSubclassProc [COMCTL32.413]
*
* Calls the next window procedure (ie. the one before this subclass)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment