Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Lmcons.h>
- #include <wchar.h>
- ...
- void TaskManager_OnMenuSelect(
- ...
- if (LoadStringW(hInst, nItemID, str, 100)) {
- /* load appropriate string */
- LPWSTR lpsz;
- if (nItemID == ID_SHUTDOWN_LOGOFF)
- {
- /* fill in the username we'll log off */
- WCHAR szUserName[UNLEN+1];
- DWORD dwUsernameLen = UNLEN+1;
- WCHAR szLogoffUser[200];
- GetUserName(szUserName, &dwUsernameLen);
- swprintf(szLogoffUser, str, szUserName);
- lpsz = szLogoffUser;
- }
- else
- {
- lpsz = str;
- }
- /* first newline terminates actual string */
- lpsz = wcschr(lpsz, '\n');
- if (lpsz != NULL)
- *lpsz = '\0';
- }
- ...
- SendMessageW(hStatusWnd, SB_SETTEXT, 0, (LPARAM)lpsz);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement