diff --git a/HexEdit.sln b/HexEdit.sln index 649b4e6..fc2f689 100644 --- a/HexEdit.sln +++ b/HexEdit.sln @@ -29,37 +29,67 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D42516BB-4C96-4F56-BF73-B3B9E95BA5F4}.Debug|Win32.ActiveCfg = Debug|Win32 {D42516BB-4C96-4F56-BF73-B3B9E95BA5F4}.Debug|Win32.Build.0 = Debug|Win32 + {D42516BB-4C96-4F56-BF73-B3B9E95BA5F4}.Debug|x64.ActiveCfg = Debug|x64 + {D42516BB-4C96-4F56-BF73-B3B9E95BA5F4}.Debug|x64.Build.0 = Debug|x64 {D42516BB-4C96-4F56-BF73-B3B9E95BA5F4}.Release|Win32.ActiveCfg = Release|Win32 {D42516BB-4C96-4F56-BF73-B3B9E95BA5F4}.Release|Win32.Build.0 = Release|Win32 + {D42516BB-4C96-4F56-BF73-B3B9E95BA5F4}.Release|x64.ActiveCfg = Release|x64 + {D42516BB-4C96-4F56-BF73-B3B9E95BA5F4}.Release|x64.Build.0 = Release|x64 {D5B645A0-AB6C-4C08-8A02-9EE1324A0BFD}.Debug|Win32.ActiveCfg = Debug|Win32 {D5B645A0-AB6C-4C08-8A02-9EE1324A0BFD}.Debug|Win32.Build.0 = Debug|Win32 + {D5B645A0-AB6C-4C08-8A02-9EE1324A0BFD}.Debug|x64.ActiveCfg = Debug|x64 + {D5B645A0-AB6C-4C08-8A02-9EE1324A0BFD}.Debug|x64.Build.0 = Debug|x64 {D5B645A0-AB6C-4C08-8A02-9EE1324A0BFD}.Release|Win32.ActiveCfg = Release|Win32 {D5B645A0-AB6C-4C08-8A02-9EE1324A0BFD}.Release|Win32.Build.0 = Release|Win32 + {D5B645A0-AB6C-4C08-8A02-9EE1324A0BFD}.Release|x64.ActiveCfg = Release|x64 + {D5B645A0-AB6C-4C08-8A02-9EE1324A0BFD}.Release|x64.Build.0 = Release|x64 {93B6F7BD-DDB7-4FEA-8994-1927AD706DD6}.Debug|Win32.ActiveCfg = Debug|Win32 {93B6F7BD-DDB7-4FEA-8994-1927AD706DD6}.Debug|Win32.Build.0 = Debug|Win32 + {93B6F7BD-DDB7-4FEA-8994-1927AD706DD6}.Debug|x64.ActiveCfg = Debug|x64 + {93B6F7BD-DDB7-4FEA-8994-1927AD706DD6}.Debug|x64.Build.0 = Debug|x64 {93B6F7BD-DDB7-4FEA-8994-1927AD706DD6}.Release|Win32.ActiveCfg = Release|Win32 {93B6F7BD-DDB7-4FEA-8994-1927AD706DD6}.Release|Win32.Build.0 = Release|Win32 + {93B6F7BD-DDB7-4FEA-8994-1927AD706DD6}.Release|x64.ActiveCfg = Release|x64 + {93B6F7BD-DDB7-4FEA-8994-1927AD706DD6}.Release|x64.Build.0 = Release|x64 {3FBA3178-4AE6-4103-9EB2-542901D978B7}.Debug|Win32.ActiveCfg = Debug|Win32 {3FBA3178-4AE6-4103-9EB2-542901D978B7}.Debug|Win32.Build.0 = Debug|Win32 + {3FBA3178-4AE6-4103-9EB2-542901D978B7}.Debug|x64.ActiveCfg = Debug|x64 + {3FBA3178-4AE6-4103-9EB2-542901D978B7}.Debug|x64.Build.0 = Debug|x64 {3FBA3178-4AE6-4103-9EB2-542901D978B7}.Release|Win32.ActiveCfg = Release|Win32 {3FBA3178-4AE6-4103-9EB2-542901D978B7}.Release|Win32.Build.0 = Release|Win32 + {3FBA3178-4AE6-4103-9EB2-542901D978B7}.Release|x64.ActiveCfg = Release|x64 + {3FBA3178-4AE6-4103-9EB2-542901D978B7}.Release|x64.Build.0 = Release|x64 {E101755F-A81A-4C12-9B4B-8485BF8E66DA}.Debug|Win32.ActiveCfg = Debug|Win32 {E101755F-A81A-4C12-9B4B-8485BF8E66DA}.Debug|Win32.Build.0 = Debug|Win32 + {E101755F-A81A-4C12-9B4B-8485BF8E66DA}.Debug|x64.ActiveCfg = Debug|x64 + {E101755F-A81A-4C12-9B4B-8485BF8E66DA}.Debug|x64.Build.0 = Debug|x64 {E101755F-A81A-4C12-9B4B-8485BF8E66DA}.Release|Win32.ActiveCfg = Release|Win32 {E101755F-A81A-4C12-9B4B-8485BF8E66DA}.Release|Win32.Build.0 = Release|Win32 + {E101755F-A81A-4C12-9B4B-8485BF8E66DA}.Release|x64.ActiveCfg = Release|x64 + {E101755F-A81A-4C12-9B4B-8485BF8E66DA}.Release|x64.Build.0 = Release|x64 {8724EC2D-4352-46B2-AB57-3C3430BD52DB}.Debug|Win32.ActiveCfg = Debug|Win32 {8724EC2D-4352-46B2-AB57-3C3430BD52DB}.Debug|Win32.Build.0 = Debug|Win32 + {8724EC2D-4352-46B2-AB57-3C3430BD52DB}.Debug|x64.ActiveCfg = Debug|x64 + {8724EC2D-4352-46B2-AB57-3C3430BD52DB}.Debug|x64.Build.0 = Debug|x64 {8724EC2D-4352-46B2-AB57-3C3430BD52DB}.Release|Win32.ActiveCfg = Release|Win32 {8724EC2D-4352-46B2-AB57-3C3430BD52DB}.Release|Win32.Build.0 = Release|Win32 + {8724EC2D-4352-46B2-AB57-3C3430BD52DB}.Release|x64.ActiveCfg = Release|x64 + {8724EC2D-4352-46B2-AB57-3C3430BD52DB}.Release|x64.Build.0 = Release|x64 {6BD408DB-3E6D-4649-9A92-4A4E52E70137}.Debug|Win32.ActiveCfg = Debug|Win32 {6BD408DB-3E6D-4649-9A92-4A4E52E70137}.Debug|Win32.Build.0 = Debug|Win32 + {6BD408DB-3E6D-4649-9A92-4A4E52E70137}.Debug|x64.ActiveCfg = Debug|x64 + {6BD408DB-3E6D-4649-9A92-4A4E52E70137}.Debug|x64.Build.0 = Debug|x64 {6BD408DB-3E6D-4649-9A92-4A4E52E70137}.Release|Win32.ActiveCfg = Release|Win32 {6BD408DB-3E6D-4649-9A92-4A4E52E70137}.Release|Win32.Build.0 = Release|Win32 + {6BD408DB-3E6D-4649-9A92-4A4E52E70137}.Release|x64.ActiveCfg = Release|x64 + {6BD408DB-3E6D-4649-9A92-4A4E52E70137}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ConfigLib/ConfigLib.vcxproj b/src/ConfigLib/ConfigLib.vcxproj index 352c239..66b4189 100644 --- a/src/ConfigLib/ConfigLib.vcxproj +++ b/src/ConfigLib/ConfigLib.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {D42516BB-4C96-4F56-BF73-B3B9E95BA5F4} @@ -21,32 +29,59 @@ true Unicode + + StaticLibrary + true + Unicode + StaticLibrary false true Unicode + + StaticLibrary + false + true + Unicode + + + + + + + $(ProjectDir)$(Configuration)\ $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + @@ -61,6 +96,20 @@ true + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + + + Windows + true + + Level3 @@ -71,6 +120,26 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 ..\Common + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + MultiThreaded Windows diff --git a/src/ConfigLib/configlib.cpp b/src/ConfigLib/configlib.cpp index d07c6bf..215ff04 100644 --- a/src/ConfigLib/configlib.cpp +++ b/src/ConfigLib/configlib.cpp @@ -361,7 +361,7 @@ BOOL SetConfigStr(HCONFIG config, LPCTSTR szKeyName, LPCTSTR szValue) char *ptr = new char[len]; // make a UTF8 version of the name - while(WideCharToMultiByte(CP_UTF8, 0, szValue, -1, ptr, len, 0, 0) == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + while(WideCharToMultiByte(CP_UTF8, 0, szValue, -1, ptr, (int)len, 0, 0) == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { delete[] ptr; len *= 2; diff --git a/src/DockLib/DockLib.c b/src/DockLib/DockLib.c index 5eda8f6..8735d80 100644 --- a/src/DockLib/DockLib.c +++ b/src/DockLib/DockLib.c @@ -355,7 +355,7 @@ VOID DockWnd_ShowDeferredPopups(HWND hwndMain) { DOCKSERVER *dsp = GetDockServer(hwndMain); - if(dsp->fDeferShowWindow) + if(dsp && dsp->fDeferShowWindow) { DOCKPANEL *dpp; diff --git a/src/DockLib/DockLib.h b/src/DockLib/DockLib.h index e08c03f..6d9cf10 100644 --- a/src/DockLib/DockLib.h +++ b/src/DockLib/DockLib.h @@ -157,7 +157,7 @@ VOID DockWnd_ShowDeferredPopups(HWND hwndMain); HDWP DockWnd_DeferPanelPos(HDWP hdwp, HWND hwndMain, RECT *rect); -LRESULT HANDLE_NCACTIVATE(HWND hwndMain, HWND hwnd, WPARAM wParam, LPARAM lParam); +LRESULT HANDLE_NCACTIVATE(HWND hwndMain, HWND hwnd, WPARAM wParam, LPARAM lParam, WNDPROC oldProc OPTIONAL); BOOL WINAPI DockWnd_IsDialogMessage(HWND hwndMain, UINT uId, MSG *msg); diff --git a/src/DockLib/DockLib.vcxproj b/src/DockLib/DockLib.vcxproj index 7e3ac37..15ba892 100644 --- a/src/DockLib/DockLib.vcxproj +++ b/src/DockLib/DockLib.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {D5B645A0-AB6C-4C08-8A02-9EE1324A0BFD} @@ -21,34 +29,63 @@ true Unicode + + StaticLibrary + true + Unicode + StaticLibrary false true Unicode + + StaticLibrary + false + true + Unicode + + + + + + + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + @@ -63,6 +100,20 @@ true + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + + + Windows + true + + Level3 @@ -73,6 +124,26 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 ..\Common + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + MultiThreaded Windows diff --git a/src/DockLib/DockServer.c b/src/DockLib/DockServer.c index e7f4e45..9b9c547 100644 --- a/src/DockLib/DockServer.c +++ b/src/DockLib/DockServer.c @@ -25,20 +25,30 @@ DOCKSERVER *GetDockServer(HWND hwndMain) return (DOCKSERVER *)GetWindowLongPtr(hwndMain, GWLP_USERDATA); } +static LRESULT CHAIN_WNDPROC(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC oldProc) +{ + if(oldProc) + return CallWindowProc(oldProc, hwnd, msg, wParam, lParam); + else + return DefWindowProc(hwnd, msg, wParam, lParam); +} + // // The main window of app should call this in response to WM_ENABLE // // hwndMain - handle to top-level owner window // hwnd - handle to window which received message (can be same as hwndMain) // -LRESULT HANDLE_ENABLE(HWND hwndMain, HWND hwnd, WPARAM wParam, LPARAM lParam) +LRESULT HANDLE_ENABLE(HWND hwndMain, HWND hwnd, WPARAM wParam, LPARAM lParam, WNDPROC oldProc OPTIONAL) { HWND hParam = (HWND)lParam; DOCKSERVER *dsp; DOCKPANEL *dpp; if((dsp = GetDockServer(hwndMain)) == 0) - return DefWindowProc(hwnd, WM_ENABLE, wParam, lParam); + { + return CHAIN_WNDPROC(hwnd, WM_ENABLE, wParam, lParam, oldProc); + } for(dpp = dsp->PanelListHead; dpp; dpp = dpp->flink) { @@ -58,7 +68,7 @@ LRESULT HANDLE_ENABLE(HWND hwndMain, HWND hwnd, WPARAM wParam, LPARAM lParam) // hwndMain - handle to top-level owner window // hwnd - handle to window which received message (can be same as hwndMain) // -LRESULT HANDLE_NCACTIVATE(HWND hwndMain, HWND hwnd, WPARAM wParam, LPARAM lParam) +LRESULT HANDLE_NCACTIVATE(HWND hwndMain, HWND hwnd, WPARAM wParam, LPARAM lParam, WNDPROC oldProc OPTIONAL) { HWND hParam = (HWND)lParam; BOOL fKeepActive = (BOOL)wParam; @@ -68,7 +78,9 @@ LRESULT HANDLE_NCACTIVATE(HWND hwndMain, HWND hwnd, WPARAM wParam, LPARAM lParam DOCKPANEL *dpp; if((dsp = GetDockServer(hwndMain)) == 0) - return DefWindowProc(hwnd, WM_NCACTIVATE, wParam, lParam); + { + return CHAIN_WNDPROC(hwnd, WM_NCACTIVATE, wParam, lParam, oldProc); + } // // If this message was sent by the synchronise-loop (below) @@ -76,7 +88,7 @@ LRESULT HANDLE_NCACTIVATE(HWND hwndMain, HWND hwnd, WPARAM wParam, LPARAM lParam // if(hParam == (HWND)-1) { - return DefWindowProc(hwnd, WM_NCACTIVATE, wParam, 0); + return CHAIN_WNDPROC(hwnd, WM_NCACTIVATE, wParam, 0, oldProc); } // @@ -106,15 +118,15 @@ LRESULT HANDLE_NCACTIVATE(HWND hwndMain, HWND hwnd, WPARAM wParam, LPARAM lParam dpp->hwndPanel != hParam ) { - SendMessage(dpp->hwndPanel, WM_NCACTIVATE, fKeepActive, (LONG)-1); + SendMessage(dpp->hwndPanel, WM_NCACTIVATE, fKeepActive, (LPARAM)-1); } } if(hwndMain != hwnd && hwndMain != hParam) - SendMessage(hwndMain, WM_NCACTIVATE, fKeepActive, (LONG)-1); + SendMessage(hwndMain, WM_NCACTIVATE, fKeepActive, (LPARAM)-1); } - return DefWindowProc(hwnd, WM_NCACTIVATE, fKeepActive, lParam); + return CHAIN_WNDPROC(hwnd, WM_NCACTIVATE, fKeepActive, lParam, oldProc); } static LRESULT CALLBACK ServerWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -124,18 +136,13 @@ static LRESULT CALLBACK ServerWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM static BOOL fMoving; RECT rect; - //return CallWindowProc(dsp->oldproc, hwnd, msg, wParam, lParam); - switch(msg) { case WM_NCACTIVATE: - return HANDLE_NCACTIVATE(hwnd, hwnd, wParam, lParam); + return HANDLE_NCACTIVATE(hwnd, hwnd, wParam, lParam, dsp->oldproc); case WM_ENABLE: - HANDLE_ENABLE(hwnd, hwnd, wParam, lParam); - - // fall through to CallWindowProc - break; + return HANDLE_ENABLE(hwnd, hwnd, wParam, lParam, dsp->oldproc); case WM_ENTERSIZEMOVE: GetWindowRect(hwnd, &rect); @@ -292,8 +299,8 @@ BOOL WINAPI DockWnd_Initialize(HWND hwndMain, LPCTSTR szRegLoc) ds->oldproc = (WNDPROC)GetWindowLongPtr(hwndMain, GWLP_WNDPROC); ds->hwndMain = hwndMain; - SetWindowLongPtr(hwndMain, GWLP_USERDATA, (LONG)ds); - SetWindowLongPtr(hwndMain, GWLP_WNDPROC, (LONG)ServerWndProc); + SetWindowLongPtr(hwndMain, GWLP_USERDATA, (LONG_PTR)ds); + SetWindowLongPtr(hwndMain, GWLP_WNDPROC, (LONG_PTR)ServerWndProc); return TRUE; } diff --git a/src/DockLib/DockWnd.c b/src/DockLib/DockWnd.c index fbc430c..5d246dc 100644 --- a/src/DockLib/DockWnd.c +++ b/src/DockLib/DockWnd.c @@ -9,6 +9,7 @@ #define _WIN32_WINNT 0x501 #include +#include #include #include @@ -40,7 +41,7 @@ BOOL fOverTab; // This is called whenever a dockwindow is being dragged, and we want to determine // if the current dockwindow is being dragged on top of another // -DOCKPANEL * DockPanelFromPt(DOCKSERVER *dsp, DOCKPANEL *dppDragging, POINT pt, OUT RECT *rect, OUT UINT *hit) +DOCKPANEL * DockPanelFromPt(DOCKSERVER *dsp, DOCKPANEL *dppDragging, POINT pt, OUT RECT *rect, OUT UINT_PTR *hit) { DOCKPANEL *dpp; @@ -70,7 +71,7 @@ DOCKPANEL * DockPanelFromPt(DOCKSERVER *dsp, DOCKPANEL *dppDragging, POINT pt, O // if floating else { - UINT uHit = DefWindowProc(dpp->hwndPanel, WM_NCHITTEST, 0, MAKELONG(pt.x, pt.y)); + UINT_PTR uHit = DefWindowProc(dpp->hwndPanel, WM_NCHITTEST, 0, MAKELONG(pt.x, pt.y)); RECT rcTab; if(hit) *hit = uHit; @@ -126,7 +127,7 @@ int GetClosestSide(IN RECT *rect, IN POINT pt, OUT int * distance) UINT GetDockTarget(DOCKSERVER *dsp, DOCKPANEL *dppDragging, POINT pt, RECT *rectDrag, DOCKPANEL **pdppUnder) { DOCKPANEL *dppUnder; - UINT uHit; + UINT_PTR uHit; if(GetKeyState(VK_CONTROL) & 0x80000000) { @@ -385,7 +386,7 @@ void DockPanel_RemoveKeyboardHook(DOCKPANEL *dpp) g_hKeyboardHook = 0; } -LRESULT DockPanel_OnNcLButtonDown(DOCKPANEL *dpp, UINT uHitTest) +LRESULT DockPanel_OnNcLButtonDown(DOCKPANEL *dpp, UINT_PTR uHitTest) { // the window will start moving, but keep track of // the initial window-rectangles and drag status @@ -674,13 +675,13 @@ LRESULT DockPanel_ExitSizeMove(DOCKPANEL *dpp) // // timer - used to animate the fade in/out of the transparent window // -LRESULT DockPanel_Timer(DOCKPANEL *dpp, UINT id) +LRESULT DockPanel_Timer(DOCKPANEL *dpp, UINT_PTR id) { extern HWND hwndAnimPanel; HWND hwndParam = (HWND)id; // get current alpha value - BYTE alpha = (BYTE)GetWindowLong(hwndParam, GWL_USERDATA); + BYTE alpha = (BYTE)GetWindowLongPtr(hwndParam, GWLP_USERDATA); BLENDFUNCTION blendPixelFunction = { AC_SRC_OVER, 0, -1, AC_SRC_ALPHA }; if(hwndAnimPanel != hwndParam || alpha == 0) @@ -692,7 +693,7 @@ LRESULT DockPanel_Timer(DOCKPANEL *dpp, UINT id) // adjust alpha value towards '0' alpha = alpha < 24 ? 0 : alpha - 24; - SetWindowLong(hwndParam, GWL_USERDATA, alpha); + SetWindowLongPtr(hwndParam, GWLP_USERDATA, alpha); // update the layered window transparency blendPixelFunction.SourceConstantAlpha = alpha; @@ -809,7 +810,7 @@ LRESULT DockPanel_OnMoving(DOCKPANEL *dppThis) if(hwndTransPanel != 0) { hwndAnimPanel = hwndTransPanel; - SetWindowLong(hwndAnimPanel, GWL_USERDATA, 255); + SetWindowLongPtr(hwndAnimPanel, GWLP_USERDATA, 255); SetTimer(dppThis->hwndPanel, (UINT)hwndAnimPanel, 10, 0); hwndTransPanel = 0; } @@ -859,7 +860,7 @@ LRESULT CALLBACK DockPanelProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam return TRUE; case WM_NCACTIVATE: - return HANDLE_NCACTIVATE(dpp->hwndMain, hwnd, wParam, lParam); + return HANDLE_NCACTIVATE(dpp->hwndMain, hwnd, wParam, lParam, NULL); case WM_CREATE: dpp->fVisible = TRUE; @@ -901,13 +902,13 @@ LRESULT CALLBACK DockPanelProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam return DockPanel_SetCursor(dpp, wParam, lParam); case WM_LBUTTONDOWN: - return DockPanel_OnLButtonDown(dpp, (short)LOWORD(lParam), (short)HIWORD(lParam)); + return DockPanel_OnLButtonDown(dpp, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_MOUSEMOVE: - return DockPanel_OnMouseMove(dpp, (short)LOWORD(lParam), (short)HIWORD(lParam)); + return DockPanel_OnMouseMove(dpp, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_LBUTTONUP: - return DockPanel_OnLButtonUp(dpp, (short)LOWORD(lParam), (short)HIWORD(lParam)); + return DockPanel_OnLButtonUp(dpp, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_MOVING: return DockPanel_OnMoving(dpp); diff --git a/src/GridView/GridView.cpp b/src/GridView/GridView.cpp index c269b67..858bca2 100644 --- a/src/GridView/GridView.cpp +++ b/src/GridView/GridView.cpp @@ -12,6 +12,7 @@ #define WIN32_LEAN_AND_MEAN #include +#include #include #include #include "GridViewInternal.h" @@ -472,22 +473,22 @@ LRESULT GridView::WndProc(UINT msg, WPARAM wParam, LPARAM lParam) return OnMouseWheel((short)HIWORD(wParam)); case WM_LBUTTONDBLCLK: - return OnLButtonDblClick((short)LOWORD(lParam), (short)HIWORD(lParam)); + return OnLButtonDblClick(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_LBUTTONDOWN: - return OnLButtonDown((short)LOWORD(lParam), (short)HIWORD(lParam)); + return OnLButtonDown(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_RBUTTONDOWN: - return OnRButtonDown((short)LOWORD(lParam), (short)HIWORD(lParam)); + return OnRButtonDown(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_LBUTTONUP: - return OnLButtonUp((short)LOWORD(lParam), (short)HIWORD(lParam)); + return OnLButtonUp(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_MOUSEMOVE: - return OnMouseMove((short)LOWORD(lParam), (short)HIWORD(lParam)); + return OnMouseMove(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_TIMER: - return OnTimer((UINT)wParam); + return OnTimer((UINT_PTR)wParam); case WM_THEMECHANGED: if(m_hComboTheme) diff --git a/src/GridView/GridView.vcxproj b/src/GridView/GridView.vcxproj index 1dc8562..a9d2697 100644 --- a/src/GridView/GridView.vcxproj +++ b/src/GridView/GridView.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {93B6F7BD-DDB7-4FEA-8994-1927AD706DD6} @@ -21,28 +29,63 @@ true Unicode + + StaticLibrary + true + Unicode + StaticLibrary false true Unicode + + StaticLibrary + false + true + Unicode + + + + + + + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + + + $(ProjectDir)$(Configuration)\ + + + $(ProjectDir)$(Configuration)\ + + + $(ProjectDir)$(Configuration)\ + + + $(ProjectDir)$(Configuration)\ + @@ -57,6 +100,20 @@ true + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + + + Windows + true + + Level3 @@ -67,6 +124,26 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 ..\Common + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + MultiThreaded Windows diff --git a/src/GridView/GridViewInternal.h b/src/GridView/GridViewInternal.h index 7101b50..971d398 100644 --- a/src/GridView/GridViewInternal.h +++ b/src/GridView/GridViewInternal.h @@ -64,7 +64,7 @@ class GridView LRESULT OnVScroll(UINT uSBCode, UINT uPos); LRESULT OnHScroll(UINT uSBCode, UINT uPos); LRESULT OnMouseWheel(int nDelta); - LRESULT OnTimer(UINT nTimer); + LRESULT OnTimer(UINT_PTR nTimer); bool PinToBottomCorner(); void Scroll(int dx, int dy); HRGN ScrollRgn(int dx, int dy, bool fReturnUpdateRgn); diff --git a/src/GridView/GridViewMouse.cpp b/src/GridView/GridViewMouse.cpp index e4c4352..575f528 100644 --- a/src/GridView/GridViewMouse.cpp +++ b/src/GridView/GridViewMouse.cpp @@ -351,7 +351,7 @@ LRESULT GridView::OnLButtonDblClick(int x, int y) // // Used to handle mouse-scrolling // -LRESULT GridView::OnTimer(UINT nTimer) +LRESULT GridView::OnTimer(UINT_PTR nTimer) { RECT rect; POINT pt; diff --git a/src/HexEdit/ColourCombo.c b/src/HexEdit/ColourCombo.c index f1a25a7..40220b5 100644 --- a/src/HexEdit/ColourCombo.c +++ b/src/HexEdit/ColourCombo.c @@ -70,9 +70,9 @@ BOOL WINAPI ColourCombo_DrawItem(CTRLITEM *cip, DRAWITEMSTRUCT *dis, BOOL fDrawB // Get the item text // if(dis->itemID == -1) - SendMessage(dis->hwndItem, WM_GETTEXT, 0, (LONG)szText); + SendMessage(dis->hwndItem, WM_GETTEXT, 0, (LPARAM)szText); else - SendMessage(dis->hwndItem, CB_GETLBTEXT, dis->itemID, (LONG)szText); + SendMessage(dis->hwndItem, CB_GETLBTEXT, dis->itemID, (LPARAM)szText); // // Draw the text (centered vertically) @@ -105,7 +105,7 @@ BOOL WINAPI ColourCombo_DrawItem(CTRLITEM *cip, DRAWITEMSTRUCT *dis, BOOL fDrawB if(dis->itemState & ODS_DISABLED) PaintFrameRect(dis->hDC, &rect, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DFACE)); else - PaintFrameRect(dis->hDC, &rect, RGB(0,0,0), dis->itemData);//REALIZE_SYSCOL(dis->itemData)); + PaintFrameRect(dis->hDC, &rect, RGB(0,0,0), (COLORREF)dis->itemData);//REALIZE_SYSCOL(dis->itemData)); return TRUE; @@ -113,7 +113,7 @@ BOOL WINAPI ColourCombo_DrawItem(CTRLITEM *cip, DRAWITEMSTRUCT *dis, BOOL fDrawB void AddColourComboItem(HWND hwndCombo, COLORREF col, TCHAR *szName) { - int idx = (int)SendMessage(hwndCombo, CB_ADDSTRING, 0, (LONG)szName); + int idx = (int)SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)szName); SendMessage(hwndCombo, CB_SETITEMDATA, idx, col); } diff --git a/src/HexEdit/ComboFont.c b/src/HexEdit/ComboFont.c index ee6a8a7..5b9ef16 100644 --- a/src/HexEdit/ComboFont.c +++ b/src/HexEdit/ComboFont.c @@ -56,7 +56,7 @@ int CALLBACK EnumFontNames(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD fTrueType = (lpntme->ntmTm.ntmFlags & NTM_TT_OPENTYPE) ? 2 : fTrueType; // store this information in the list-item's userdata area - SendMessage(hwndCombo, CB_SETITEMDATA, idx, MAKEWPARAM(fFixed, fTrueType)); + SendMessage(hwndCombo, CB_SETITEMDATA, idx, MAKELPARAM(fFixed, fTrueType)); /*{ COMBOBOXEXITEM cbxi = { CBEIF_TEXT, 0, pszName }; @@ -161,9 +161,9 @@ BOOL WINAPI FontCombo_DrawItem(CTRLITEM *cip, DRAWITEMSTRUCT *dis, BOOL fDrawBac // Get the item text // if(dis->itemID == -1) - SendMessage(dis->hwndItem, WM_GETTEXT, 0, (LONG)szText); + SendMessage(dis->hwndItem, WM_GETTEXT, 0, (LPARAM)szText); else - SendMessage(dis->hwndItem, CB_GETLBTEXT, dis->itemID, (LONG)szText); + SendMessage(dis->hwndItem, CB_GETLBTEXT, dis->itemID, (LPARAM)szText); diff --git a/src/HexEdit/DlgExport.c b/src/HexEdit/DlgExport.c index ba1b67c..10ad11b 100644 --- a/src/HexEdit/DlgExport.c +++ b/src/HexEdit/DlgExport.c @@ -505,7 +505,7 @@ BOOL ExportMotorola(FILE *fp, HWND hwndHexView, size_w offset, size_w length, IM HexView_GetDataAdv(hwndHexView, buf, len); // 'data' record (type=3) - alen = motorola_frame(ach, 3, len, (size_t)offset, buf); + alen = motorola_frame(ach, 3, (unsigned)len, (unsigned long)offset, buf); fprintf(fp, "%.*s\n", alen, ach); length -= len; diff --git a/src/HexEdit/DlgHighlight.c b/src/HexEdit/DlgHighlight.c index 389e8de..664df0d 100644 --- a/src/HexEdit/DlgHighlight.c +++ b/src/HexEdit/DlgHighlight.c @@ -704,7 +704,7 @@ BOOL Ooop4(HGRIDITEM hRoot, HWND hwndGridView, TCHAR *szBookPath, COLORREF col) hBookmarks = OpenConfigSection(hConf, TEXT("hexFileData\\bookmarks")); - for(i = 0; bookmark = EnumConfigSection(hBookmarks, TEXT("bookmark"), i); i++) + for(i = 0; bookmark = EnumConfigSection(hBookmarks, TEXT("bookmark"), (int)i); i++) { TCHAR name[100], desc[100]; BOOKMARK bm = { 0, 0, 0, 0, 0, name, 100, desc, 100 }; diff --git a/src/HexEdit/DlgPasteSpecial.c b/src/HexEdit/DlgPasteSpecial.c index fca23c5..3de6271 100644 --- a/src/HexEdit/DlgPasteSpecial.c +++ b/src/HexEdit/DlgPasteSpecial.c @@ -239,7 +239,7 @@ DWORD WINAPI PipeWriteProc(PIPE_PARAMS *param) dwGlobalSize = (DWORD)GlobalSize(pGlobalMem); - len = strlen((char *)pGlobalMem); + len = (DWORD)strlen((char *)pGlobalMem); dwGlobalSize = len + 1; // write the entire memory block to the pipe diff --git a/src/HexEdit/DockWindow.h b/src/HexEdit/DockWindow.h index 86e1f5f..82ba16e 100644 --- a/src/HexEdit/DockWindow.h +++ b/src/HexEdit/DockWindow.h @@ -81,8 +81,8 @@ BOOL DockWnd_Position (HWND hwndMain, HDWP hdwp, DockWnd dwnd[], int nNumDockWn UINT DockWnd_GetDockSide (HWND hwnd, NMDOCKWNDQUERY *nmdwq, RECT *prc1, RECT *prc2); -LRESULT HANDLE_NCACTIVATE (HWND hwndMain, HWND hwndMsg, WPARAM wParam, LPARAM lParam); -LRESULT HANDLE_ENABLE (HWND hwndMain, HWND hwndMsg, WPARAM wParam, LPARAM lParam); +LRESULT HANDLE_NCACTIVATE (WNDPROC oldProc, HWND hwndMain, HWND hwndMsg, WPARAM wParam, LPARAM lParam); +LRESULT HANDLE_ENABLE (WNDPROC oldProc, HWND hwndMain, HWND hwndMsg, WPARAM wParam, LPARAM lParam); // // DockWnd styles diff --git a/src/HexEdit/HexEdit.c b/src/HexEdit/HexEdit.c index 2cef52e..1090782 100644 --- a/src/HexEdit/HexEdit.c +++ b/src/HexEdit/HexEdit.c @@ -1170,6 +1170,31 @@ TCHAR * GetArg(TCHAR *ptr, TCHAR *buf, int len) return ptr; } +// +// http://randomascii.wordpress.com/2012/07/05/when-even-crashing-doesnt-work/ +// +void EnableCrashingOnCrashes() +{ + typedef BOOL (WINAPI *tGetPolicy)(LPDWORD lpFlags); + typedef BOOL (WINAPI *tSetPolicy)(DWORD dwFlags); + const DWORD EXCEPTION_SWALLOWING = 0x1; + + HMODULE kernel32 = LoadLibraryA("kernel32.dll"); + + tGetPolicy pGetPolicy = (tGetPolicy)GetProcAddress(kernel32, "GetProcessUserModeExceptionPolicy"); + tSetPolicy pSetPolicy = (tSetPolicy)GetProcAddress(kernel32, "SetProcessUserModeExceptionPolicy"); + + if (pGetPolicy && pSetPolicy) + { + DWORD dwFlags; + if (pGetPolicy(&dwFlags)) + { + // Turn off the filter + pSetPolicy(dwFlags & ~EXCEPTION_SWALLOWING); + } + } +} + int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, int nShowCmd) { MSG msg; @@ -1177,6 +1202,8 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, int nShowC TCHAR arg[MAX_PATH]; TCHAR * pszCmdline; + EnableCrashingOnCrashes(); + //INITCOMMONCONTROLSEX icx = { sizeof(icx), ICC_ g_hInstance = hInst; diff --git a/src/HexEdit/HexEdit.h b/src/HexEdit/HexEdit.h index f651889..a4b9cd9 100644 --- a/src/HexEdit/HexEdit.h +++ b/src/HexEdit/HexEdit.h @@ -132,8 +132,8 @@ void AddSearchTypes(HWND hwndCombo, int startType, int endType, int initial); void HexView_CursorChanged(HWND hwndMain, HWND hwndHV); -#define REGBASE TEXT("Software\\Catch22\\HexEdit 2.0 beta4") -#define REGLOC TEXT("Software\\Catch22\\HexEdit 2.0 beta4\\DockLib") +#define REGBASE TEXT("Software\\Catch22\\HexEdit 2.0 beta5") +#define REGLOC TEXT("Software\\Catch22\\HexEdit 2.0 beta5\\DockLib") typedef unsigned __int64 QWORD; diff --git a/src/HexEdit/HexEdit.vcxproj b/src/HexEdit/HexEdit.vcxproj index 778ea93..81f7aeb 100644 --- a/src/HexEdit/HexEdit.vcxproj +++ b/src/HexEdit/HexEdit.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {6BD408DB-3E6D-4649-9A92-4A4E52E70137} @@ -21,30 +29,55 @@ true Unicode + + Application + true + Unicode + Application false true Unicode + + Application + false + true + Unicode + + + + + + + true $(SolutionDir)bin\$(PlatformShortName)\$(Configuration)\ + + true + $(SolutionDir)bin\$(PlatformShortName)\$(Configuration)\ + false $(SolutionDir)bin\$(PlatformShortName)\$(Configuration)\ + + false + $(SolutionDir)bin\$(PlatformShortName)\$(Configuration)\ + @@ -61,6 +94,22 @@ kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);uxtheme.lib + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + + + Windows + true + uxtheme.dll + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);uxtheme.lib + + Level3 @@ -71,6 +120,28 @@ true WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);SEQUENCE64 ..\Common + MultiThreaded + + + Windows + true + true + true + uxtheme.dll + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);uxtheme.lib + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + MultiThreaded Windows diff --git a/src/HexEdit/HexFind.c b/src/HexEdit/HexFind.c index dcce991..3bd6b2c 100644 --- a/src/HexEdit/HexFind.c +++ b/src/HexEdit/HexFind.c @@ -700,7 +700,7 @@ INT_PTR CALLBACK FindHexDlg(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: sps = (SEARCH_PANE_STATE *)lParam; - SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)sps); + SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)sps); EnableDialogTheme(hwnd); diff --git a/src/HexEdit/HexUtils.c b/src/HexEdit/HexUtils.c index c8196f5..7ca88ec 100644 --- a/src/HexEdit/HexUtils.c +++ b/src/HexEdit/HexUtils.c @@ -426,7 +426,7 @@ BOOL LoadTabbedString(UINT uId, TCHAR *dest, DWORD dwLength) UINT AddStyle(HWND hwnd, UINT style) { UINT oldstyle = GetWindowLong(hwnd, GWL_STYLE); - SetWindowLong(hwnd, GWL_STYLE, oldstyle | style); + SetWindowLongPtr(hwnd, GWL_STYLE, oldstyle | style); return oldstyle; } @@ -438,7 +438,7 @@ UINT AddDlgItemStyle(HWND hwnd, UINT nCtrlId, UINT style) UINT DelStyle(HWND hwnd, UINT style) { UINT oldstyle = GetWindowLong(hwnd, GWL_STYLE); - SetWindowLong(hwnd, GWL_STYLE, oldstyle & ~style); + SetWindowLongPtr(hwnd, GWL_STYLE, oldstyle & ~style); return oldstyle; } diff --git a/src/HexEdit/Hexedit.exe.manifest b/src/HexEdit/Hexedit.exe.manifest index 963ee37..1715332 100644 --- a/src/HexEdit/Hexedit.exe.manifest +++ b/src/HexEdit/Hexedit.exe.manifest @@ -2,7 +2,7 @@ @@ -13,7 +13,7 @@ type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" - processorArchitecture="X86" + processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /> diff --git a/src/HexEdit/Options.c b/src/HexEdit/Options.c index 4d3eb98..e0549e8 100644 --- a/src/HexEdit/Options.c +++ b/src/HexEdit/Options.c @@ -76,7 +76,7 @@ TEXT("Cyan"), void AddColourListItem(HWND hwnd, UINT uItem, int fgIdx, int bgIdx, TCHAR *szName) { HWND hwndCtrl = GetDlgItem(hwnd, uItem); - int idx = (int)SendMessage(hwndCtrl, LB_ADDSTRING, 0, (LONG)szName); + int idx = (int)SendMessage(hwndCtrl, LB_ADDSTRING, 0, (LPARAM)szName); SendMessage(hwndCtrl, LB_SETITEMDATA, idx, MAKELONG(fgIdx, bgIdx)); } @@ -84,7 +84,7 @@ void AddColourListItem(HWND hwnd, UINT uItem, int fgIdx, int bgIdx, TCHAR *szNam /*void AddColourComboItem(HWND hwnd, UINT uItem, COLORREF col, TCHAR *szName) { HWND hwndCtrl = GetDlgItem(hwnd, uItem); - int idx = SendMessage(hwndCtrl, CB_ADDSTRING, 0, (LONG)szName); + int idx = SendMessage(hwndCtrl, CB_ADDSTRING, 0, (LPARAM)szName); SendMessage(hwndCtrl, CB_SETITEMDATA, idx, col); }*/ @@ -152,7 +152,7 @@ INT_PTR CALLBACK DisplayOptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA // Subclass the PREVIEW static control so we can custom-draw it // hwndPreview = GetDlgItem(hwnd, IDC_PREVIEW); - oldPreviewProc = (WNDPROC)SetWindowLongPtr(hwndPreview, GWLP_WNDPROC, (LONG)PreviewWndProc); + oldPreviewProc = (WNDPROC)SetWindowLongPtr(hwndPreview, GWLP_WNDPROC, (LONG_PTR)PreviewWndProc); AddColourListItem(hwnd, IDC_ITEMLIST, -1, HVC_BACKGROUND, TEXT("Background")); AddColourListItem(hwnd, IDC_ITEMLIST, HVC_ADDRESS, HVC_BACKGROUND, TEXT("Address Column")); diff --git a/src/HexEdit/Searchbar.c b/src/HexEdit/Searchbar.c index 7d347f1..dd9f39c 100644 --- a/src/HexEdit/Searchbar.c +++ b/src/HexEdit/Searchbar.c @@ -89,7 +89,7 @@ int GetToolbarRect(HWND hwndTB, RECT *rect) for(i = 0; i < count; i++) { - SendMessage(hwndTB, TB_GETITEMRECT, i, (LONG)&tmp); + SendMessage(hwndTB, TB_GETITEMRECT, i, (LPARAM)&tmp); UnionRect(rect, rect, &tmp); } diff --git a/src/HexEdit/Toolbar.c b/src/HexEdit/Toolbar.c index 77e82ff..b939add 100644 --- a/src/HexEdit/Toolbar.c +++ b/src/HexEdit/Toolbar.c @@ -162,11 +162,11 @@ HWND InitToolbar(HWND hwndParent) //SendMessage(hwndTB, TB_ADDBUTTONS, 1, (LPARAM) &tbb); SendMessage(hwndTB, TB_ADDBUTTONS, sizeof(tbb)/sizeof(tbb[0]), (LPARAM) &tbb); - SendMessage(hwndTB, TB_SETBUTTONINFO, IDM_TOOLS_TYPEVIEW, (LONG)&tbi); + SendMessage(hwndTB, TB_SETBUTTONINFO, IDM_TOOLS_TYPEVIEW, (LPARAM)&tbi); tbi.pszText = TEXT("BookMarks"); tbi.idCommand = IDM_HIGHLIGHT_MANAGE; - SendMessage(hwndTB, TB_SETBUTTONINFO, IDM_HIGHLIGHT_MANAGE, (LONG)&tbi); + SendMessage(hwndTB, TB_SETBUTTONINFO, IDM_HIGHLIGHT_MANAGE, (LPARAM)&tbi); // break; //} } diff --git a/src/HexEdit/intel.c b/src/HexEdit/intel.c index 939a04f..30fd7f1 100644 --- a/src/HexEdit/intel.c +++ b/src/HexEdit/intel.c @@ -62,7 +62,7 @@ size_t intel_frame(char *hrec, int type, size_t count, unsigned long addr, BYTE *h++ = ':'; // record-length - h += fmtbyte(h, count, &checksum); + h += fmtbyte(h, (unsigned)count, &checksum); // address h += fmtbyte(h, addr >> 8, &checksum); diff --git a/src/HexEdit/motorola.c b/src/HexEdit/motorola.c index decc20f..f5d0908 100644 --- a/src/HexEdit/motorola.c +++ b/src/HexEdit/motorola.c @@ -61,7 +61,7 @@ size_t motorola_frame(char *srec, int type, size_t count, unsigned long addr, BY *s++ = '0' + type; // record size - s += fmtbyte(s, sizelook[type] + count + 1, &checksum); + s += fmtbyte(s, sizelook[type] + (unsigned)count + 1, &checksum); // 2/3/4 byte address field (depends on type) switch(type) diff --git a/src/HexView/HexView.cpp b/src/HexView/HexView.cpp index 581aaa0..b0f64a9 100644 --- a/src/HexView/HexView.cpp +++ b/src/HexView/HexView.cpp @@ -10,6 +10,7 @@ #define STRICT #define _WIN32_WINNT 0x501 #include +#include #include #include #include "HexView.h" @@ -688,20 +689,20 @@ LRESULT HexView::WndProc(UINT msg, WPARAM wParam, LPARAM lParam) return OnMouseActivate((HWND)wParam, LOWORD(lParam), HIWORD(lParam)); case WM_LBUTTONDOWN: - return OnLButtonDown((UINT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam)); + return OnLButtonDown((UINT)wParam, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_LBUTTONDBLCLK: - return OnLButtonDblClick((UINT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam)); + return OnLButtonDblClick((UINT)wParam, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_RBUTTONDOWN: - OnRButtonDown((UINT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam)); + OnRButtonDown((UINT)wParam, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); return DefWindowProc(m_hWnd, msg, wParam, lParam); case WM_LBUTTONUP: - return OnLButtonUp((UINT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam)); + return OnLButtonUp((UINT)wParam, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_MOUSEMOVE: - return OnMouseMove((UINT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam)); + return OnMouseMove((UINT)wParam, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); case WM_MOUSEWHEEL: return OnMouseWheel((short)HIWORD(wParam)); diff --git a/src/HexView/HexView.vcxproj b/src/HexView/HexView.vcxproj index 1ed3254..ae61116 100644 --- a/src/HexView/HexView.vcxproj +++ b/src/HexView/HexView.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {3FBA3178-4AE6-4103-9EB2-542901D978B7} @@ -21,34 +29,63 @@ true Unicode + + StaticLibrary + true + Unicode + StaticLibrary false true Unicode + + StaticLibrary + false + true + Unicode + + + + + + + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + @@ -63,6 +100,20 @@ true + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + + + Windows + true + + Level3 @@ -73,6 +124,26 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 ..\Common + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + MultiThreaded Windows diff --git a/src/TypeLib/TypeLib.vcxproj b/src/TypeLib/TypeLib.vcxproj index db8cd71..3b21b07 100644 --- a/src/TypeLib/TypeLib.vcxproj +++ b/src/TypeLib/TypeLib.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {E101755F-A81A-4C12-9B4B-8485BF8E66DA} @@ -21,32 +29,59 @@ true Unicode + + StaticLibrary + true + Unicode + StaticLibrary false true Unicode + + StaticLibrary + false + true + Unicode + + + + + + + $(ProjectDir)$(Configuration)\ $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + @@ -61,6 +96,20 @@ true + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + + + Windows + true + + Level3 @@ -71,6 +120,26 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 ..\Common + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + MultiThreaded Windows diff --git a/src/TypeView/TypeView.vcxproj b/src/TypeView/TypeView.vcxproj index 77f7974..5a0a08a 100644 --- a/src/TypeView/TypeView.vcxproj +++ b/src/TypeView/TypeView.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {8724EC2D-4352-46B2-AB57-3C3430BD52DB} @@ -21,34 +29,63 @@ true Unicode + + StaticLibrary + true + Unicode + StaticLibrary false true Unicode + + StaticLibrary + false + true + Unicode + + + + + + + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ + + $(ProjectDir)$(Configuration)\ + @@ -63,6 +100,20 @@ true + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + + + Windows + true + + Level3 @@ -73,6 +124,26 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 ..\Common + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);SEQUENCE64 + ..\Common + MultiThreaded Windows diff --git a/src/TypeView/TypeViewWnd.cpp b/src/TypeView/TypeViewWnd.cpp index 05fd796..c90ca58 100644 --- a/src/TypeView/TypeViewWnd.cpp +++ b/src/TypeView/TypeViewWnd.cpp @@ -301,7 +301,7 @@ Type * bollocks(Type *bn, int &i, int &idx) { if(i == idx) { - i = j+k; + i = (int)(j+k); return bn; } @@ -572,9 +572,9 @@ LRESULT CALLBACK TypeViewCommandHandler(HWND hwnd, UINT msg, WPARAM wParam, LPAR } HWND hwndEdit = GetWindow(gti.hwndActive, GW_CHILD); - int line = SendMessage(hwndEdit, EM_LINEFROMCHAR, type->parent->fileRef.wspEnd, 0); - int s = SendMessage(hwndEdit, EM_LINEINDEX, line, 0); - int len = SendMessage(hwndEdit, EM_LINELENGTH, line, 0); + int line = (int)SendMessage(hwndEdit, EM_LINEFROMCHAR, type->parent->fileRef.wspEnd, 0); + int s = (int)SendMessage(hwndEdit, EM_LINEINDEX, line, 0); + int len = (int)SendMessage(hwndEdit, EM_LINELENGTH, line, 0); SendMessage(hwndEdit, EM_SETSEL, s, s+len); SendMessage(hwndEdit, EM_SCROLLCARET, 0, 0); @@ -646,7 +646,7 @@ void SaveTypeView(HWND hwndPanel, HKEY hKey) HWND hwndHeader = GridView_GetHeader(hwndGridView); HWND hwndTB = GetDlgItem(hwndPanel, IDC_TYPEVIEW_TOOLBAR); int count = Header_GetItemCount(hwndHeader), i; - UINT state; + UINT_PTR state; state = SendMessage(hwndTB, TB_GETSTATE, IDC_TYPEVIEW_PIN, 0);