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
06e735d2
Commit
06e735d2
authored
Jan 26, 2001
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 26, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace 16-bit calls in DefWindowProc by 32-bit, preferring unicode
API calls.
parent
4d77fc44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
40 deletions
+62
-40
win.h
include/win.h
+1
-1
defwnd.c
windows/defwnd.c
+61
-39
No files found.
include/win.h
View file @
06e735d2
...
...
@@ -178,7 +178,7 @@ extern void CARET_GetRect(LPRECT lprc); /* windows/caret.c */
extern
BOOL16
DRAG_QueryUpdate
(
HWND
,
SEGPTR
,
BOOL
);
extern
void
DEFWND_SetTextA
(
WND
*
wndPtr
,
LPCSTR
text
);
extern
void
DEFWND_SetTextW
(
WND
*
wndPtr
,
LPCWSTR
text
);
extern
HBRUSH
DEFWND_ControlColor
(
HDC
hDC
,
UINT
16
ctlType
);
/* windows/defwnd.c */
extern
HBRUSH
DEFWND_ControlColor
(
HDC
hDC
,
UINT
ctlType
);
/* windows/defwnd.c */
extern
void
PROPERTY_RemoveWindowProps
(
WND
*
pWnd
);
/* windows/property.c */
...
...
windows/defwnd.c
View file @
06e735d2
...
...
@@ -38,17 +38,17 @@ static short iMenuSysKey = 0;
*/
static
void
DEFWND_HandleWindowPosChanged
(
WND
*
wndPtr
,
UINT
flags
)
{
WPARAM
16
wp
=
SIZE_RESTORED
;
WPARAM
wp
=
SIZE_RESTORED
;
if
(
!
(
flags
&
SWP_NOCLIENTMOVE
))
SendMessage
16
(
wndPtr
->
hwndSelf
,
WM_MOVE
,
0
,
SendMessage
W
(
wndPtr
->
hwndSelf
,
WM_MOVE
,
0
,
MAKELONG
(
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectClient
.
top
));
if
(
!
(
flags
&
SWP_NOCLIENTSIZE
))
{
if
(
wndPtr
->
dwStyle
&
WS_MAXIMIZE
)
wp
=
SIZE_MAXIMIZED
;
else
if
(
wndPtr
->
dwStyle
&
WS_MINIMIZE
)
wp
=
SIZE_MINIMIZED
;
SendMessage
16
(
wndPtr
->
hwndSelf
,
WM_SIZE
,
wp
,
SendMessage
W
(
wndPtr
->
hwndSelf
,
WM_SIZE
,
wp
,
MAKELONG
(
wndPtr
->
rectClient
.
right
-
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectClient
.
bottom
-
wndPtr
->
rectClient
.
top
));
}
...
...
@@ -103,7 +103,7 @@ void DEFWND_SetTextW( WND *wndPtr, LPCWSTR text )
*
* Default colors for control painting.
*/
HBRUSH
DEFWND_ControlColor
(
HDC
hDC
,
UINT
16
ctlType
)
HBRUSH
DEFWND_ControlColor
(
HDC
hDC
,
UINT
ctlType
)
{
if
(
ctlType
==
CTLCOLOR_SCROLLBAR
)
{
...
...
@@ -203,13 +203,13 @@ static void DEFWND_Print(
* Background
*/
if
(
uFlags
&
PRF_ERASEBKGND
)
SendMessage
A
(
wndPtr
->
hwndSelf
,
WM_ERASEBKGND
,
(
WPARAM
)
hdc
,
0
);
SendMessage
W
(
wndPtr
->
hwndSelf
,
WM_ERASEBKGND
,
(
WPARAM
)
hdc
,
0
);
/*
* Client area
*/
if
(
uFlags
&
PRF_CLIENT
)
SendMessage
A
(
wndPtr
->
hwndSelf
,
WM_PRINTCLIENT
,
(
WPARAM
)
hdc
,
PRF_CLIENT
);
SendMessage
W
(
wndPtr
->
hwndSelf
,
WM_PRINTCLIENT
,
(
WPARAM
)
hdc
,
PRF_CLIENT
);
}
...
...
@@ -284,8 +284,14 @@ static BOOL DEFWND_ImmIsUIMessageW( HWND hwndIME, UINT msg, WPARAM wParam, LPARA
* Default window procedure for messages that are the same in Win16 and Win32.
*/
static
LRESULT
DEFWND_DefWinProc
(
WND
*
wndPtr
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
LPARAM
lParam
,
BOOL
unicode
)
{
LRESULT
(
WINAPI
*
pSendMessage
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
BOOL
(
WINAPI
*
pPostMessage
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
pSendMessage
=
unicode
?
SendMessageW
:
SendMessageA
;
pPostMessage
=
unicode
?
PostMessageW
:
PostMessageA
;
switch
(
msg
)
{
case
WM_NCPAINT
:
...
...
@@ -322,9 +328,12 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
}
if
((
wndPtr
->
flags
&
WIN_ISWIN32
)
||
(
TWEAK_WineLook
>
WIN31_LOOK
))
{
ClientToScreen16
(
wndPtr
->
hwndSelf
,
(
LPPOINT16
)
&
lParam
);
SendMessageA
(
wndPtr
->
hwndSelf
,
WM_CONTEXTMENU
,
wndPtr
->
hwndSelf
,
lParam
);
POINT
pt
;
pt
.
x
=
SLOWORD
(
lParam
);
pt
.
y
=
SHIWORD
(
lParam
);
ClientToScreen
(
wndPtr
->
hwndSelf
,
&
pt
);
lParam
=
MAKELPARAM
(
pt
.
x
,
pt
.
y
);
pSendMessage
(
wndPtr
->
hwndSelf
,
WM_CONTEXTMENU
,
wndPtr
->
hwndSelf
,
lParam
);
}
break
;
...
...
@@ -339,7 +348,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case
WM_CONTEXTMENU
:
if
(
wndPtr
->
dwStyle
&
WS_CHILD
)
SendMessageA
(
wndPtr
->
parent
->
hwndSelf
,
msg
,
wParam
,
lParam
);
pSendMessage
(
wndPtr
->
parent
->
hwndSelf
,
msg
,
wParam
,
lParam
);
else
if
(
wndPtr
->
hSysMenu
)
{
LONG
hitcode
;
...
...
@@ -384,12 +393,12 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case
WM_PAINTICON
:
case
WM_PAINT
:
{
PAINTSTRUCT
16
ps
;
HDC
16
hdc
=
BeginPaint16
(
wndPtr
->
hwndSelf
,
&
ps
);
PAINTSTRUCT
ps
;
HDC
hdc
=
BeginPaint
(
wndPtr
->
hwndSelf
,
&
ps
);
if
(
hdc
)
{
HICON
hIcon
;
if
(
(
wndPtr
->
dwStyle
&
WS_MINIMIZE
)
&&
((
hIcon
=
GetClassLong
A
(
wndPtr
->
hwndSelf
,
GCL_HICON
)))
)
if
(
(
wndPtr
->
dwStyle
&
WS_MINIMIZE
)
&&
((
hIcon
=
GetClassLong
W
(
wndPtr
->
hwndSelf
,
GCL_HICON
)))
)
{
int
x
=
(
wndPtr
->
rectWindow
.
right
-
wndPtr
->
rectWindow
.
left
-
GetSystemMetrics
(
SM_CXICON
))
/
2
;
...
...
@@ -399,7 +408,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
ps
.
rcPaint
.
left
,
ps
.
rcPaint
.
top
,
ps
.
rcPaint
.
right
,
ps
.
rcPaint
.
bottom
);
DrawIcon
(
hdc
,
x
,
y
,
hIcon
);
}
EndPaint
16
(
wndPtr
->
hwndSelf
,
&
ps
);
EndPaint
(
wndPtr
->
hwndSelf
,
&
ps
);
}
return
0
;
}
...
...
@@ -423,7 +432,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case
WM_MOUSEACTIVATE
:
if
(
wndPtr
->
dwStyle
&
WS_CHILD
)
{
LONG
ret
=
SendMessage16
(
wndPtr
->
parent
->
hwndSelf
,
LONG
ret
=
pSendMessage
(
wndPtr
->
parent
->
hwndSelf
,
WM_MOUSEACTIVATE
,
wParam
,
lParam
);
if
(
ret
)
return
ret
;
}
...
...
@@ -443,7 +452,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case
WM_MOUSEWHEEL
:
if
(
wndPtr
->
dwStyle
&
WS_CHILD
)
{
return
SendMessageA
(
wndPtr
->
parent
->
hwndSelf
,
return
pSendMessage
(
wndPtr
->
parent
->
hwndSelf
,
WM_MOUSEWHEEL
,
wParam
,
lParam
);
}
break
;
...
...
@@ -452,7 +461,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case
WM_ICONERASEBKGND
:
{
RECT
rect
;
HBRUSH
hbr
=
GetClassLong
A
(
wndPtr
->
hwndSelf
,
GCL_HBRBACKGROUND
);
HBRUSH
hbr
=
GetClassLong
W
(
wndPtr
->
hwndSelf
,
GCL_HBRBACKGROUND
);
if
(
!
hbr
)
return
0
;
/* Since WM_ERASEBKGND may receive either a window dc or a */
...
...
@@ -490,7 +499,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case
WM_SETCURSOR
:
if
(
wndPtr
->
dwStyle
&
WS_CHILD
)
if
(
SendMessage16
(
wndPtr
->
parent
->
hwndSelf
,
WM_SETCURSOR
,
if
(
pSendMessage
(
wndPtr
->
parent
->
hwndSelf
,
WM_SETCURSOR
,
wParam
,
lParam
))
return
TRUE
;
return
NC_HandleSetCursor
(
wndPtr
->
hwndSelf
,
wParam
,
lParam
);
...
...
@@ -523,7 +532,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
HWND
hWnd
=
WIN_GetTopParent
(
wndPtr
->
hwndSelf
);
wndPtr
=
WIN_FindWndPtr
(
hWnd
);
if
(
wndPtr
&&
!
(
wndPtr
->
clsStyle
&
CS_NOCLOSE
)
)
PostMessage16
(
hWnd
,
WM_SYSCOMMAND
,
SC_CLOSE
,
0
);
pPostMessage
(
hWnd
,
WM_SYSCOMMAND
,
SC_CLOSE
,
0
);
WIN_ReleaseWndPtr
(
wndPtr
);
}
}
...
...
@@ -531,8 +540,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
iF10Key
=
1
;
else
if
(
wParam
==
VK_ESCAPE
&&
(
GetKeyState
(
VK_SHIFT
)
&
0x8000
))
SendMessage16
(
wndPtr
->
hwndSelf
,
WM_SYSCOMMAND
,
(
WPARAM16
)
SC_KEYMENU
,
(
LPARAM
)
VK_SPACE
);
pSendMessage
(
wndPtr
->
hwndSelf
,
WM_SYSCOMMAND
,
SC_KEYMENU
,
VK_SPACE
);
break
;
case
WM_KEYUP
:
...
...
@@ -540,7 +548,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
/* Press and release F10 or ALT */
if
(((
wParam
==
VK_MENU
)
&&
iMenuSysKey
)
||
((
wParam
==
VK_F10
)
&&
iF10Key
))
SendMessage16
(
WIN_GetTopParent
(
wndPtr
->
hwndSelf
),
pSendMessage
(
WIN_GetTopParent
(
wndPtr
->
hwndSelf
),
WM_SYSCOMMAND
,
SC_KEYMENU
,
0L
);
iMenuSysKey
=
iF10Key
=
0
;
break
;
...
...
@@ -549,18 +557,16 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
iMenuSysKey
=
0
;
if
(
wParam
==
VK_RETURN
&&
(
wndPtr
->
dwStyle
&
WS_MINIMIZE
))
{
PostMessage16
(
wndPtr
->
hwndSelf
,
WM_SYSCOMMAND
,
(
WPARAM16
)
SC_RESTORE
,
0L
);
pPostMessage
(
wndPtr
->
hwndSelf
,
WM_SYSCOMMAND
,
SC_RESTORE
,
0L
);
break
;
}
if
((
HIWORD
(
lParam
)
&
KEYDATA_ALT
)
&&
wParam
)
{
if
(
wParam
==
VK_TAB
||
wParam
==
VK_ESCAPE
)
break
;
if
(
wParam
==
VK_SPACE
&&
(
wndPtr
->
dwStyle
&
WS_CHILD
))
SendMessage16
(
wndPtr
->
parent
->
hwndSelf
,
msg
,
wParam
,
lParam
);
pSendMessage
(
wndPtr
->
parent
->
hwndSelf
,
msg
,
wParam
,
lParam
);
else
SendMessage16
(
wndPtr
->
hwndSelf
,
WM_SYSCOMMAND
,
(
WPARAM16
)
SC_KEYMENU
,
(
LPARAM
)(
DWORD
)
wParam
);
pSendMessage
(
wndPtr
->
hwndSelf
,
WM_SYSCOMMAND
,
SC_KEYMENU
,
wParam
);
}
else
/* check for Ctrl-Esc */
if
(
wParam
!=
VK_ESCAPE
)
MessageBeep
(
0
);
...
...
@@ -593,14 +599,14 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case
WM_QUERYDRAGICON
:
{
UINT
16
len
;
UINT
len
;
HICON
hIcon
=
GetClassLong
A
(
wndPtr
->
hwndSelf
,
GCL_HICON
);
HICON
hIcon
=
GetClassLong
W
(
wndPtr
->
hwndSelf
,
GCL_HICON
);
if
(
hIcon
)
return
hIcon
;
for
(
len
=
1
;
len
<
64
;
len
++
)
if
((
hIcon
=
LoadIconA
(
wndPtr
->
hInstance
,
MAKEINTRESOURCEA
(
len
))))
if
((
hIcon
=
LoadIconW
(
wndPtr
->
hInstance
,
MAKEINTRESOURCEW
(
len
))))
return
(
LRESULT
)
hIcon
;
return
(
LRESULT
)
LoadIcon
A
(
0
,
IDI_APPLICATIONA
);
return
(
LRESULT
)
LoadIcon
W
(
0
,
IDI_APPLICATIONW
);
}
break
;
...
...
@@ -618,8 +624,8 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case
WM_SETICON
:
{
int
index
=
(
wParam
!=
ICON_SMALL
)
?
GCL_HICON
:
GCL_HICONSM
;
HICON
16
hOldIcon
=
GetClassLongA
(
wndPtr
->
hwndSelf
,
index
);
SetClassLong
A
(
wndPtr
->
hwndSelf
,
index
,
lParam
);
HICON
hOldIcon
=
GetClassLongW
(
wndPtr
->
hwndSelf
,
index
);
SetClassLong
W
(
wndPtr
->
hwndSelf
,
index
,
lParam
);
SetWindowPos
(
wndPtr
->
hwndSelf
,
0
,
0
,
0
,
0
,
0
,
SWP_FRAMECHANGED
|
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOACTIVATE
...
...
@@ -634,11 +640,11 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case
WM_GETICON
:
{
int
index
=
(
wParam
!=
ICON_SMALL
)
?
GCL_HICON
:
GCL_HICONSM
;
return
GetClassLong
A
(
wndPtr
->
hwndSelf
,
index
);
return
GetClassLong
W
(
wndPtr
->
hwndSelf
,
index
);
}
case
WM_HELP
:
SendMessageA
(
wndPtr
->
parent
->
hwndSelf
,
msg
,
wParam
,
lParam
);
pSendMessage
(
wndPtr
->
parent
->
hwndSelf
,
msg
,
wParam
,
lParam
);
break
;
}
...
...
@@ -710,7 +716,7 @@ LRESULT WINAPI DefWindowProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
break
;
default:
result
=
DEFWND_DefWinProc
(
wndPtr
,
msg
,
wParam
,
lParam
);
result
=
DEFWND_DefWinProc
(
wndPtr
,
msg
,
wParam
,
lParam
,
FALSE
);
break
;
}
...
...
@@ -820,7 +826,7 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam,
break
;
default:
result
=
DEFWND_DefWinProc
(
wndPtr
,
msg
,
wParam
,
lParam
);
result
=
DEFWND_DefWinProc
(
wndPtr
,
msg
,
wParam
,
lParam
,
FALSE
);
break
;
}
...
...
@@ -864,6 +870,22 @@ LRESULT WINAPI DefWindowProcW(
}
break
;
case
WM_NCCALCSIZE
:
result
=
NC_HandleNCCalcSize
(
wndPtr
,
(
RECT
*
)
lParam
);
break
;
case
WM_WINDOWPOSCHANGING
:
result
=
WINPOS_HandleWindowPosChanging
(
wndPtr
,
(
WINDOWPOS
*
)
lParam
);
break
;
case
WM_WINDOWPOSCHANGED
:
{
WINDOWPOS
*
winPos
=
(
WINDOWPOS
*
)
lParam
;
DEFWND_HandleWindowPosChanged
(
wndPtr
,
winPos
->
flags
);
}
break
;
case
WM_GETTEXT
:
if
(
wParam
&&
wndPtr
->
text
)
{
...
...
@@ -894,7 +916,7 @@ LRESULT WINAPI DefWindowProcW(
break
;
default:
result
=
DefWindowProcA
(
hwnd
,
msg
,
wParam
,
lParam
);
result
=
DEFWND_DefWinProc
(
wndPtr
,
msg
,
wParam
,
lParam
,
TRUE
);
break
;
}
WIN_ReleaseWndPtr
(
wndPtr
);
...
...
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