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
0b88a53a
Commit
0b88a53a
authored
Jul 24, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskmgr: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8e9a0511
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
88 additions
and
90 deletions
+88
-90
about.c
programs/taskmgr/about.c
+1
-1
affinity.c
programs/taskmgr/affinity.c
+8
-8
applpage.c
programs/taskmgr/applpage.c
+6
-8
column.c
programs/taskmgr/column.c
+25
-25
dbgchnl.c
programs/taskmgr/dbgchnl.c
+4
-4
debug.c
programs/taskmgr/debug.c
+8
-8
endproc.c
programs/taskmgr/endproc.c
+7
-7
perfdata.c
programs/taskmgr/perfdata.c
+1
-1
perfpage.c
programs/taskmgr/perfpage.c
+2
-2
priority.c
programs/taskmgr/priority.c
+5
-5
procpage.c
programs/taskmgr/procpage.c
+2
-2
taskmgr.c
programs/taskmgr/taskmgr.c
+16
-16
trayicon.c
programs/taskmgr/trayicon.c
+3
-3
No files found.
programs/taskmgr/about.c
View file @
0b88a53a
...
...
@@ -36,7 +36,7 @@ void OnAbout(void)
WCHAR
copy
[]
=
{
'B'
,
'r'
,
'i'
,
'a'
,
'n'
,
' '
,
'P'
,
'a'
,
'l'
,
'm'
,
'e'
,
'r'
,
' '
,
'<'
,
'b'
,
'r'
,
'i'
,
'a'
,
'n'
,
'p'
,
'@'
,
'r'
,
'e'
,
'a'
,
'c'
,
't'
,
'o'
,
's'
,
'.'
,
'o'
,
'r'
,
'g'
,
'>'
,
0
};
LoadStringW
(
hInst
,
IDC_TASKMGR
,
appname
,
sizeof
(
appname
)
/
sizeof
(
WCHAR
)
);
LoadStringW
(
hInst
,
IDC_TASKMGR
,
appname
,
ARRAY_SIZE
(
appname
)
);
ShellAboutW
(
hMainWnd
,
appname
,
copy
,
LoadImageA
(
hInst
,
(
LPSTR
)
IDI_TASKMANAGER
,
IMAGE_ICON
,
48
,
48
,
LR_SHARED
));
}
programs/taskmgr/affinity.c
View file @
0b88a53a
...
...
@@ -51,9 +51,9 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
* the number of CPUs present in the system
*/
if
(
!
GetProcessAffinityMask
(
hProcessAffinityHandle
,
&
dwProcessAffinityMask
,
&
dwSystemAffinityMask
))
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
EndDialog
(
hDlg
,
0
);
LoadStringW
(
hInst
,
IDS_AFFINITY_UNABLE2ACCESS
,
wszUnable2Access
,
sizeof
(
wszUnable2Access
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_AFFINITY_UNABLE2ACCESS
,
wszUnable2Access
,
ARRAY_SIZE
(
wszUnable2Access
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Access
,
MB_OK
|
MB_ICONSTOP
);
}
...
...
@@ -291,8 +291,8 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
if
(
!
dwProcessAffinityMask
)
{
WCHAR
wszErrorMsg
[
255
];
WCHAR
wszErrorTitle
[
255
];
LoadStringW
(
hInst
,
IDS_AFFINITY_ERROR_MESSAGE
,
wszErrorMsg
,
sizeof
(
wszErrorMsg
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_AFFINITY_ERROR_TITLE
,
wszErrorTitle
,
sizeof
(
wszErrorTitle
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_AFFINITY_ERROR_MESSAGE
,
wszErrorMsg
,
ARRAY_SIZE
(
wszErrorMsg
));
LoadStringW
(
hInst
,
IDS_AFFINITY_ERROR_TITLE
,
wszErrorTitle
,
ARRAY_SIZE
(
wszErrorTitle
));
MessageBoxW
(
hDlg
,
wszErrorMsg
,
wszErrorTitle
,
MB_OK
|
MB_ICONSTOP
);
return
TRUE
;
}
...
...
@@ -301,9 +301,9 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
* Try to set the process affinity
*/
if
(
!
SetProcessAffinityMask
(
hProcessAffinityHandle
,
dwProcessAffinityMask
))
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
EndDialog
(
hDlg
,
LOWORD
(
wParam
));
LoadStringW
(
hInst
,
IDS_AFFINITY_UNABLE2ACCESS
,
wszUnable2Access
,
sizeof
(
wszUnable2Access
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_AFFINITY_UNABLE2ACCESS
,
wszUnable2Access
,
ARRAY_SIZE
(
wszUnable2Access
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Access
,
MB_OK
|
MB_ICONSTOP
);
}
...
...
@@ -341,8 +341,8 @@ void ProcessPage_OnSetAffinity(void)
return
;
hProcessAffinityHandle
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
|
PROCESS_SET_INFORMATION
,
FALSE
,
dwProcessId
);
if
(
!
hProcessAffinityHandle
)
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_AFFINITY_UNABLE2ACCESS
,
wszUnable2Access
,
sizeof
(
wszUnable2Access
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
LoadStringW
(
hInst
,
IDS_AFFINITY_UNABLE2ACCESS
,
wszUnable2Access
,
ARRAY_SIZE
(
wszUnable2Access
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Access
,
MB_OK
|
MB_ICONSTOP
);
return
;
}
...
...
programs/taskmgr/applpage.c
View file @
0b88a53a
...
...
@@ -249,10 +249,8 @@ static BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
return
TRUE
;
/* Check and see if this is a top-level app window */
if
(
!
GetWindowTextW
(
hWnd
,
wszText
,
sizeof
(
wszText
)
/
sizeof
(
WCHAR
))
||
!
IsWindowVisible
(
hWnd
)
||
(
GetParent
(
hWnd
)
!=
NULL
)
||
(
GetWindow
(
hWnd
,
GW_OWNER
)
!=
NULL
)
||
if
(
!
GetWindowTextW
(
hWnd
,
wszText
,
ARRAY_SIZE
(
wszText
))
||
!
IsWindowVisible
(
hWnd
)
||
(
GetParent
(
hWnd
)
!=
NULL
)
||
(
GetWindow
(
hWnd
,
GW_OWNER
)
!=
NULL
)
||
(
GetWindowLongW
(
hWnd
,
GWL_EXSTYLE
)
&
WS_EX_TOOLWINDOW
))
{
return
TRUE
;
/* Skip this window */
...
...
@@ -415,8 +413,8 @@ static void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam)
WCHAR
wszNotResponding
[
255
];
WCHAR
wszRunning
[
255
];
LoadStringW
(
hInst
,
IDS_APPLICATION_NOT_RESPONDING
,
wszNotResponding
,
sizeof
(
wszNotResponding
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_APPLICATION_RUNNING
,
wszRunning
,
sizeof
(
wszRunning
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_APPLICATION_NOT_RESPONDING
,
wszNotResponding
,
ARRAY_SIZE
(
wszNotResponding
));
LoadStringW
(
hInst
,
IDS_APPLICATION_RUNNING
,
wszRunning
,
ARRAY_SIZE
(
wszRunning
));
pnmh
=
(
LPNMHDR
)
lParam
;
pnmdi
=
(
LV_DISPINFOW
*
)
lParam
;
...
...
@@ -842,8 +840,8 @@ ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
WCHAR
wszTask
[
255
];
WCHAR
wszStatus
[
255
];
LoadStringW
(
hInst
,
IDS_APPLICATION_TASK
,
wszTask
,
sizeof
(
wszTask
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_APPLICATION_STATUS
,
wszStatus
,
sizeof
(
wszStatus
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_APPLICATION_TASK
,
wszTask
,
ARRAY_SIZE
(
wszTask
));
LoadStringW
(
hInst
,
IDS_APPLICATION_STATUS
,
wszStatus
,
ARRAY_SIZE
(
wszStatus
));
switch
(
message
)
{
case
WM_INITDIALOG
:
...
...
programs/taskmgr/column.c
View file @
0b88a53a
...
...
@@ -63,31 +63,31 @@ static WCHAR wszIOOtherBytes[255];
static
void
load_column_headers
(
void
)
{
LoadStringW
(
hInst
,
IDS_IMAGENAME
,
wszImageName
,
sizeof
(
wszImageName
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_PID
,
wszPID
,
sizeof
(
wszPID
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_USERNAME
,
wszUserName
,
sizeof
(
wszUserName
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_SESSIONID
,
wszSessionID
,
sizeof
(
wszSessionID
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_CPUUSAGE
,
wszCPU
,
sizeof
(
wszCPU
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_CPUTIME
,
wszCPUTime
,
sizeof
(
wszCPUTime
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_MEMORYUSAGE
,
wszMemUsage
,
sizeof
(
wszMemUsage
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_PEAKMEMORYUSAGE
,
wszPeakMemUsage
,
sizeof
(
wszPeakMemUsage
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_MEMORYUSAGEDELTA
,
wszMemDelta
,
sizeof
(
wszMemDelta
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_PAGEFAULTS
,
wszPageFaults
,
sizeof
(
wszPageFaults
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_PAGEFAULTSDELTA
,
wszPFDelta
,
sizeof
(
wszPFDelta
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_VIRTUALMEMORYSIZE
,
wszVMSize
,
sizeof
(
wszVMSize
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_PAGEDPOOL
,
wszPagedPool
,
sizeof
(
wszPagedPool
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_NONPAGEDPOOL
,
wszNPPool
,
sizeof
(
wszNPPool
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_BASEPRIORITY
,
wszBasePri
,
sizeof
(
wszBasePri
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_HANDLECOUNT
,
wszHandles
,
sizeof
(
wszHandles
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_THREADCOUNT
,
wszThreads
,
sizeof
(
wszThreads
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_USEROBJECTS
,
wszUSERObjects
,
sizeof
(
wszUSERObjects
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_GDIOBJECTS
,
wszGDIObjects
,
sizeof
(
wszGDIObjects
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_IOREADS
,
wszIOReads
,
sizeof
(
wszIOReads
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_IOWRITES
,
wszIOWrites
,
sizeof
(
wszIOWrites
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_IOOTHER
,
wszIOOther
,
sizeof
(
wszIOOther
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_IOREADBYTES
,
wszIOReadBytes
,
sizeof
(
wszIOReadBytes
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_IOWRITEBYTES
,
wszIOWriteBytes
,
sizeof
(
wszIOWriteBytes
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_IOOTHERBYTES
,
wszIOOtherBytes
,
sizeof
(
wszIOOtherBytes
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_IMAGENAME
,
wszImageName
,
ARRAY_SIZE
(
wszImageName
));
LoadStringW
(
hInst
,
IDS_PID
,
wszPID
,
ARRAY_SIZE
(
wszPID
));
LoadStringW
(
hInst
,
IDS_USERNAME
,
wszUserName
,
ARRAY_SIZE
(
wszUserName
));
LoadStringW
(
hInst
,
IDS_SESSIONID
,
wszSessionID
,
ARRAY_SIZE
(
wszSessionID
));
LoadStringW
(
hInst
,
IDS_CPUUSAGE
,
wszCPU
,
ARRAY_SIZE
(
wszCPU
));
LoadStringW
(
hInst
,
IDS_CPUTIME
,
wszCPUTime
,
ARRAY_SIZE
(
wszCPUTime
));
LoadStringW
(
hInst
,
IDS_MEMORYUSAGE
,
wszMemUsage
,
ARRAY_SIZE
(
wszMemUsage
));
LoadStringW
(
hInst
,
IDS_PEAKMEMORYUSAGE
,
wszPeakMemUsage
,
ARRAY_SIZE
(
wszPeakMemUsage
));
LoadStringW
(
hInst
,
IDS_MEMORYUSAGEDELTA
,
wszMemDelta
,
ARRAY_SIZE
(
wszMemDelta
));
LoadStringW
(
hInst
,
IDS_PAGEFAULTS
,
wszPageFaults
,
ARRAY_SIZE
(
wszPageFaults
));
LoadStringW
(
hInst
,
IDS_PAGEFAULTSDELTA
,
wszPFDelta
,
ARRAY_SIZE
(
wszPFDelta
));
LoadStringW
(
hInst
,
IDS_VIRTUALMEMORYSIZE
,
wszVMSize
,
ARRAY_SIZE
(
wszVMSize
));
LoadStringW
(
hInst
,
IDS_PAGEDPOOL
,
wszPagedPool
,
ARRAY_SIZE
(
wszPagedPool
));
LoadStringW
(
hInst
,
IDS_NONPAGEDPOOL
,
wszNPPool
,
ARRAY_SIZE
(
wszNPPool
));
LoadStringW
(
hInst
,
IDS_BASEPRIORITY
,
wszBasePri
,
ARRAY_SIZE
(
wszBasePri
));
LoadStringW
(
hInst
,
IDS_HANDLECOUNT
,
wszHandles
,
ARRAY_SIZE
(
wszHandles
));
LoadStringW
(
hInst
,
IDS_THREADCOUNT
,
wszThreads
,
ARRAY_SIZE
(
wszThreads
));
LoadStringW
(
hInst
,
IDS_USEROBJECTS
,
wszUSERObjects
,
ARRAY_SIZE
(
wszUSERObjects
));
LoadStringW
(
hInst
,
IDS_GDIOBJECTS
,
wszGDIObjects
,
ARRAY_SIZE
(
wszGDIObjects
));
LoadStringW
(
hInst
,
IDS_IOREADS
,
wszIOReads
,
ARRAY_SIZE
(
wszIOReads
));
LoadStringW
(
hInst
,
IDS_IOWRITES
,
wszIOWrites
,
ARRAY_SIZE
(
wszIOWrites
));
LoadStringW
(
hInst
,
IDS_IOOTHER
,
wszIOOther
,
ARRAY_SIZE
(
wszIOOther
));
LoadStringW
(
hInst
,
IDS_IOREADBYTES
,
wszIOReadBytes
,
ARRAY_SIZE
(
wszIOReadBytes
));
LoadStringW
(
hInst
,
IDS_IOWRITEBYTES
,
wszIOWriteBytes
,
ARRAY_SIZE
(
wszIOWriteBytes
));
LoadStringW
(
hInst
,
IDS_IOOTHERBYTES
,
wszIOOtherBytes
,
ARRAY_SIZE
(
wszIOOtherBytes
));
}
static
int
InsertColumn
(
int
nCol
,
LPCWSTR
lpszColumnHeading
,
int
nFormat
,
int
nWidth
,
int
nSubItem
)
...
...
programs/taskmgr/dbgchnl.c
View file @
0b88a53a
...
...
@@ -113,7 +113,7 @@ static int list_channel_CB(HANDLE hProcess, void* addr, struct __wine_debug_
int
index
;
HWND
hChannelLV
=
user
;
MultiByteToWideChar
(
CP_ACP
,
0
,
channel
->
name
,
sizeof
(
channel
->
name
),
nameW
,
sizeof
(
nameW
)
/
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
channel
->
name
,
sizeof
(
channel
->
name
),
nameW
,
ARRAY_SIZE
(
nameW
));
lvitem
.
mask
=
LVIF_TEXT
;
lvitem
.
pszText
=
nameW
;
...
...
@@ -231,7 +231,7 @@ static void DebugChannels_OnCreate(HWND hwndDlg)
LVCOLUMNW
lvc
;
WCHAR
debug_channelW
[
255
];
LoadStringW
(
hInst
,
IDS_DEBUG_CHANNEL
,
debug_channelW
,
sizeof
(
debug_channelW
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_DEBUG_CHANNEL
,
debug_channelW
,
ARRAY_SIZE
(
debug_channelW
));
lvc
.
mask
=
LVCF_FMT
|
LVCF_TEXT
|
LVCF_WIDTH
;
lvc
.
fmt
=
LVCFMT_LEFT
;
...
...
@@ -293,8 +293,8 @@ static void DebugChannels_OnNotify(HWND hDlg, LPARAM lParam)
unsigned
bitmask
=
1
<<
(
lhti
.
iSubItem
-
1
);
struct
cce_user
user
;
ListView_GetItemTextA
(
hChannelLV
,
lhti
.
iItem
,
0
,
name
,
sizeof
(
name
)
/
sizeof
(
name
[
0
]
));
ListView_GetItemTextW
(
hChannelLV
,
lhti
.
iItem
,
lhti
.
iSubItem
,
val
,
sizeof
(
val
)
/
sizeof
(
val
[
0
]
));
ListView_GetItemTextA
(
hChannelLV
,
lhti
.
iItem
,
0
,
name
,
ARRAY_SIZE
(
name
));
ListView_GetItemTextW
(
hChannelLV
,
lhti
.
iItem
,
lhti
.
iSubItem
,
val
,
ARRAY_SIZE
(
val
));
user
.
name
=
name
;
user
.
value
=
(
val
[
0
]
==
'x'
)
?
0
:
bitmask
;
user
.
mask
=
bitmask
;
...
...
programs/taskmgr/debug.c
View file @
0b88a53a
...
...
@@ -57,9 +57,9 @@ void ProcessPage_OnDebug(void)
'A'
,
'e'
,
'D'
,
'e'
,
'b'
,
'u'
,
'g'
,
0
};
static
const
WCHAR
wszDebugger
[]
=
{
'D'
,
'e'
,
'b'
,
'u'
,
'g'
,
'g'
,
'e'
,
'r'
,
0
};
LoadStringW
(
hInst
,
IDS_WARNING_TITLE
,
wszWarnTitle
,
sizeof
(
wszWarnTitle
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_DEBUG_UNABLE2DEBUG
,
wszUnable2Debug
,
sizeof
(
wszUnable2Debug
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_DEBUG_MESSAGE
,
wszWarnMsg
,
sizeof
(
wszWarnMsg
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_WARNING_TITLE
,
wszWarnTitle
,
ARRAY_SIZE
(
wszWarnTitle
));
LoadStringW
(
hInst
,
IDS_DEBUG_UNABLE2DEBUG
,
wszUnable2Debug
,
ARRAY_SIZE
(
wszUnable2Debug
));
LoadStringW
(
hInst
,
IDS_DEBUG_MESSAGE
,
wszWarnMsg
,
ARRAY_SIZE
(
wszWarnMsg
));
Count
=
SendMessageW
(
hProcessPageListCtrl
,
LVM_GETITEMCOUNT
,
0
,
0
);
for
(
Index
=
0
;
Index
<
Count
;
Index
++
)
...
...
@@ -82,14 +82,14 @@ void ProcessPage_OnDebug(void)
if
(
MessageBoxW
(
hMainWnd
,
wszWarnMsg
,
wszWarnTitle
,
MB_YESNO
|
MB_ICONWARNING
)
!=
IDYES
)
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Debug
,
MB_OK
|
MB_ICONSTOP
);
return
;
}
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
wszSubKey
,
0
,
KEY_READ
,
&
hKey
)
!=
ERROR_SUCCESS
)
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Debug
,
MB_OK
|
MB_ICONSTOP
);
return
;
}
...
...
@@ -97,7 +97,7 @@ void ProcessPage_OnDebug(void)
dwDebuggerSize
=
260
;
if
(
RegQueryValueExW
(
hKey
,
wszDebugger
,
NULL
,
NULL
,
(
LPBYTE
)
wstrDebugger
,
&
dwDebuggerSize
)
!=
ERROR_SUCCESS
)
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Debug
,
MB_OK
|
MB_ICONSTOP
);
RegCloseKey
(
hKey
);
return
;
...
...
@@ -108,7 +108,7 @@ void ProcessPage_OnDebug(void)
hDebugEvent
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
if
(
!
hDebugEvent
)
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Debug
,
MB_OK
|
MB_ICONSTOP
);
return
;
}
...
...
@@ -120,7 +120,7 @@ void ProcessPage_OnDebug(void)
si
.
cb
=
sizeof
(
STARTUPINFOW
);
if
(
!
CreateProcessW
(
NULL
,
wstrDebugPath
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
))
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Debug
,
MB_OK
|
MB_ICONSTOP
);
}
...
...
programs/taskmgr/endproc.c
View file @
0b88a53a
...
...
@@ -38,9 +38,9 @@ static WCHAR wszUnable2Terminate[255];
static
void
load_message_strings
(
void
)
{
LoadStringW
(
hInst
,
IDS_TERMINATE_MESSAGE
,
wszWarnMsg
,
sizeof
(
wszWarnMsg
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_TERMINATE_UNABLE2TERMINATE
,
wszUnable2Terminate
,
sizeof
(
wszUnable2Terminate
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_WARNING_TITLE
,
wszWarnTitle
,
sizeof
(
wszWarnTitle
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_TERMINATE_MESSAGE
,
wszWarnMsg
,
ARRAY_SIZE
(
wszWarnMsg
));
LoadStringW
(
hInst
,
IDS_TERMINATE_UNABLE2TERMINATE
,
wszUnable2Terminate
,
ARRAY_SIZE
(
wszUnable2Terminate
));
LoadStringW
(
hInst
,
IDS_WARNING_TITLE
,
wszWarnTitle
,
ARRAY_SIZE
(
wszWarnTitle
));
}
void
ProcessPage_OnEndProcess
(
void
)
...
...
@@ -79,14 +79,14 @@ void ProcessPage_OnEndProcess(void)
if
(
!
hProcess
)
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Terminate
,
MB_OK
|
MB_ICONSTOP
);
return
;
}
if
(
!
TerminateProcess
(
hProcess
,
0
))
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Terminate
,
MB_OK
|
MB_ICONSTOP
);
}
...
...
@@ -129,14 +129,14 @@ void ProcessPage_OnEndProcessTree(void)
if
(
!
hProcess
)
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Terminate
,
MB_OK
|
MB_ICONSTOP
);
return
;
}
if
(
!
TerminateProcess
(
hProcess
,
0
))
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Terminate
,
MB_OK
|
MB_ICONSTOP
);
}
...
...
programs/taskmgr/perfdata.c
View file @
0b88a53a
...
...
@@ -248,7 +248,7 @@ void PerfDataRefresh(void)
else
{
WCHAR
idleW
[
255
];
LoadStringW
(
hInst
,
IDS_SYSTEM_IDLE_PROCESS
,
idleW
,
sizeof
(
idleW
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_SYSTEM_IDLE_PROCESS
,
idleW
,
ARRAY_SIZE
(
idleW
));
lstrcpyW
(
pPerfData
[
Idx
].
ImageName
,
idleW
);
}
...
...
programs/taskmgr/perfpage.c
View file @
0b88a53a
...
...
@@ -141,7 +141,7 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
static
const
WCHAR
wszFormatDigit
[]
=
{
'%'
,
'u'
,
0
};
WCHAR
wszMemUsage
[
255
];
LoadStringW
(
hInst
,
IDS_STATUS_BAR_MEMORY_USAGE
,
wszMemUsage
,
sizeof
(
wszMemUsage
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_STATUS_BAR_MEMORY_USAGE
,
wszMemUsage
,
ARRAY_SIZE
(
wszMemUsage
));
/* Create the event */
hPerformancePageEvent
=
CreateEventW
(
NULL
,
TRUE
,
TRUE
,
NULL
);
...
...
@@ -190,7 +190,7 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
args
[
1
]
=
CommitChargeLimit
;
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
|
FORMAT_MESSAGE_ARGUMENT_ARRAY
,
wszMemUsage
,
0
,
0
,
Text
,
sizeof
(
Text
)
/
sizeof
(
*
Text
),
(
__ms_va_list
*
)
args
);
ARRAY_SIZE
(
Text
),
(
__ms_va_list
*
)
args
);
SendMessageW
(
hStatusWnd
,
SB_SETTEXTW
,
2
,
(
LPARAM
)
Text
);
/*
...
...
programs/taskmgr/priority.c
View file @
0b88a53a
...
...
@@ -44,9 +44,9 @@ static void DoSetPriority(DWORD priority)
WCHAR
wszWarnTitle
[
255
];
WCHAR
wszUnable2Change
[
255
];
LoadStringW
(
hInst
,
IDS_PRIORITY_CHANGE_MESSAGE
,
wszWarnMsg
,
sizeof
(
wszWarnMsg
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_WARNING_TITLE
,
wszWarnTitle
,
sizeof
(
wszWarnTitle
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_PRIORITY_UNABLE2CHANGE
,
wszUnable2Change
,
sizeof
(
wszUnable2Change
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_PRIORITY_CHANGE_MESSAGE
,
wszWarnMsg
,
ARRAY_SIZE
(
wszWarnMsg
));
LoadStringW
(
hInst
,
IDS_WARNING_TITLE
,
wszWarnTitle
,
ARRAY_SIZE
(
wszWarnTitle
));
LoadStringW
(
hInst
,
IDS_PRIORITY_UNABLE2CHANGE
,
wszUnable2Change
,
ARRAY_SIZE
(
wszUnable2Change
));
Count
=
SendMessageW
(
hProcessPageListCtrl
,
LVM_GETITEMCOUNT
,
0
,
0
);
for
(
Index
=
0
;
Index
<
Count
;
Index
++
)
...
...
@@ -74,14 +74,14 @@ static void DoSetPriority(DWORD priority)
if
(
!
hProcess
)
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Change
,
MB_OK
|
MB_ICONSTOP
);
return
;
}
if
(
!
SetPriorityClass
(
hProcess
,
priority
))
{
GetLastErrorText
(
wstrErrorText
,
sizeof
(
wstrErrorText
)
/
sizeof
(
WCHAR
));
GetLastErrorText
(
wstrErrorText
,
ARRAY_SIZE
(
wstrErrorText
));
MessageBoxW
(
hMainWnd
,
wstrErrorText
,
wszUnable2Change
,
MB_OK
|
MB_ICONSTOP
);
}
...
...
programs/taskmgr/procpage.c
View file @
0b88a53a
...
...
@@ -384,8 +384,8 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
WCHAR
wszCPU_Usage
[
255
];
WCHAR
wszProcesses
[
255
];
LoadStringW
(
hInst
,
IDS_STATUS_BAR_CPU_USAGE
,
wszCPU_Usage
,
sizeof
(
wszCPU_Usage
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_STATUS_BAR_PROCESSES
,
wszProcesses
,
sizeof
(
wszProcesses
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_STATUS_BAR_CPU_USAGE
,
wszCPU_Usage
,
ARRAY_SIZE
(
wszCPU_Usage
));
LoadStringW
(
hInst
,
IDS_STATUS_BAR_PROCESSES
,
wszProcesses
,
ARRAY_SIZE
(
wszProcesses
));
/* Create the event */
hProcessPageEvent
=
CreateEventW
(
NULL
,
TRUE
,
TRUE
,
NULL
);
...
...
programs/taskmgr/taskmgr.c
View file @
0b88a53a
...
...
@@ -122,9 +122,9 @@ static BOOL OnCreate(HWND hWnd)
static
WCHAR
wszProcesses
[
255
];
static
WCHAR
wszPerformance
[
255
];
LoadStringW
(
hInst
,
IDS_APPLICATIONS
,
wszApplications
,
sizeof
(
wszApplications
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_PROCESSES
,
wszProcesses
,
sizeof
(
wszProcesses
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_PERFORMANCE
,
wszPerformance
,
sizeof
(
wszPerformance
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_APPLICATIONS
,
wszApplications
,
ARRAY_SIZE
(
wszApplications
));
LoadStringW
(
hInst
,
IDS_PROCESSES
,
wszProcesses
,
ARRAY_SIZE
(
wszProcesses
));
LoadStringW
(
hInst
,
IDS_PERFORMANCE
,
wszPerformance
,
ARRAY_SIZE
(
wszPerformance
));
SendMessageW
(
hMainWnd
,
WM_SETICON
,
ICON_BIG
,
(
LPARAM
)
LoadIconW
(
hInst
,
MAKEINTRESOURCEW
(
IDI_TASKMANAGER
)));
SendMessageW
(
hMainWnd
,
WM_SETICON
,
ICON_SMALL
,
...
...
@@ -501,8 +501,8 @@ static void TaskManager_OnExitMenuLoop(HWND hWnd)
WCHAR
wszCPU_Usage
[
255
];
WCHAR
wszProcesses
[
255
];
LoadStringW
(
hInst
,
IDS_STATUS_BAR_CPU_USAGE
,
wszCPU_Usage
,
sizeof
(
wszCPU_Usage
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_STATUS_BAR_PROCESSES
,
wszProcesses
,
sizeof
(
wszProcesses
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_STATUS_BAR_CPU_USAGE
,
wszCPU_Usage
,
ARRAY_SIZE
(
wszCPU_Usage
));
LoadStringW
(
hInst
,
IDS_STATUS_BAR_PROCESSES
,
wszProcesses
,
ARRAY_SIZE
(
wszProcesses
));
bInMenuLoop
=
FALSE
;
/* Update the status bar pane sizes */
...
...
@@ -522,7 +522,7 @@ static void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU
{
WCHAR
wstr
[
256
]
=
{
0
};
LoadStringW
(
hInst
,
nItemID
,
wstr
,
sizeof
(
wstr
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
nItemID
,
wstr
,
ARRAY_SIZE
(
wstr
));
SendMessageW
(
hStatusWnd
,
SB_SETTEXTW
,
0
,
(
LPARAM
)
wstr
);
}
...
...
@@ -610,16 +610,16 @@ static void TaskManager_OnTabWndSelChange(void)
WCHAR
wszCPUHistory
[
255
];
WCHAR
wszShowKernelTimes
[
255
];
LoadStringW
(
hInst
,
IDS_VIEW_LARGE
,
wszLargeIcons
,
sizeof
(
wszLargeIcons
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_VIEW_SMALL
,
wszSmallIcons
,
sizeof
(
wszSmallIcons
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_VIEW_DETAILS
,
wszDetails
,
sizeof
(
wszDetails
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_WINDOWS
,
wszWindows
,
sizeof
(
wszWindows
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_VIEW_SELECTCOLUMNS
,
wszSelectColumns
,
sizeof
(
wszSelectColumns
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_OPTIONS_SHOW16BITTASKS
,
wszShow16bTasks
,
sizeof
(
wszShow16bTasks
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_VIEW_CPUHISTORY_ONEGRAPHALL
,
wszOneGraphAllCPU
,
sizeof
(
wszOneGraphAllCPU
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_VIEW_CPUHISTORY_ONEGRAPHPERCPU
,
wszOneGraphPerCPU
,
sizeof
(
wszOneGraphPerCPU
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_VIEW_CPUHISTORY
,
wszCPUHistory
,
sizeof
(
wszCPUHistory
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_VIEW_SHOWKERNELTIMES
,
wszShowKernelTimes
,
sizeof
(
wszShowKernelTimes
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_VIEW_LARGE
,
wszLargeIcons
,
ARRAY_SIZE
(
wszLargeIcons
));
LoadStringW
(
hInst
,
IDS_VIEW_SMALL
,
wszSmallIcons
,
ARRAY_SIZE
(
wszSmallIcons
));
LoadStringW
(
hInst
,
IDS_VIEW_DETAILS
,
wszDetails
,
ARRAY_SIZE
(
wszDetails
));
LoadStringW
(
hInst
,
IDS_WINDOWS
,
wszWindows
,
ARRAY_SIZE
(
wszWindows
));
LoadStringW
(
hInst
,
IDS_VIEW_SELECTCOLUMNS
,
wszSelectColumns
,
ARRAY_SIZE
(
wszSelectColumns
));
LoadStringW
(
hInst
,
IDS_OPTIONS_SHOW16BITTASKS
,
wszShow16bTasks
,
ARRAY_SIZE
(
wszShow16bTasks
));
LoadStringW
(
hInst
,
IDS_VIEW_CPUHISTORY_ONEGRAPHALL
,
wszOneGraphAllCPU
,
ARRAY_SIZE
(
wszOneGraphAllCPU
));
LoadStringW
(
hInst
,
IDS_VIEW_CPUHISTORY_ONEGRAPHPERCPU
,
wszOneGraphPerCPU
,
ARRAY_SIZE
(
wszOneGraphPerCPU
));
LoadStringW
(
hInst
,
IDS_VIEW_CPUHISTORY
,
wszCPUHistory
,
ARRAY_SIZE
(
wszCPUHistory
));
LoadStringW
(
hInst
,
IDS_VIEW_SHOWKERNELTIMES
,
wszShowKernelTimes
,
ARRAY_SIZE
(
wszShowKernelTimes
));
hMenu
=
GetMenu
(
hMainWnd
);
hViewMenu
=
GetSubMenu
(
hMenu
,
2
);
...
...
programs/taskmgr/trayicon.c
View file @
0b88a53a
...
...
@@ -140,7 +140,7 @@ BOOL TrayIcon_ShellAddTrayIcon(void)
BOOL
bRetVal
;
WCHAR
wszCPU_Usage
[
255
];
LoadStringW
(
hInst
,
IDS_STATUS_BAR_CPU_USAGE
,
wszCPU_Usage
,
sizeof
(
wszCPU_Usage
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_STATUS_BAR_CPU_USAGE
,
wszCPU_Usage
,
ARRAY_SIZE
(
wszCPU_Usage
));
memset
(
&
nid
,
0
,
sizeof
(
NOTIFYICONDATAW
));
...
...
@@ -187,8 +187,8 @@ BOOL TrayIcon_ShellUpdateTrayIcon(void)
BOOL
bRetVal
;
WCHAR
wszCPU_Usage
[
255
];
LoadStringW
(
hInst
,
IDS_STATUS_BAR_CPU_USAGE
,
wszCPU_Usage
,
sizeof
(
wszCPU_Usage
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_STATUS_BAR_CPU_USAGE
,
wszCPU_Usage
,
ARRAY_SIZE
(
wszCPU_Usage
));
memset
(
&
nid
,
0
,
sizeof
(
NOTIFYICONDATAW
));
hIcon
=
TrayIcon_GetProcessorUsageIcon
();
...
...
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