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
695e3928
Commit
695e3928
authored
Nov 08, 2005
by
Vincent Béron
Committed by
Alexandre Julliard
Nov 08, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unicodify systray.c.
parent
ef6d5df1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
35 deletions
+39
-35
systray.c
dlls/shell32/systray.c
+39
-35
No files found.
dlls/shell32/systray.c
View file @
695e3928
...
...
@@ -46,7 +46,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
typedef
struct
SystrayItem
{
HWND
hWnd
;
HWND
hWndToolTip
;
NOTIFYICONDATA
A
notifyIcon
;
NOTIFYICONDATA
W
notifyIcon
;
struct
SystrayItem
*
nextTrayItem
;
}
SystrayItem
;
...
...
@@ -60,7 +60,7 @@ static int firstSystray=TRUE; /* defer creation of window class until first syst
static
BOOL
SYSTRAY_ItemIsEqual
(
PNOTIFYICONDATA
A
pnid1
,
PNOTIFYICONDATAA
pnid2
)
static
BOOL
SYSTRAY_ItemIsEqual
(
PNOTIFYICONDATA
W
pnid1
,
PNOTIFYICONDATAW
pnid2
)
{
if
(
pnid1
->
hWnd
!=
pnid2
->
hWnd
)
return
FALSE
;
if
(
pnid1
->
uID
!=
pnid2
->
uID
)
return
FALSE
;
...
...
@@ -80,14 +80,14 @@ static void SYSTRAY_ItemTerm(SystrayItem *ptrayItem)
}
static
BOOL
SYSTRAY_Delete
(
PNOTIFYICONDATA
A
pnid
)
static
BOOL
SYSTRAY_Delete
(
PNOTIFYICONDATA
W
pnid
)
{
SystrayItem
**
ptrayItem
=
&
systray
;
while
(
*
ptrayItem
)
{
if
(
SYSTRAY_ItemIsEqual
(
pnid
,
&
(
*
ptrayItem
)
->
notifyIcon
))
{
SystrayItem
*
next
=
(
*
ptrayItem
)
->
nextTrayItem
;
TRACE
(
"%p: %p %s
\n
"
,
*
ptrayItem
,
(
*
ptrayItem
)
->
notifyIcon
.
hWnd
,
(
*
ptrayItem
)
->
notifyIcon
.
szTip
);
TRACE
(
"%p: %p %s
\n
"
,
*
ptrayItem
,
(
*
ptrayItem
)
->
notifyIcon
.
hWnd
,
debugstr_w
((
*
ptrayItem
)
->
notifyIcon
.
szTip
)
);
SYSTRAY_ItemTerm
(
*
ptrayItem
);
HeapFree
(
GetProcessHeap
(),
0
,
*
ptrayItem
);
...
...
@@ -152,7 +152,7 @@ static LRESULT CALLBACK SYSTRAY_WndProc(HWND hWnd, UINT message, WPARAM wParam,
msg
.
pt
.
x
=
LOWORD
(
GetMessagePos
());
msg
.
pt
.
y
=
HIWORD
(
GetMessagePos
());
SendMessage
A
(
ptrayItem
->
hWndToolTip
,
TTM_RELAYEVENT
,
0
,
(
LPARAM
)
&
msg
);
SendMessage
W
(
ptrayItem
->
hWndToolTip
,
TTM_RELAYEVENT
,
0
,
(
LPARAM
)
&
msg
);
}
ptrayItem
=
ptrayItem
->
nextTrayItem
;
}
...
...
@@ -168,7 +168,7 @@ static LRESULT CALLBACK SYSTRAY_WndProc(HWND hWnd, UINT message, WPARAM wParam,
while
(
ptrayItem
)
{
if
(
ptrayItem
->
hWnd
==
hWnd
)
{
if
(
ptrayItem
->
notifyIcon
.
hWnd
&&
ptrayItem
->
notifyIcon
.
uCallbackMessage
)
{
if
(
!
PostMessage
A
(
ptrayItem
->
notifyIcon
.
hWnd
,
ptrayItem
->
notifyIcon
.
uCallbackMessage
,
if
(
!
PostMessage
W
(
ptrayItem
->
notifyIcon
.
hWnd
,
ptrayItem
->
notifyIcon
.
uCallbackMessage
,
(
WPARAM
)
ptrayItem
->
notifyIcon
.
uID
,
(
LPARAM
)
message
))
{
ERR
(
"PostMessage(SystrayWindow %p) failed -> removing SystrayItem %p
\n
"
,
hWnd
,
ptrayItem
);
SYSTRAY_Delete
(
&
ptrayItem
->
notifyIcon
);
...
...
@@ -182,7 +182,7 @@ static LRESULT CALLBACK SYSTRAY_WndProc(HWND hWnd, UINT message, WPARAM wParam,
break
;
default:
return
(
DefWindowProc
A
(
hWnd
,
message
,
wParam
,
lParam
));
return
(
DefWindowProc
W
(
hWnd
,
message
,
wParam
,
lParam
));
}
return
(
0
);
...
...
@@ -191,7 +191,8 @@ static LRESULT CALLBACK SYSTRAY_WndProc(HWND hWnd, UINT message, WPARAM wParam,
static
BOOL
SYSTRAY_RegisterClass
(
void
)
{
WNDCLASSA
wc
;
WNDCLASSW
wc
;
static
const
WCHAR
WineSystrayW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'S'
,
'y'
,
's'
,
't'
,
'r'
,
'a'
,
'y'
,
0
};
wc
.
style
=
CS_SAVEBITS
|
CS_DBLCLKS
;
wc
.
lpfnWndProc
=
SYSTRAY_WndProc
;
...
...
@@ -199,12 +200,12 @@ static BOOL SYSTRAY_RegisterClass(void)
wc
.
cbWndExtra
=
0
;
wc
.
hInstance
=
0
;
wc
.
hIcon
=
0
;
wc
.
hCursor
=
LoadCursor
A
(
0
,
(
LP
STR
)
IDC_ARROW
);
wc
.
hCursor
=
LoadCursor
W
(
0
,
(
LPW
STR
)
IDC_ARROW
);
wc
.
hbrBackground
=
(
HBRUSH
)(
COLOR_WINDOW
+
1
);
wc
.
lpszMenuName
=
NULL
;
wc
.
lpszClassName
=
"WineSystray"
;
wc
.
lpszClassName
=
WineSystrayW
;
if
(
!
RegisterClass
A
(
&
wc
))
{
if
(
!
RegisterClass
W
(
&
wc
))
{
ERR
(
"RegisterClass(WineSystray) failed
\n
"
);
return
FALSE
;
}
...
...
@@ -215,6 +216,8 @@ static BOOL SYSTRAY_RegisterClass(void)
static
BOOL
SYSTRAY_ItemInit
(
SystrayItem
*
ptrayItem
)
{
RECT
rect
;
static
const
WCHAR
WineSystrayW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'S'
,
'y'
,
's'
,
't'
,
'r'
,
'a'
,
'y'
,
0
};
static
const
WCHAR
Wine_SystrayW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'-'
,
'S'
,
'y'
,
's'
,
't'
,
'r'
,
'a'
,
'y'
,
0
};
/* Register the class if this is our first tray item. */
if
(
firstSystray
)
{
...
...
@@ -233,8 +236,8 @@ static BOOL SYSTRAY_ItemInit(SystrayItem *ptrayItem)
ZeroMemory
(
ptrayItem
,
sizeof
(
SystrayItem
)
);
/* Create tray window for icon. */
ptrayItem
->
hWnd
=
CreateWindowEx
A
(
WS_EX_TRAYWINDOW
,
"WineSystray"
,
"Wine-Systray"
,
ptrayItem
->
hWnd
=
CreateWindowEx
W
(
WS_EX_TRAYWINDOW
,
WineSystrayW
,
Wine_SystrayW
,
WS_VISIBLE
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
...
...
@@ -245,7 +248,7 @@ static BOOL SYSTRAY_ItemInit(SystrayItem *ptrayItem)
}
/* Create tooltip for icon. */
ptrayItem
->
hWndToolTip
=
CreateWindow
A
(
TOOLTIPS_CLASSA
,
NULL
,
TTS_ALWAYSTIP
,
ptrayItem
->
hWndToolTip
=
CreateWindow
W
(
TOOLTIPS_CLASSW
,
NULL
,
TTS_ALWAYSTIP
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
ptrayItem
->
hWnd
,
0
,
0
,
0
);
...
...
@@ -272,13 +275,13 @@ static void SYSTRAY_ItemSetIcon(SystrayItem *ptrayItem, HICON hIcon)
}
static
void
SYSTRAY_ItemSetTip
(
SystrayItem
*
ptrayItem
,
CHAR
*
szTip
,
int
modify
)
static
void
SYSTRAY_ItemSetTip
(
SystrayItem
*
ptrayItem
,
const
W
CHAR
*
szTip
,
int
modify
)
{
TTTOOLINFO
A
ti
;
TTTOOLINFO
W
ti
;
lstrcpyn
A
(
ptrayItem
->
notifyIcon
.
szTip
,
szTip
,
sizeof
(
ptrayItem
->
notifyIcon
.
szTip
));
lstrcpyn
W
(
ptrayItem
->
notifyIcon
.
szTip
,
szTip
,
sizeof
(
ptrayItem
->
notifyIcon
.
szTip
)
/
sizeof
(
WCHAR
));
ti
.
cbSize
=
sizeof
(
TTTOOLINFO
A
);
ti
.
cbSize
=
sizeof
(
TTTOOLINFO
W
);
ti
.
uFlags
=
0
;
ti
.
hwnd
=
ptrayItem
->
hWnd
;
ti
.
hinst
=
0
;
...
...
@@ -290,15 +293,16 @@ static void SYSTRAY_ItemSetTip(SystrayItem *ptrayItem, CHAR* szTip, int modify)
ti
.
rect
.
bottom
=
ICON_SIZE
+
2
*
ICON_BORDER
;
if
(
modify
)
SendMessage
A
(
ptrayItem
->
hWndToolTip
,
TTM_UPDATETIPTEXTA
,
0
,
(
LPARAM
)
&
ti
);
SendMessage
W
(
ptrayItem
->
hWndToolTip
,
TTM_UPDATETIPTEXTW
,
0
,
(
LPARAM
)
&
ti
);
else
SendMessage
A
(
ptrayItem
->
hWndToolTip
,
TTM_ADDTOOLA
,
0
,
(
LPARAM
)
&
ti
);
SendMessage
W
(
ptrayItem
->
hWndToolTip
,
TTM_ADDTOOLW
,
0
,
(
LPARAM
)
&
ti
);
}
static
BOOL
SYSTRAY_Add
(
PNOTIFYICONDATA
A
pnid
)
static
BOOL
SYSTRAY_Add
(
PNOTIFYICONDATA
W
pnid
)
{
SystrayItem
**
ptrayItem
=
&
systray
;
static
const
WCHAR
emptyW
[]
=
{
0
};
/* Find last element. */
while
(
*
ptrayItem
)
{
...
...
@@ -315,15 +319,15 @@ static BOOL SYSTRAY_Add(PNOTIFYICONDATAA pnid)
(
*
ptrayItem
)
->
notifyIcon
.
hWnd
=
pnid
->
hWnd
;
/* only needed for callback message */
SYSTRAY_ItemSetIcon
(
*
ptrayItem
,
(
pnid
->
uFlags
&
NIF_ICON
)
?
pnid
->
hIcon
:
0
);
SYSTRAY_ItemSetMessage
(
*
ptrayItem
,
(
pnid
->
uFlags
&
NIF_MESSAGE
)
?
pnid
->
uCallbackMessage
:
0
);
SYSTRAY_ItemSetTip
(
*
ptrayItem
,
(
pnid
->
uFlags
&
NIF_TIP
)
?
pnid
->
szTip
:
""
,
FALSE
);
SYSTRAY_ItemSetTip
(
*
ptrayItem
,
(
pnid
->
uFlags
&
NIF_TIP
)
?
pnid
->
szTip
:
emptyW
,
FALSE
);
TRACE
(
"%p: %p %s
\n
"
,
(
*
ptrayItem
),
(
*
ptrayItem
)
->
notifyIcon
.
hWnd
,
(
*
ptrayItem
)
->
notifyIcon
.
szTip
);
debugstr_w
((
*
ptrayItem
)
->
notifyIcon
.
szTip
)
);
return
TRUE
;
}
static
BOOL
SYSTRAY_Modify
(
PNOTIFYICONDATA
A
pnid
)
static
BOOL
SYSTRAY_Modify
(
PNOTIFYICONDATA
W
pnid
)
{
SystrayItem
*
ptrayItem
=
systray
;
...
...
@@ -336,7 +340,7 @@ static BOOL SYSTRAY_Modify(PNOTIFYICONDATAA pnid)
if
(
pnid
->
uFlags
&
NIF_TIP
)
SYSTRAY_ItemSetTip
(
ptrayItem
,
pnid
->
szTip
,
TRUE
);
TRACE
(
"%p: %p %s
\n
"
,
ptrayItem
,
ptrayItem
->
notifyIcon
.
hWnd
,
ptrayItem
->
notifyIcon
.
szTip
);
TRACE
(
"%p: %p %s
\n
"
,
ptrayItem
,
ptrayItem
->
notifyIcon
.
hWnd
,
debugstr_w
(
ptrayItem
->
notifyIcon
.
szTip
)
);
return
TRUE
;
}
ptrayItem
=
ptrayItem
->
nextTrayItem
;
...
...
@@ -354,10 +358,9 @@ BOOL SYSTRAY_Init(void)
}
/*************************************************************************
* Shell_NotifyIcon [SHELL32.296]
* Shell_NotifyIconA [SHELL32.297]
* Shell_NotifyIconW [SHELL32.298]
*/
BOOL
WINAPI
Shell_NotifyIcon
A
(
DWORD
dwMessage
,
PNOTIFYICONDATAA
pnid
)
BOOL
WINAPI
Shell_NotifyIcon
W
(
DWORD
dwMessage
,
PNOTIFYICONDATAW
pnid
)
{
BOOL
flag
=
FALSE
;
TRACE
(
"enter %p %d %ld
\n
"
,
pnid
->
hWnd
,
pnid
->
uID
,
dwMessage
);
...
...
@@ -377,18 +380,19 @@ BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid )
}
/*************************************************************************
* Shell_NotifyIconW [SHELL32.298]
* Shell_NotifyIcon [SHELL32.296]
* Shell_NotifyIconA [SHELL32.297]
*/
BOOL
WINAPI
Shell_NotifyIcon
W
(
DWORD
dwMessage
,
PNOTIFYICONDATAW
pnid
)
BOOL
WINAPI
Shell_NotifyIcon
A
(
DWORD
dwMessage
,
PNOTIFYICONDATAA
pnid
)
{
BOOL
ret
;
PNOTIFYICONDATA
A
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
NOTIFYICONDATAA
));
memcpy
(
p
,
pnid
,
sizeof
(
NOTIFYICONDATA
A
));
WideCharToMultiByte
(
CP_ACP
,
0
,
pnid
->
szTip
,
-
1
,
p
->
szTip
,
sizeof
(
p
->
szTip
),
NULL
,
NULL
);
p
->
szTip
[
sizeof
(
p
->
szTip
)
-
1
]
=
0
;
PNOTIFYICONDATA
W
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
NOTIFYICONDATAW
));
memcpy
(
p
,
pnid
,
sizeof
(
NOTIFYICONDATA
W
));
MultiByteToWideChar
(
CP_ACP
,
0
,
pnid
->
szTip
,
-
1
,
p
->
szTip
,
sizeof
(
p
->
szTip
)
/
sizeof
(
WCHAR
)
);
p
->
szTip
[
sizeof
(
p
->
szTip
)
/
sizeof
(
WCHAR
)
-
1
]
=
0
;
ret
=
Shell_NotifyIcon
A
(
dwMessage
,
p
);
ret
=
Shell_NotifyIcon
W
(
dwMessage
,
p
);
HeapFree
(
GetProcessHeap
(),
0
,
p
);
return
ret
;
...
...
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