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
2e9436c0
Commit
2e9436c0
authored
Aug 17, 2004
by
Robert Shearman
Committed by
Alexandre Julliard
Aug 17, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User controls: GWL_ -> GWLP_.
parent
4a18630f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
53 deletions
+54
-53
button.c
controls/button.c
+12
-12
combo.c
controls/combo.c
+8
-8
edit.c
controls/edit.c
+7
-7
icontitle.c
controls/icontitle.c
+1
-1
listbox.c
controls/listbox.c
+7
-7
menu.c
controls/menu.c
+4
-3
static.c
controls/static.c
+15
-15
No files found.
controls/button.c
View file @
2e9436c0
...
...
@@ -33,8 +33,8 @@
/* GetWindowLong offsets for window extra information */
#define STATE_GWL_OFFSET 0
#define HFONT_GWL_OFFSET (sizeof(LONG))
#define HIMAGE_GWL_OFFSET (
2*sizeof(LONG
))
#define NB_EXTRA_BYTES (
3*sizeof(LONG
))
#define HIMAGE_GWL_OFFSET (
HFONT_GWL_OFFSET+sizeof(HFONT
))
#define NB_EXTRA_BYTES (
HIMAGE_GWL_OFFSET+sizeof(HANDLE
))
/* Button state values */
#define BUTTON_UNCHECKED 0x00
...
...
@@ -125,12 +125,12 @@ inline static void set_button_state( HWND hwnd, LONG state )
inline
static
HFONT
get_button_font
(
HWND
hwnd
)
{
return
(
HFONT
)
GetWindowLongA
(
hwnd
,
HFONT_GWL_OFFSET
);
return
(
HFONT
)
GetWindowLong
Ptr
A
(
hwnd
,
HFONT_GWL_OFFSET
);
}
inline
static
void
set_button_font
(
HWND
hwnd
,
HFONT
font
)
{
SetWindowLong
A
(
hwnd
,
HFONT_GWL_OFFSET
,
(
LONG
)
font
);
SetWindowLong
PtrA
(
hwnd
,
HFONT_GWL_OFFSET
,
(
LONG_PTR
)
font
);
}
inline
static
UINT
get_button_type
(
LONG
window_style
)
...
...
@@ -248,7 +248,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
btn_type
==
BS_OWNERDRAW
)
{
SendMessageW
(
GetParent
(
hWnd
),
WM_COMMAND
,
MAKEWPARAM
(
GetWindowLong
A
(
hWnd
,
GWL
_ID
),
BN_DOUBLECLICKED
),
MAKEWPARAM
(
GetWindowLong
PtrA
(
hWnd
,
GWLP
_ID
),
BN_DOUBLECLICKED
),
(
LPARAM
)
hWnd
);
break
;
}
...
...
@@ -294,7 +294,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
break
;
}
SendMessageW
(
GetParent
(
hWnd
),
WM_COMMAND
,
MAKEWPARAM
(
GetWindowLong
A
(
hWnd
,
GWL
_ID
),
BN_CLICKED
),
(
LPARAM
)
hWnd
);
MAKEWPARAM
(
GetWindowLong
PtrA
(
hWnd
,
GWLP
_ID
),
BN_CLICKED
),
(
LPARAM
)
hWnd
);
}
break
;
...
...
@@ -407,7 +407,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
return
(
LRESULT
)
oldHbitmap
;
case
BM_GETIMAGE
:
return
GetWindowLongA
(
hWnd
,
HIMAGE_GWL_OFFSET
);
return
GetWindowLong
Ptr
A
(
hWnd
,
HIMAGE_GWL_OFFSET
);
case
BM_GETCHECK16
:
case
BM_GETCHECK
:
...
...
@@ -568,7 +568,7 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc)
break
;
case
BS_ICON
:
if
(
!
GetIconInfo
((
HICON
)
GetWindowLongA
(
hwnd
,
HIMAGE_GWL_OFFSET
),
&
iconInfo
))
if
(
!
GetIconInfo
((
HICON
)
GetWindowLong
Ptr
A
(
hwnd
,
HIMAGE_GWL_OFFSET
),
&
iconInfo
))
goto
empty_rect
;
GetObjectW
(
iconInfo
.
hbmColor
,
sizeof
(
BITMAP
),
&
bm
);
...
...
@@ -581,7 +581,7 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc)
break
;
case
BS_BITMAP
:
if
(
!
GetObjectW
(
(
HANDLE
)
GetWindowLongA
(
hwnd
,
HIMAGE_GWL_OFFSET
),
sizeof
(
BITMAP
),
&
bm
))
if
(
!
GetObjectW
(
(
HANDLE
)
GetWindowLong
Ptr
A
(
hwnd
,
HIMAGE_GWL_OFFSET
),
sizeof
(
BITMAP
),
&
bm
))
goto
empty_rect
;
r
.
right
=
r
.
left
+
bm
.
bmWidth
;
...
...
@@ -686,12 +686,12 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, RECT *rc)
case
BS_ICON
:
flags
|=
DST_ICON
;
lp
=
GetWindowLongA
(
hwnd
,
HIMAGE_GWL_OFFSET
);
lp
=
GetWindowLong
Ptr
A
(
hwnd
,
HIMAGE_GWL_OFFSET
);
break
;
case
BS_BITMAP
:
flags
|=
DST_BITMAP
;
lp
=
GetWindowLongA
(
hwnd
,
HIMAGE_GWL_OFFSET
);
lp
=
GetWindowLong
Ptr
A
(
hwnd
,
HIMAGE_GWL_OFFSET
);
break
;
default:
...
...
@@ -1033,7 +1033,7 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
DRAWITEMSTRUCT
dis
;
HRGN
clipRegion
;
RECT
clipRect
;
UINT
id
=
GetWindowLongA
(
hwnd
,
GWL
_ID
);
LONG_PTR
id
=
GetWindowLongPtrA
(
hwnd
,
GWLP
_ID
);
HWND
parent
;
dis
.
CtlType
=
ODT_BUTTON
;
...
...
controls/combo.c
View file @
2e9436c0
...
...
@@ -49,7 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(combo);
#define CB_NOTIFY( lphc, code ) \
(SendMessageW((lphc)->owner, WM_COMMAND, \
MAKEWPARAM(GetWindowLong
A((lphc)->self,GWL
_ID), (code)), (LPARAM)(lphc)->self))
MAKEWPARAM(GetWindowLong
PtrA((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))
...
...
@@ -243,7 +243,7 @@ static INT CBGetTextAreaHeight(
MEASUREITEMSTRUCT
measureItem
;
RECT
clientRect
;
INT
originalItemHeight
=
iTextItemHeight
;
UINT
id
=
GetWindowLongA
(
lphc
->
self
,
GWL
_ID
);
UINT
id
=
(
UINT
)
GetWindowLongPtrA
(
lphc
->
self
,
GWLP
_ID
);
/*
* We use the client rect for the width of the item.
...
...
@@ -586,7 +586,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
)
GetWindowLong
A
(
hwnd
,
GWL
_HINSTANCE
),
lphc
);
(
HINSTANCE
)
GetWindowLong
PtrA
(
hwnd
,
GWLP
_HINSTANCE
),
lphc
);
else
lphc
->
hWndLBox
=
CreateWindowExA
(
lbeExStyle
,
"ComboLBox"
,
NULL
,
lbeStyle
,
lphc
->
droppedRect
.
left
,
...
...
@@ -594,7 +594,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
)
GetWindowLong
A
(
hwnd
,
GWL
_HINSTANCE
),
lphc
);
(
HINSTANCE
)
GetWindowLong
PtrA
(
hwnd
,
GWLP
_HINSTANCE
),
lphc
);
if
(
lphc
->
hWndLBox
)
{
...
...
@@ -620,14 +620,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
)
GetWindowLong
A
(
hwnd
,
GWL
_HINSTANCE
),
NULL
);
(
HINSTANCE
)
GetWindowLong
PtrA
(
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
)
GetWindowLong
A
(
hwnd
,
GWL
_HINSTANCE
),
NULL
);
(
HINSTANCE
)
GetWindowLong
PtrA
(
hwnd
,
GWLP
_HINSTANCE
),
NULL
);
if
(
!
lphc
->
hWndEdit
)
bEdit
=
FALSE
;
...
...
@@ -739,7 +739,7 @@ static void CBPaintText(
{
DRAWITEMSTRUCT
dis
;
HRGN
clipRegion
;
UINT
ctlid
=
GetWindowLongA
(
lphc
->
self
,
GWL
_ID
);
UINT
ctlid
=
(
UINT
)
GetWindowLongPtrA
(
lphc
->
self
,
GWLP
_ID
);
/* setup state for DRAWITEM message. Owner will highlight */
if
(
(
lphc
->
wState
&
CBF_FOCUSED
)
&&
...
...
@@ -1402,7 +1402,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
=
GetWindowLongA
(
hWnd
,
GWL
_ID
);
UINT
id
=
(
UINT
)
GetWindowLongPtrA
(
hWnd
,
GWLP
_ID
);
TRACE
(
"[%p]: ownerdraw op %04x
\n
"
,
lphc
->
self
,
msg
);
...
...
controls/edit.c
View file @
2e9436c0
...
...
@@ -159,7 +159,7 @@ typedef struct
{
/* Notify parent which has created this edit control */
\
TRACE("notification " str " sent to hwnd=%p\n", es->hwndParent); \
SendMessageW(es->hwndParent, WM_COMMAND, \
MAKEWPARAM(GetWindowLong
W((es->hwndSelf),GWL
_ID), wNotifyCode), \
MAKEWPARAM(GetWindowLong
PtrW((es->hwndSelf),GWLP
_ID), wNotifyCode), \
(LPARAM)(es->hwndSelf)); \
} while(0)
...
...
@@ -1535,7 +1535,7 @@ static LPWSTR EDIT_GetPasswordPointer_SL(EDITSTATE *es)
*/
static
void
EDIT_LockBuffer
(
EDITSTATE
*
es
)
{
HINSTANCE16
hInstance
=
GetWindowLong
W
(
es
->
hwndSelf
,
GWL
_HINSTANCE
);
HINSTANCE16
hInstance
=
GetWindowLong
PtrW
(
es
->
hwndSelf
,
GWLP
_HINSTANCE
);
if
(
!
es
->
text
)
{
CHAR
*
textA
=
NULL
;
UINT
countA
=
0
;
...
...
@@ -2202,7 +2202,7 @@ static void EDIT_SetRectNP(EDITSTATE *es, LPRECT rc)
*/
static
void
EDIT_UnlockBuffer
(
EDITSTATE
*
es
,
BOOL
force
)
{
HINSTANCE16
hInstance
=
GetWindowLong
W
(
es
->
hwndSelf
,
GWL
_HINSTANCE
);
HINSTANCE16
hInstance
=
GetWindowLong
PtrW
(
es
->
hwndSelf
,
GWLP
_HINSTANCE
);
/* Edit window might be already destroyed */
if
(
!
IsWindow
(
es
->
hwndSelf
))
...
...
@@ -2512,7 +2512,7 @@ static HLOCAL EDIT_EM_GetHandle(EDITSTATE *es)
*/
static
HLOCAL16
EDIT_EM_GetHandle16
(
EDITSTATE
*
es
)
{
HINSTANCE16
hInstance
=
GetWindowLong
W
(
es
->
hwndSelf
,
GWL
_HINSTANCE
);
HINSTANCE16
hInstance
=
GetWindowLong
PtrW
(
es
->
hwndSelf
,
GWLP
_HINSTANCE
);
CHAR
*
textA
;
UINT
countA
,
alloc_size
;
...
...
@@ -3152,7 +3152,7 @@ static void EDIT_EM_ScrollCaret(EDITSTATE *es)
*/
static
void
EDIT_EM_SetHandle
(
EDITSTATE
*
es
,
HLOCAL
hloc
)
{
HINSTANCE16
hInstance
=
GetWindowLong
W
(
es
->
hwndSelf
,
GWL
_HINSTANCE
);
HINSTANCE16
hInstance
=
GetWindowLong
PtrW
(
es
->
hwndSelf
,
GWLP
_HINSTANCE
);
if
(
!
(
es
->
style
&
ES_MULTILINE
))
return
;
...
...
@@ -3232,7 +3232,7 @@ static void EDIT_EM_SetHandle(EDITSTATE *es, HLOCAL hloc)
*/
static
void
EDIT_EM_SetHandle16
(
EDITSTATE
*
es
,
HLOCAL16
hloc
)
{
HINSTANCE16
hInstance
=
GetWindowLong
W
(
es
->
hwndSelf
,
GWL
_HINSTANCE
);
HINSTANCE16
hInstance
=
GetWindowLong
PtrW
(
es
->
hwndSelf
,
GWLP
_HINSTANCE
);
INT
countW
,
countA
;
HLOCAL
hloc32W_new
;
WCHAR
*
textW
;
...
...
@@ -3823,7 +3823,7 @@ static LRESULT EDIT_WM_Destroy(EDITSTATE *es)
LocalFree
(
es
->
hloc32A
);
}
if
(
es
->
hloc16
)
{
HINSTANCE16
hInstance
=
GetWindow
Word
(
es
->
hwndSelf
,
GWL
_HINSTANCE
);
HINSTANCE16
hInstance
=
GetWindow
LongPtrW
(
es
->
hwndSelf
,
GWLP
_HINSTANCE
);
while
(
LOCAL_Unlock
(
hInstance
,
es
->
hloc16
))
;
LOCAL_Free
(
hInstance
,
es
->
hloc16
);
}
...
...
controls/icontitle.c
View file @
2e9436c0
...
...
@@ -62,7 +62,7 @@ const struct builtin_class_descr ICONTITLE_builtin_class =
HWND
ICONTITLE_Create
(
HWND
owner
)
{
HWND
hWnd
;
HINSTANCE
instance
=
(
HINSTANCE
)
GetWindowLong
A
(
owner
,
GWL
_HINSTANCE
);
HINSTANCE
instance
=
(
HINSTANCE
)
GetWindowLong
PtrA
(
owner
,
GWLP
_HINSTANCE
);
LONG
style
=
WS_CLIPSIBLINGS
;
if
(
!
IsWindowEnabled
(
owner
))
style
|=
WS_DISABLED
;
...
...
controls/listbox.c
View file @
2e9436c0
...
...
@@ -110,7 +110,7 @@ typedef struct
#define SEND_NOTIFICATION(hwnd,descr,code) \
(SendMessageW( (descr)->owner, WM_COMMAND, \
MAKEWPARAM( GetWindowLong
A((hwnd),GWL
_ID), (code)), (LPARAM)(hwnd) ))
MAKEWPARAM( GetWindowLong
PtrW((hwnd),GWLP
_ID), (code)), (LPARAM)(hwnd) ))
#define ISWIN31 (LOWORD(GetVersion()) == 0x0a03)
...
...
@@ -166,7 +166,7 @@ const struct builtin_class_descr COMBOLBOX_builtin_class =
/* check whether app is a Win 3.1 app */
inline
static
BOOL
is_old_app
(
HWND
hwnd
)
{
return
(
GetExpWinVer16
(
GetWindowLong
A
(
hwnd
,
GWL
_HINSTANCE
)
)
&
0xFF00
)
==
0x0300
;
return
(
GetExpWinVer16
(
GetWindowLong
PtrW
(
hwnd
,
GWLP
_HINSTANCE
)
)
&
0xFF00
)
==
0x0300
;
}
...
...
@@ -557,7 +557,7 @@ static void LISTBOX_PaintItem( HWND hwnd, LB_DESCR *descr, HDC hdc,
DRAWITEMSTRUCT
dis
;
RECT
r
;
HRGN
hrgn
;
UINT
id
=
GetWindowLongA
(
hwnd
,
GWL
_ID
);
UINT
id
=
(
UINT
)
GetWindowLongPtrW
(
hwnd
,
GWLP
_ID
);
if
(
!
item
)
{
...
...
@@ -823,7 +823,7 @@ static INT LISTBOX_FindStringPos( HWND hwnd, LB_DESCR *descr, LPCWSTR str,
else
{
COMPAREITEMSTRUCT
cis
;
UINT
id
=
GetWindowLongA
(
hwnd
,
GWL
_ID
);
UINT
id
=
(
UINT
)
GetWindowLongPtrW
(
hwnd
,
GWLP
_ID
);
cis
.
CtlType
=
ODT_LISTBOX
;
cis
.
CtlID
=
id
;
...
...
@@ -1528,7 +1528,7 @@ static LRESULT LISTBOX_InsertItem( HWND hwnd, LB_DESCR *descr, INT index,
if
(
descr
->
style
&
LBS_OWNERDRAWVARIABLE
)
{
MEASUREITEMSTRUCT
mis
;
UINT
id
=
GetWindowLongA
(
hwnd
,
GWL
_ID
);
UINT
id
=
(
UINT
)
GetWindowLongPtrW
(
hwnd
,
GWLP
_ID
);
mis
.
CtlType
=
ODT_LISTBOX
;
mis
.
CtlID
=
id
;
...
...
@@ -1619,7 +1619,7 @@ static void LISTBOX_DeleteItem( HWND hwnd, LB_DESCR *descr, INT index )
if
(
IS_OWNERDRAW
(
descr
)
||
descr
->
items
[
index
].
data
)
{
DELETEITEMSTRUCT
dis
;
UINT
id
=
GetWindowLongA
(
hwnd
,
GWL
_ID
);
UINT
id
=
(
UINT
)
GetWindowLongPtrW
(
hwnd
,
GWLP
_ID
);
dis
.
CtlType
=
ODT_LISTBOX
;
dis
.
CtlID
=
id
;
...
...
@@ -2475,7 +2475,7 @@ static BOOL LISTBOX_Create( HWND hwnd, LPHEADCOMBO lphc )
}
else
{
UINT
id
=
GetWindowLongA
(
hwnd
,
GWL
_ID
);
UINT
id
=
(
UINT
)
GetWindowLongPtrW
(
hwnd
,
GWLP
_ID
);
mis
.
CtlType
=
ODT_LISTBOX
;
mis
.
CtlID
=
id
;
mis
.
itemID
=
-
1
;
...
...
controls/menu.c
View file @
2e9436c0
...
...
@@ -1505,7 +1505,7 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
/* NOTE: In Windows, top menu popup is not owned. */
menu
->
hWnd
=
CreateWindowExW
(
0
,
POPUPMENU_CLASS_ATOMW
,
NULL
,
WS_POPUP
,
x
,
y
,
width
,
height
,
hwndOwner
,
0
,
(
HINSTANCE
)
GetWindowLong
W
(
hwndOwner
,
GWL
_HINSTANCE
),
hwndOwner
,
0
,
(
HINSTANCE
)
GetWindowLong
PtrW
(
hwndOwner
,
GWLP
_HINSTANCE
),
(
LPVOID
)
hmenu
);
if
(
!
menu
->
hWnd
)
return
FALSE
;
if
(
!
top_popup
)
top_popup
=
menu
->
hWnd
;
...
...
@@ -2562,6 +2562,7 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
fEndMenu
=
FALSE
;
if
(
!
(
menu
=
MENU_GetMenu
(
hmenu
)))
{
WARN
(
"Invalid menu handle %p
\n
"
,
hmenu
);
SetLastError
(
ERROR_INVALID_MENU_HANDLE
);
return
FALSE
;
}
...
...
@@ -3648,7 +3649,7 @@ BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu )
*/
HMENU
WINAPI
GetMenu
(
HWND
hWnd
)
{
HMENU
retvalue
=
(
HMENU
)
GetWindowLong
W
(
hWnd
,
GWL
_ID
);
HMENU
retvalue
=
(
HMENU
)
GetWindowLong
PtrW
(
hWnd
,
GWLP
_ID
);
TRACE
(
"for %p returning %p
\n
"
,
hWnd
,
retvalue
);
return
retvalue
;
}
...
...
@@ -3683,7 +3684,7 @@ BOOL MENU_SetMenu( HWND hWnd, HMENU hMenu )
lpmenu
->
hWnd
=
hWnd
;
lpmenu
->
Height
=
0
;
/* Make sure we recalculate the size */
}
SetWindowLong
W
(
hWnd
,
GWL
_ID
,
(
LONG_PTR
)
hMenu
);
SetWindowLong
PtrW
(
hWnd
,
GWLP
_ID
,
(
LONG_PTR
)
hMenu
);
return
TRUE
;
}
...
...
controls/static.c
View file @
2e9436c0
...
...
@@ -104,7 +104,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
ERR
(
"huh? hicon!=0, but info=0???
\n
"
);
return
0
;
}
prevIcon
=
(
HICON
)
SetWindowLong
A
(
hwnd
,
HICON_GWL_OFFSET
,
(
LONG
)
hicon
);
prevIcon
=
(
HICON
)
SetWindowLong
PtrW
(
hwnd
,
HICON_GWL_OFFSET
,
(
LONG_PTR
)
hicon
);
if
(
hicon
)
{
SetWindowPos
(
hwnd
,
0
,
0
,
0
,
info
->
nWidth
,
info
->
nHeight
,
...
...
@@ -128,7 +128,7 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
ERR
(
"huh? hBitmap!=0, but not bitmap
\n
"
);
return
0
;
}
hOldBitmap
=
(
HBITMAP
)
SetWindowLong
A
(
hwnd
,
HICON_GWL_OFFSET
,
(
LONG
)
hBitmap
);
hOldBitmap
=
(
HBITMAP
)
SetWindowLong
PtrA
(
hwnd
,
HICON_GWL_OFFSET
,
(
LONG_PTR
)
hBitmap
);
if
(
hBitmap
)
{
BITMAP
bm
;
...
...
@@ -146,7 +146,7 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
*/
static
HICON
STATIC_LoadIconA
(
HWND
hwnd
,
LPCSTR
name
)
{
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLong
A
(
hwnd
,
GWL
_HINSTANCE
);
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLong
PtrW
(
hwnd
,
GWLP
_HINSTANCE
);
HICON
hicon
=
LoadIconA
(
hInstance
,
name
);
if
(
!
hicon
)
hicon
=
LoadIconA
(
0
,
name
);
return
hicon
;
...
...
@@ -159,7 +159,7 @@ static HICON STATIC_LoadIconA( HWND hwnd, LPCSTR name )
*/
static
HICON
STATIC_LoadIconW
(
HWND
hwnd
,
LPCWSTR
name
)
{
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLong
A
(
hwnd
,
GWL
_HINSTANCE
);
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLong
PtrW
(
hwnd
,
GWLP
_HINSTANCE
);
HICON
hicon
=
LoadIconW
(
hInstance
,
name
);
if
(
!
hicon
)
hicon
=
LoadIconW
(
0
,
name
);
return
hicon
;
...
...
@@ -172,7 +172,7 @@ static HICON STATIC_LoadIconW( HWND hwnd, LPCWSTR name )
*/
static
HBITMAP
STATIC_LoadBitmapA
(
HWND
hwnd
,
LPCSTR
name
)
{
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLong
A
(
hwnd
,
GWL
_HINSTANCE
);
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLong
PtrW
(
hwnd
,
GWLP
_HINSTANCE
);
HBITMAP
hbitmap
=
LoadBitmapA
(
hInstance
,
name
);
if
(
!
hbitmap
)
/* Try OEM icon (FIXME: is this right?) */
hbitmap
=
LoadBitmapA
(
0
,
name
);
...
...
@@ -186,7 +186,7 @@ static HBITMAP STATIC_LoadBitmapA( HWND hwnd, LPCSTR name )
*/
static
HBITMAP
STATIC_LoadBitmapW
(
HWND
hwnd
,
LPCWSTR
name
)
{
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLong
A
(
hwnd
,
GWL
_HINSTANCE
);
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLong
PtrW
(
hwnd
,
GWLP
_HINSTANCE
);
HBITMAP
hbitmap
=
LoadBitmapW
(
hInstance
,
name
);
if
(
!
hbitmap
)
/* Try OEM icon (FIXME: is this right?) */
hbitmap
=
LoadBitmapW
(
0
,
name
);
...
...
@@ -338,13 +338,13 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
case
WM_SETFONT
:
if
((
style
==
SS_ICON
)
||
(
style
==
SS_BITMAP
))
return
0
;
SetWindowLong
A
(
hwnd
,
HFONT_GWL_OFFSET
,
wParam
);
SetWindowLong
PtrW
(
hwnd
,
HFONT_GWL_OFFSET
,
wParam
);
if
(
LOWORD
(
lParam
))
InvalidateRect
(
hwnd
,
NULL
,
TRUE
);
break
;
case
WM_GETFONT
:
return
GetWindowLong
A
(
hwnd
,
HFONT_GWL_OFFSET
);
return
GetWindowLong
PtrW
(
hwnd
,
HFONT_GWL_OFFSET
);
case
WM_NCHITTEST
:
if
(
full_style
&
SS_NOTIFY
)
...
...
@@ -359,20 +359,20 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
case
WM_NCLBUTTONDOWN
:
if
(
full_style
&
SS_NOTIFY
)
SendMessageW
(
GetParent
(
hwnd
),
WM_COMMAND
,
MAKEWPARAM
(
GetWindowLong
W
(
hwnd
,
GWL
_ID
),
STN_CLICKED
),
(
LPARAM
)
hwnd
);
MAKEWPARAM
(
GetWindowLong
PtrW
(
hwnd
,
GWLP
_ID
),
STN_CLICKED
),
(
LPARAM
)
hwnd
);
return
0
;
case
WM_LBUTTONDBLCLK
:
case
WM_NCLBUTTONDBLCLK
:
if
(
full_style
&
SS_NOTIFY
)
SendMessageW
(
GetParent
(
hwnd
),
WM_COMMAND
,
MAKEWPARAM
(
GetWindowLong
W
(
hwnd
,
GWL
_ID
),
STN_DBLCLK
),
(
LPARAM
)
hwnd
);
MAKEWPARAM
(
GetWindowLong
PtrW
(
hwnd
,
GWLP
_ID
),
STN_DBLCLK
),
(
LPARAM
)
hwnd
);
return
0
;
case
STM_GETIMAGE
:
case
STM_GETICON16
:
case
STM_GETICON
:
return
GetWindowLong
A
(
hwnd
,
HICON_GWL_OFFSET
);
return
GetWindowLong
PtrW
(
hwnd
,
HICON_GWL_OFFSET
);
case
STM_SETIMAGE
:
switch
(
wParam
)
{
...
...
@@ -423,7 +423,7 @@ static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
static
void
STATIC_PaintOwnerDrawfn
(
HWND
hwnd
,
HDC
hdc
,
DWORD
style
)
{
DRAWITEMSTRUCT
dis
;
LONG
id
=
GetWindowLongA
(
hwnd
,
GWL
_ID
);
UINT
id
=
(
UINT
)
GetWindowLongPtrW
(
hwnd
,
GWLP
_ID
);
dis
.
CtlType
=
ODT_STATIC
;
dis
.
CtlID
=
id
;
...
...
@@ -479,7 +479,7 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style )
if
(
style
&
SS_NOPREFIX
)
wFormat
|=
DT_NOPREFIX
;
if
((
hFont
=
(
HFONT
)
GetWindowLong
A
(
hwnd
,
HFONT_GWL_OFFSET
)))
SelectObject
(
hdc
,
hFont
);
if
((
hFont
=
(
HFONT
)
GetWindowLong
PtrW
(
hwnd
,
HFONT_GWL_OFFSET
)))
SelectObject
(
hdc
,
hFont
);
if
((
style
&
SS_NOPREFIX
)
||
((
style
&
SS_TYPEMASK
)
!=
SS_SIMPLE
))
{
...
...
@@ -549,7 +549,7 @@ static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style )
hbrush
=
(
HBRUSH
)
SendMessageW
(
GetParent
(
hwnd
),
WM_CTLCOLORSTATIC
,
(
WPARAM
)
hdc
,
(
LPARAM
)
hwnd
);
FillRect
(
hdc
,
&
rc
,
hbrush
);
if
((
hIcon
=
(
HICON
)
GetWindowLong
A
(
hwnd
,
HICON_GWL_OFFSET
)))
if
((
hIcon
=
(
HICON
)
GetWindowLong
PtrW
(
hwnd
,
HICON_GWL_OFFSET
)))
DrawIcon
(
hdc
,
rc
.
left
,
rc
.
top
,
hIcon
);
}
...
...
@@ -562,7 +562,7 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
SendMessageW
(
GetParent
(
hwnd
),
WM_CTLCOLORSTATIC
,
(
WPARAM
)
hdc
,
(
LPARAM
)
hwnd
);
if
((
hBitmap
=
(
HBITMAP
)
GetWindowLong
A
(
hwnd
,
HICON_GWL_OFFSET
)))
if
((
hBitmap
=
(
HBITMAP
)
GetWindowLong
PtrW
(
hwnd
,
HICON_GWL_OFFSET
)))
{
BITMAP
bm
;
...
...
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