Skip to content

Commit db842fb

Browse files
committed
添加任务栏进度显示
添加任务栏进度显示
1 parent 7ba58e2 commit db842fb

File tree

14 files changed

+22
-3
lines changed

14 files changed

+22
-3
lines changed

MiscFuncs/CharsCodeConv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int U8toW(const char *src, WCHAR *dst, int bufsize, int max_len)
2828
}
2929
int WtoU8(const WCHAR *src, char *dst, int bufsize, int max_len)
3030
{
31-
return ::WideCharToMultiByte(CP_UTF8, 0, src, max_len, dst, bufsize, "_", 0);
31+
return ::WideCharToMultiByte(CP_UTF8, 0, src, max_len, dst, bufsize, NULL, 0);
3232
}
3333

3434
#define DATATYPE_UTF8_DETECT_RTN {if(0 == *s) return TEXT_TYPE_RAW;else {isNotUTF8 = TRUE; break;}}

PckDll/include/pck_handle.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ typedef wchar_t * LPWSTR;
1515
typedef const char * LPCSTR;
1616
typedef char * LPSTR;
1717

18-
#define WINPCK_VERSION_NUMBER 1,31,0,2
19-
#define WINPCK_VERSION "1.31.0.2"
18+
#define WINPCK_VERSION_NUMBER 1,31,0,3
19+
#define WINPCK_VERSION "1.31.0.3"
2020

2121
typedef enum _PCKRTN
2222
{

Release/WinPCK_x64.exe

130 KB
Binary file not shown.

Release/WinPCK_x86.exe

107 KB
Binary file not shown.

Release/pckdll_x64.dll

141 KB
Binary file not shown.

Release/pckdll_x64.lib

0 Bytes
Binary file not shown.

Release/pckdll_x86.dll

114 KB
Binary file not shown.

Release/pckdll_x86.lib

0 Bytes
Binary file not shown.

Release_static/WinPCK_x64.exe

147 KB
Binary file not shown.

Release_static/WinPCK_x86.exe

121 KB
Binary file not shown.

WinPCK/guirelated.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ void TInstDlg::initCommctrls()
4242
//快捷键
4343
hAccel = LoadAccelerators(TApp::GetInstance(), MAKEINTRESOURCE(IDR_ACCELERATOR1));
4444

45+
//任务栏进度
46+
CoCreateInstance(
47+
CLSID_TaskbarList, NULL, CLSCTX_ALL,
48+
IID_ITaskbarList3, (void**)&m_pTaskBarlist);
49+
50+
if(nullptr != m_pTaskBarlist)
51+
m_pTaskBarlist->SetProgressState(hWnd, TBPF_INDETERMINATE);
52+
4553
}
4654

4755
void TInstDlg::initParams()

WinPCK/helpfunc.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "OpenSaveDlg.h"
2424
#include "ShowLogOnDlgListView.h"
2525

26+
2627
inline LONG RecurseDeleteKey(HKEY hRegKey, LPCTSTR lpszKey);
2728
inline void CreateAndSetDefaultValue(LPCTSTR pszValueName, LPCTSTR pszValue);
2829

@@ -361,6 +362,9 @@ void TInstDlg::RefreshProgress()
361362

362363
SendDlgItemMessage(IDC_PROGRESS, PBM_SETPOS, (WPARAM)iNewPos, (LPARAM)0);
363364

365+
if(nullptr != m_pTaskBarlist)
366+
m_pTaskBarlist->SetProgressValue(hWnd, dwUIProgress, dwUIProgressUpper);
367+
364368
//if(dwUIProgress == dwUIProgressUpper)
365369
// swprintf_s(szString, szTimerProcessedFormatString, dwUIProgress, dwUIProgressUpper);
366370
//else

WinPCK/winmain.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ BOOL TInstDlg::EvClose()
114114

115115
ShowWindow(SW_HIDE);
116116

117+
if (nullptr != m_pTaskBarlist)
118+
m_pTaskBarlist->Release();
119+
117120
OleUninitialize();
118121

119122
ListView_Uninit();

WinPCK/winmain.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "globals.h"
33
#include "pck_handle.h"
44
#include "miscdlg.h"
5+
#include <Shobjidl.h>
56

67
class TInstDlg : public TDlg
78
{
@@ -61,6 +62,9 @@ class TInstDlg : public TDlg
6162
wchar_t szTimerProcessingFormatString[64];
6263
wchar_t szTimerProcessedFormatString[64];
6364

65+
//任务栏进度
66+
ITaskbarList3* m_pTaskBarlist = nullptr;
67+
6468
//用户函数
6569
private:
6670

0 commit comments

Comments
 (0)