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
62c5d9f3
Commit
62c5d9f3
authored
May 23, 2000
by
Susan Farley
Committed by
Alexandre Julliard
May 23, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SetBuddy no longer overwrites its superclass' WndProc property when
the buddy has already been subclassed, eliminating the infinite loop that resulted.
parent
f2b77ccb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
updown.c
dlls/comctl32/updown.c
+14
-19
No files found.
dlls/comctl32/updown.c
View file @
62c5d9f3
...
@@ -426,6 +426,7 @@ static BOOL UPDOWN_SetBuddy (HWND hwnd, HWND hwndBud)
...
@@ -426,6 +426,7 @@ static BOOL UPDOWN_SetBuddy (HWND hwnd, HWND hwndBud)
DWORD
dwStyle
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
DWORD
dwStyle
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
RECT
budRect
;
/* new coord for the buddy */
RECT
budRect
;
/* new coord for the buddy */
int
x
,
width
;
/* new x position and width for the up-down */
int
x
,
width
;
/* new x position and width for the up-down */
WNDPROC
baseWndProc
,
currWndProc
;
/* Is it a valid bud? */
/* Is it a valid bud? */
if
(
!
IsWindow
(
hwndBud
))
if
(
!
IsWindow
(
hwndBud
))
...
@@ -450,19 +451,17 @@ static BOOL UPDOWN_SetBuddy (HWND hwnd, HWND hwndBud)
...
@@ -450,19 +451,17 @@ static BOOL UPDOWN_SetBuddy (HWND hwnd, HWND hwndBud)
when we reset the upDown ctrl buddy to another buddy because it is not
when we reset the upDown ctrl buddy to another buddy because it is not
good to break the window proc chain. */
good to break the window proc chain. */
/* keep buddy supperclass wndproc in prop instead of in ptr struct
currWndProc
=
(
WNDPROC
)
GetWindowLongA
(
hwndBud
,
GWL_WNDPROC
);
to prevent accessing freed memory */
if
(
currWndProc
!=
UPDOWN_Buddy_SubclassProc
)
SetPropA
(
{
hwndBud
,
// replace the buddy's WndProc with ours
BUDDY_SUPERCLASS_WNDPROC
,
baseWndProc
=
(
WNDPROC
)
SetWindowLongA
(
hwndBud
,
GWL_WNDPROC
,
(
LONG
)
GetWindowLongA
(
hwndBud
,
GWL_WNDPROC
)
);
(
LPARAM
)
UPDOWN_Buddy_SubclassProc
);
// and save the base class' WndProc
/* Assign the buddy wndproc to local wndproc in order to override
SetPropA
(
hwndBud
,
BUDDY_SUPERCLASS_WNDPROC
,
(
HANDLE
)
baseWndProc
);
keyboard's up and down arrow */
}
SetWindowLongA
(
// else
hwndBud
,
// its already been subclassed, don't overwrite BUDDY_SUPERCLASS_WNDPROC
GWL_WNDPROC
,
(
LONG
)
UPDOWN_Buddy_SubclassProc
);
}
}
/* do we need to do any adjustments? */
/* do we need to do any adjustments? */
...
@@ -951,7 +950,7 @@ UPDOWN_Buddy_SubclassProc (
...
@@ -951,7 +950,7 @@ UPDOWN_Buddy_SubclassProc (
WPARAM
wParam
,
WPARAM
wParam
,
LPARAM
lParam
)
LPARAM
lParam
)
{
{
LONG
superClassWndProc
=
GetPropA
(
hwnd
,
BUDDY_SUPERCLASS_WNDPROC
);
WNDPROC
superClassWndProc
=
(
WNDPROC
)
GetPropA
(
hwnd
,
BUDDY_SUPERCLASS_WNDPROC
);
TRACE
(
"hwnd=%04x, wndProc=%d, uMsg=%04x, wParam=%d, lParam=%d
\n
"
,
TRACE
(
"hwnd=%04x, wndProc=%d, uMsg=%04x, wParam=%d, lParam=%d
\n
"
,
hwnd
,
(
INT
)
superClassWndProc
,
uMsg
,
wParam
,
(
UINT
)
lParam
);
hwnd
,
(
INT
)
superClassWndProc
,
uMsg
,
wParam
,
(
UINT
)
lParam
);
...
@@ -980,12 +979,8 @@ UPDOWN_Buddy_SubclassProc (
...
@@ -980,12 +979,8 @@ UPDOWN_Buddy_SubclassProc (
}
}
/* else Fall Through */
/* else Fall Through */
}
}
default:
return
CallWindowProcA
(
(
WNDPROC
)
superClassWndProc
,
hwnd
,
uMsg
,
wParam
,
lParam
);
}
}
return
CallWindowProcA
(
superClassWndProc
,
hwnd
,
uMsg
,
wParam
,
lParam
);
return
0
;
}
}
/***********************************************************************
/***********************************************************************
...
...
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