Skip to content

Commit

Permalink
fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
gurnec committed Jul 25, 2016
1 parent 6019cd4 commit b1990d1
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
1 change: 1 addition & 0 deletions HashCalc.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ typedef struct {
HANDLE hFileOut; // handle of the output file
HFONT hFont; // fixed-width font for the results box: handle
WNDPROC wpSearchBox; // original WNDPROC for the HashProp search box
WNDPROC wpResultsBox; // original WNDPROC for the HashProp results box
UINT cchMax; // max length, in characters of the longest path (stupid SFV formatting)
UINT cchPrefix; // number of characters to omit from the start of the path
UINT cchAdjusted; // cchPrefix, adjusted for the path of the output file
Expand Down
41 changes: 41 additions & 0 deletions HashProp.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ VOID WINAPI HashPropForceLTR( HWND hWndEdit );

// Dialog status
LRESULT CALLBACK HashPropEditProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
LRESULT CALLBACK HashPropResultsProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
VOID WINAPI HashPropUpdateResults( PHASHPROPCONTEXT phpctx, PHASHPROPITEM pItem );
VOID WINAPI HashPropFinalStatus( PHASHPROPCONTEXT phpctx );

Expand Down Expand Up @@ -185,6 +186,13 @@ INT_PTR CALLBACK HashPropDlgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
(LONG_PTR)phpctx->wpSearchBox
);

// Undo the results box subclassing
SetWindowLongPtr(
GetDlgItem(hWnd, IDC_RESULTS),
GWLP_WNDPROC,
(LONG_PTR)phpctx->wpResultsBox
);

// Kill the worker thread
phpctx->dwFlags |= HCF_EXIT_PENDING;
WorkerThreadStop((PCOMMONCONTEXT)phpctx);
Expand Down Expand Up @@ -326,6 +334,30 @@ LRESULT CALLBACK HashPropEditProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
return(CallWindowProc(phpctx->wpSearchBox, hWnd, uMsg, wParam, lParam));
}

LRESULT CALLBACK HashPropResultsProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
PHASHPROPCONTEXT phpctx = (PHASHPROPCONTEXT)GetWindowLongPtr(
(HWND)GetWindowLongPtr(hWnd, GWLP_HWNDPARENT),
DWLP_USER
);

if (wParam == VK_ESCAPE)
{
if (uMsg == WM_GETDLGCODE)
{
return(DLGC_WANTALLKEYS);
}
else if (uMsg >= WM_KEYFIRST && uMsg <= WM_KEYLAST)
{
PostMessage(phpctx->hWnd, uMsg, wParam, lParam);

return(0);
}
}

return(CallWindowProc(phpctx->wpResultsBox, hWnd, uMsg, wParam, lParam));
}

VOID WINAPI HashPropDlgInit( PHASHPROPCONTEXT phpctx )
{
HWND hWnd = phpctx->hWnd;
Expand Down Expand Up @@ -368,6 +400,15 @@ VOID WINAPI HashPropDlgInit( PHASHPROPCONTEXT phpctx )
);
}

// Initialize the results text box
{
phpctx->wpResultsBox = (WNDPROC)SetWindowLongPtr(
GetDlgItem(hWnd, IDC_RESULTS),
GWLP_WNDPROC,
(LONG_PTR)HashPropResultsProc
);
}

// Initialize miscellaneous stuff
{
phpctx->hList = SLCreateEx(TRUE);
Expand Down
6 changes: 3 additions & 3 deletions installer/HashCheck.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ FunctionEnd
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "Catalan"

VIProductVersion "2.3.1.9"
VIProductVersion "2.3.1.10"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "HashCheck Shell Extension"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "2.3.1.9"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "2.3.1.10"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "Installer distributed from https://github.com/gurnec/HashCheck/releases"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" ""
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" ""
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright © Kai Liu, Christopher Gurnee, Tim Schlueter. All rights reserved."
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Installer (x86/x64) from https://github.com/gurnec/HashCheck/releases"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "2.3.1.9"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "2.3.1.10"

; With solid compression, files that are required before the
; actual installation should be stored first in the data block,
Expand Down
4 changes: 2 additions & 2 deletions version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#define HASHCHECK_NAME_STR "HashCheck Shell Extension"

// Full version: MUST be in the form of major,minor,revision,build
#define HASHCHECK_VERSION_FULL 2,3,1,9
#define HASHCHECK_VERSION_FULL 2,3,1,10

// String version: May be any suitable string
#define HASHCHECK_VERSION_STR "2.3.1.9"
#define HASHCHECK_VERSION_STR "2.3.1.10"

#ifdef _USRDLL
// PE version: MUST be in the form of major.minor
Expand Down

0 comments on commit b1990d1

Please sign in to comment.