Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7e8d5ceb
Commit
7e8d5ceb
authored
Oct 05, 2004
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Oct 05, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Audit combo control code.
Change [GS]etWindowLong{,Ptr}A to [GS]etWindowLong{,Ptr}W.
parent
5d0160ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
18 deletions
+34
-18
combo.c
dlls/user/combo.c
+34
-18
No files found.
dlls/user/combo.c
View file @
7e8d5ceb
...
...
@@ -17,7 +17,23 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* FIXME: roll up in Netscape 3.01.
* NOTES
*
* This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Oct. 4, 2004, by Dimitrie O. Paun.
*
* Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above.
* If you discover missing features, or bugs, please note them below.
*
* TODO:
* - GetComboBoxInfo()
* - ComboBox_[GS]etMinVisible()
* - CB_GETCOMBOBOXINFO
* - CB_GETMINVISIBLE, CB_SETMINVISIBLE
* - CB_LIMITTEXT
* - CB_SETTOPINDEX
* - Fix roll up in Netscape 3.01.
*/
#include <stdarg.h>
...
...
@@ -49,7 +65,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(combo);
#define CB_NOTIFY( lphc, code ) \
(SendMessageW((lphc)->owner, WM_COMMAND, \
MAKEWPARAM(GetWindowLongPtr
A
((lphc)->self,GWLP_ID), (code)), (LPARAM)(lphc)->self))
MAKEWPARAM(GetWindowLongPtr
W
((lphc)->self,GWLP_ID), (code)), (LPARAM)(lphc)->self))
#define CB_DISABLED( lphc ) (!IsWindowEnabled((lphc)->self))
#define CB_OWNERDRAWN( lphc ) ((lphc)->dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE))
...
...
@@ -139,23 +155,23 @@ static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
if
(
COMBO_Init
()
&&
(
lphc
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
HEADCOMBO
)))
)
{
lphc
->
self
=
hwnd
;
SetWindowLong
A
(
hwnd
,
0
,
(
LONG
)
lphc
);
SetWindowLong
W
(
hwnd
,
0
,
(
LONG
)
lphc
);
/* some braindead apps do try to use scrollbar/border flags */
lphc
->
dwStyle
=
style
&
~
(
WS_BORDER
|
WS_HSCROLL
|
WS_VSCROLL
);
SetWindowLong
A
(
hwnd
,
GWL_STYLE
,
style
&
~
(
WS_BORDER
|
WS_HSCROLL
|
WS_VSCROLL
)
);
SetWindowLong
W
(
hwnd
,
GWL_STYLE
,
style
&
~
(
WS_BORDER
|
WS_HSCROLL
|
WS_VSCROLL
)
);
/*
* We also have to remove the client edge style to make sure
* we don't end-up with a non client area.
*/
SetWindowLong
A
(
hwnd
,
GWL_EXSTYLE
,
GetWindowLong
A
(
hwnd
,
GWL_EXSTYLE
)
&
~
WS_EX_CLIENTEDGE
);
SetWindowLong
W
(
hwnd
,
GWL_EXSTYLE
,
GetWindowLong
W
(
hwnd
,
GWL_EXSTYLE
)
&
~
WS_EX_CLIENTEDGE
);
if
(
!
(
style
&
(
CBS_OWNERDRAWFIXED
|
CBS_OWNERDRAWVARIABLE
))
)
lphc
->
dwStyle
|=
CBS_HASSTRINGS
;
if
(
!
(
GetWindowLong
A
(
hwnd
,
GWL_EXSTYLE
)
&
WS_EX_NOPARENTNOTIFY
)
)
if
(
!
(
GetWindowLong
W
(
hwnd
,
GWL_EXSTYLE
)
&
WS_EX_NOPARENTNOTIFY
)
)
lphc
->
wState
|=
CBF_NOTIFY
;
TRACE
(
"[%p], style = %08x
\n
"
,
lphc
,
lphc
->
dwStyle
);
...
...
@@ -177,7 +193,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
if
(
(
CB_GETTYPE
(
lphc
)
!=
CBS_SIMPLE
)
&&
lphc
->
hWndLBox
)
DestroyWindow
(
lphc
->
hWndLBox
);
SetWindowLong
A
(
lphc
->
self
,
0
,
0
);
SetWindowLong
W
(
lphc
->
self
,
0
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
lphc
);
}
return
0
;
...
...
@@ -243,7 +259,7 @@ static INT CBGetTextAreaHeight(
MEASUREITEMSTRUCT
measureItem
;
RECT
clientRect
;
INT
originalItemHeight
=
iTextItemHeight
;
UINT
id
=
(
UINT
)
GetWindowLongPtr
A
(
lphc
->
self
,
GWLP_ID
);
UINT
id
=
(
UINT
)
GetWindowLongPtr
W
(
lphc
->
self
,
GWLP_ID
);
/*
* We use the client rect for the width of the item.
...
...
@@ -586,7 +602,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
lphc
->
droppedRect
.
right
-
lphc
->
droppedRect
.
left
,
lphc
->
droppedRect
.
bottom
-
lphc
->
droppedRect
.
top
,
hwnd
,
(
HMENU
)
ID_CB_LISTBOX
,
(
HINSTANCE
)
GetWindowLongPtr
A
(
hwnd
,
GWLP_HINSTANCE
),
lphc
);
(
HINSTANCE
)
GetWindowLongPtr
W
(
hwnd
,
GWLP_HINSTANCE
),
lphc
);
else
lphc
->
hWndLBox
=
CreateWindowExA
(
lbeExStyle
,
"ComboLBox"
,
NULL
,
lbeStyle
,
lphc
->
droppedRect
.
left
,
...
...
@@ -594,7 +610,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
lphc
->
droppedRect
.
right
-
lphc
->
droppedRect
.
left
,
lphc
->
droppedRect
.
bottom
-
lphc
->
droppedRect
.
top
,
hwnd
,
(
HMENU
)
ID_CB_LISTBOX
,
(
HINSTANCE
)
GetWindowLongPtr
A
(
hwnd
,
GWLP_HINSTANCE
),
lphc
);
(
HINSTANCE
)
GetWindowLongPtr
W
(
hwnd
,
GWLP_HINSTANCE
),
lphc
);
if
(
lphc
->
hWndLBox
)
{
...
...
@@ -620,14 +636,14 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
lphc
->
textRect
.
right
-
lphc
->
textRect
.
left
,
lphc
->
textRect
.
bottom
-
lphc
->
textRect
.
top
,
hwnd
,
(
HMENU
)
ID_CB_EDIT
,
(
HINSTANCE
)
GetWindowLongPtr
A
(
hwnd
,
GWLP_HINSTANCE
),
NULL
);
(
HINSTANCE
)
GetWindowLongPtr
W
(
hwnd
,
GWLP_HINSTANCE
),
NULL
);
else
lphc
->
hWndEdit
=
CreateWindowExA
(
0
,
"Edit"
,
NULL
,
lbeStyle
,
lphc
->
textRect
.
left
,
lphc
->
textRect
.
top
,
lphc
->
textRect
.
right
-
lphc
->
textRect
.
left
,
lphc
->
textRect
.
bottom
-
lphc
->
textRect
.
top
,
hwnd
,
(
HMENU
)
ID_CB_EDIT
,
(
HINSTANCE
)
GetWindowLongPtr
A
(
hwnd
,
GWLP_HINSTANCE
),
NULL
);
(
HINSTANCE
)
GetWindowLongPtr
W
(
hwnd
,
GWLP_HINSTANCE
),
NULL
);
if
(
!
lphc
->
hWndEdit
)
bEdit
=
FALSE
;
...
...
@@ -739,7 +755,7 @@ static void CBPaintText(
{
DRAWITEMSTRUCT
dis
;
HRGN
clipRegion
;
UINT
ctlid
=
(
UINT
)
GetWindowLongPtr
A
(
lphc
->
self
,
GWLP_ID
);
UINT
ctlid
=
(
UINT
)
GetWindowLongPtr
W
(
lphc
->
self
,
GWLP_ID
);
/* setup state for DRAWITEM message. Owner will highlight */
if
(
(
lphc
->
wState
&
CBF_FOCUSED
)
&&
...
...
@@ -1314,7 +1330,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd )
case
(
EN_CHANGE
>>
8
):
/*
* In some circumstances (when the selection of the combobox
* is changed for example) we don't wan
s
the EN_CHANGE notification
* is changed for example) we don't wan
t
the EN_CHANGE notification
* to be forwarded to the parent of the combobox. This code
* checks a flag that is set in these occasions and ignores the
* notification.
...
...
@@ -1402,7 +1418,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd )
static
LRESULT
COMBO_ItemOp
(
LPHEADCOMBO
lphc
,
UINT
msg
,
LPARAM
lParam
)
{
HWND
hWnd
=
lphc
->
self
;
UINT
id
=
(
UINT
)
GetWindowLongPtr
A
(
hWnd
,
GWLP_ID
);
UINT
id
=
(
UINT
)
GetWindowLongPtr
W
(
hWnd
,
GWLP_ID
);
TRACE
(
"[%p]: ownerdraw op %04x
\n
"
,
lphc
->
self
,
msg
);
...
...
@@ -1509,7 +1525,7 @@ static LRESULT COMBO_GetTextA( LPHEADCOMBO lphc, INT count, LPSTR buf )
if
(
!
count
||
!
buf
)
return
0
;
if
(
lphc
->
hWndLBox
)
{
INT
idx
=
SendMessage
A
(
lphc
->
hWndLBox
,
LB_GETCURSEL
,
0
,
0
);
INT
idx
=
SendMessage
W
(
lphc
->
hWndLBox
,
LB_GETCURSEL
,
0
,
0
);
if
(
idx
==
LB_ERR
)
goto
error
;
length
=
SendMessageA
(
lphc
->
hWndLBox
,
LB_GETTEXTLEN
,
idx
,
0
);
if
(
length
==
LB_ERR
)
goto
error
;
...
...
@@ -1821,7 +1837,7 @@ static void COMBO_MouseMove( LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam )
static
LRESULT
ComboWndProc_common
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
{
LPHEADCOMBO
lphc
=
(
LPHEADCOMBO
)
GetWindowLong
A
(
hwnd
,
0
);
LPHEADCOMBO
lphc
=
(
LPHEADCOMBO
)
GetWindowLong
W
(
hwnd
,
0
);
TRACE
(
"[%p]: msg %s wp %08x lp %08lx
\n
"
,
hwnd
,
SPY_GetMsgName
(
message
,
hwnd
),
wParam
,
lParam
);
...
...
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