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
992d0043
Commit
992d0043
authored
Aug 01, 2008
by
Vladimir Pankratov
Committed by
Alexandre Julliard
Aug 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskmgr: Converted some functions to Unicode.
parent
eb8a6f70
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
trayicon.c
programs/taskmgr/trayicon.c
+18
-16
No files found.
programs/taskmgr/trayicon.c
View file @
992d0043
...
...
@@ -26,13 +26,13 @@
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <stdio.h>
#include <winnt.h>
#include <shellapi.h>
#include "wine/unicode.h"
#include "taskmgr.h"
#include "perfdata.h"
#include "shellapi.h"
HICON
TrayIcon_GetProcessorUsageIcon
(
void
)
{
...
...
@@ -140,23 +140,24 @@ done:
BOOL
TrayIcon_ShellAddTrayIcon
(
void
)
{
NOTIFYICONDATA
nid
;
NOTIFYICONDATA
W
nid
;
HICON
hIcon
=
NULL
;
BOOL
bRetVal
;
WCHAR
wszCPU_Usage
[]
=
{
'C'
,
'P'
,
'U'
,
' '
,
'U'
,
's'
,
'a'
,
'g'
,
'e'
,
':'
,
' '
,
'%'
,
'd'
,
'%'
,
'%'
,
0
};
memset
(
&
nid
,
0
,
sizeof
(
NOTIFYICONDATA
));
memset
(
&
nid
,
0
,
sizeof
(
NOTIFYICONDATA
W
));
hIcon
=
TrayIcon_GetProcessorUsageIcon
();
nid
.
cbSize
=
sizeof
(
NOTIFYICONDATA
);
nid
.
cbSize
=
sizeof
(
NOTIFYICONDATA
W
);
nid
.
hWnd
=
hMainWnd
;
nid
.
uID
=
0
;
nid
.
uFlags
=
NIF_ICON
|
NIF_MESSAGE
|
NIF_TIP
;
nid
.
uCallbackMessage
=
WM_ONTRAYICON
;
nid
.
hIcon
=
hIcon
;
wsprintf
(
nid
.
szTip
,
_T
(
"CPU Usage: %d%%"
)
,
PerfDataGetProcessorUsage
());
wsprintf
W
(
nid
.
szTip
,
wszCPU_Usage
,
PerfDataGetProcessorUsage
());
bRetVal
=
Shell_NotifyIcon
(
NIM_ADD
,
&
nid
);
bRetVal
=
Shell_NotifyIcon
W
(
NIM_ADD
,
&
nid
);
if
(
hIcon
)
DestroyIcon
(
hIcon
);
...
...
@@ -166,41 +167,42 @@ BOOL TrayIcon_ShellAddTrayIcon(void)
BOOL
TrayIcon_ShellRemoveTrayIcon
(
void
)
{
NOTIFYICONDATA
nid
;
NOTIFYICONDATA
W
nid
;
BOOL
bRetVal
;
memset
(
&
nid
,
0
,
sizeof
(
NOTIFYICONDATA
));
memset
(
&
nid
,
0
,
sizeof
(
NOTIFYICONDATA
W
));
nid
.
cbSize
=
sizeof
(
NOTIFYICONDATA
);
nid
.
cbSize
=
sizeof
(
NOTIFYICONDATA
W
);
nid
.
hWnd
=
hMainWnd
;
nid
.
uID
=
0
;
nid
.
uFlags
=
0
;
nid
.
uCallbackMessage
=
WM_ONTRAYICON
;
bRetVal
=
Shell_NotifyIcon
(
NIM_DELETE
,
&
nid
);
bRetVal
=
Shell_NotifyIcon
W
(
NIM_DELETE
,
&
nid
);
return
bRetVal
;
}
BOOL
TrayIcon_ShellUpdateTrayIcon
(
void
)
{
NOTIFYICONDATA
nid
;
NOTIFYICONDATA
W
nid
;
HICON
hIcon
=
NULL
;
BOOL
bRetVal
;
WCHAR
wszCPU_Usage
[]
=
{
'C'
,
'P'
,
'U'
,
' '
,
'U'
,
's'
,
'a'
,
'g'
,
'e'
,
':'
,
' '
,
'%'
,
'd'
,
'%'
,
'%'
,
0
};
memset
(
&
nid
,
0
,
sizeof
(
NOTIFYICONDATA
));
memset
(
&
nid
,
0
,
sizeof
(
NOTIFYICONDATA
W
));
hIcon
=
TrayIcon_GetProcessorUsageIcon
();
nid
.
cbSize
=
sizeof
(
NOTIFYICONDATA
);
nid
.
cbSize
=
sizeof
(
NOTIFYICONDATA
W
);
nid
.
hWnd
=
hMainWnd
;
nid
.
uID
=
0
;
nid
.
uFlags
=
NIF_ICON
|
NIF_MESSAGE
|
NIF_TIP
;
nid
.
uCallbackMessage
=
WM_ONTRAYICON
;
nid
.
hIcon
=
hIcon
;
wsprintf
(
nid
.
szTip
,
_T
(
"CPU Usage: %d%%"
)
,
PerfDataGetProcessorUsage
());
wsprintf
W
(
nid
.
szTip
,
wszCPU_Usage
,
PerfDataGetProcessorUsage
());
bRetVal
=
Shell_NotifyIcon
(
NIM_MODIFY
,
&
nid
);
bRetVal
=
Shell_NotifyIcon
W
(
NIM_MODIFY
,
&
nid
);
if
(
hIcon
)
DestroyIcon
(
hIcon
);
...
...
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