Skip to content
Merged

X64 #15

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.sdf
*.sln
*.suo
*.obj
*.tlog
*.dll
*.lib
*.exp
NppJSONViewer/Debug
NppJSONViewer/Release
NppJSONViewer/x64
NppJSONViewer/NppJSONViewer.vcxproj.user
*.aps
*.zip
2 changes: 1 addition & 1 deletion NppJSONViewer/DockingDlgInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class DockingDlgInterface : public StaticDialog
};

protected :
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM /*wParam*/, LPARAM lParam)
{
switch (message)
{
Expand Down
20 changes: 10 additions & 10 deletions NppJSONViewer/Hyperlinks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ LRESULT CALLBACK _HyperlinkParentProc(HWND hwnd, UINT message, WPARAM wParam, LP
}
case WM_DESTROY:
{
SetWindowLong(hwnd, GWL_WNDPROC, (LONG) pfnOrigProc);
SetWindowLongPtr(hwnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(pfnOrigProc));
RemoveProp(hwnd, PROP_ORIGINAL_PROC);
break;
}
Expand All @@ -56,7 +56,7 @@ LRESULT CALLBACK _HyperlinkProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
{
case WM_DESTROY:
{
SetWindowLong(hwnd, GWL_WNDPROC, (LONG) pfnOrigProc);
SetWindowLongPtr(hwnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(pfnOrigProc));
RemoveProp(hwnd, PROP_ORIGINAL_PROC);

HFONT hOrigFont = (HFONT) GetProp(hwnd, PROP_ORIGINAL_FONT);
Expand Down Expand Up @@ -102,10 +102,10 @@ LRESULT CALLBACK _HyperlinkProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
{
// Since IDC_HAND is not available on all operating systems,
// we will load the arrow cursor if IDC_HAND is not present.
HCURSOR hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND));
HCURSOR hCursor = LoadCursor(NULL, IDC_HAND);
if (NULL == hCursor)
{
hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));
hCursor = LoadCursor(NULL, IDC_ARROW);
}
SetCursor(hCursor);
return TRUE;
Expand All @@ -122,24 +122,24 @@ BOOL ConvertStaticToHyperlink(HWND hwndCtl)
HWND hwndParent = GetParent(hwndCtl);
if (NULL != hwndParent)
{
WNDPROC pfnOrigProc = (WNDPROC) GetWindowLong(hwndParent, GWL_WNDPROC);
WNDPROC pfnOrigProc = (WNDPROC) GetWindowLongPtr(hwndParent, GWLP_WNDPROC);
if (pfnOrigProc != _HyperlinkParentProc)
{
SetProp(hwndParent, PROP_ORIGINAL_PROC, (HANDLE) pfnOrigProc);
SetWindowLong(hwndParent, GWL_WNDPROC, (LONG) (WNDPROC) _HyperlinkParentProc);
SetWindowLongPtr(hwndParent, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(_HyperlinkParentProc));
}
}

// Make sure the control will send notifications.

DWORD dwStyle = GetWindowLong(hwndCtl, GWL_STYLE);
SetWindowLong(hwndCtl, GWL_STYLE, dwStyle | SS_NOTIFY);
LONG_PTR dwStyle = GetWindowLongPtr(hwndCtl, GWL_STYLE);
SetWindowLongPtr(hwndCtl, GWL_STYLE, dwStyle | SS_NOTIFY);

// Subclass the existing control.

WNDPROC pfnOrigProc = (WNDPROC) GetWindowLong(hwndCtl, GWL_WNDPROC);
WNDPROC pfnOrigProc = (WNDPROC)GetWindowLongPtr(hwndCtl, GWLP_WNDPROC);
SetProp(hwndCtl, PROP_ORIGINAL_PROC, (HANDLE) pfnOrigProc);
SetWindowLong(hwndCtl, GWL_WNDPROC, (LONG) (WNDPROC) _HyperlinkProc);
SetWindowLongPtr(hwndCtl, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(_HyperlinkProc));

// Create an updated font by adding an underline.

Expand Down
9 changes: 6 additions & 3 deletions NppJSONViewer/JSONDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void JSONDialog::setJSON(char* json)

void JSONDialog::populateTree (HWND hWndDlg, HTREEITEM tree_root, json_t * json_root, int level)
{
HTREEITEM newItem;
HTREEITEM newItem = NULL;
switch (json_root->type)
{
case JSON_STRING:
Expand Down Expand Up @@ -281,7 +281,10 @@ void JSONDialog::populateTree (HWND hWndDlg, HTREEITEM tree_root, json_t * json_

while (ita != NULL)
{
populateTree(hWndDlg,newItem,ita, level + 1);
if (newItem)
{
populateTree(hWndDlg, newItem, ita, level + 1);
}
ita = ita->next;
}
}
Expand Down Expand Up @@ -344,7 +347,7 @@ void JSONDialog::drawTree()
}
}

BOOL CALLBACK JSONDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK JSONDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
int width,height;
switch (message)
Expand Down
4 changes: 3 additions & 1 deletion NppJSONViewer/JSONDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

#include "DockingDlgInterface.h"
#include "PluginInterface.h"
#include <commctrl.h>
#include "resource.h"
#include "json.h"

class JSONDialog : public DockingDlgInterface
Expand All @@ -46,7 +48,7 @@ public :
void setJSON(char *json);

protected :
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
};

#endif //JSONDIALOG_H
30 changes: 16 additions & 14 deletions NppJSONViewer/NPPJSONViewer.sln
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NPPJSONViewer", "NPPJSONViewer.vcxproj", "{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
ANSI Debug|Win32 = ANSI Debug|Win32
ANSI Release|Win32 = ANSI Release|Win32
Unicode Debug|Win32 = Unicode Debug|Win32
Unicode Realeas|Win32 = Unicode Realeas|Win32
Debug|x64 = Debug|x64
Debug|Win32 = Debug|Win32
Release|x64 = Release|x64
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.ANSI Debug|Win32.ActiveCfg = Unicode Release|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.ANSI Debug|Win32.Build.0 = Unicode Release|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.ANSI Release|Win32.ActiveCfg = ANSI Release|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.ANSI Release|Win32.Build.0 = ANSI Release|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Unicode Debug|Win32.ActiveCfg = Unicode Release|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Unicode Debug|Win32.Build.0 = Unicode Release|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Unicode Realeas|Win32.ActiveCfg = Unicode Release|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Unicode Realeas|Win32.Build.0 = Unicode Release|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x64.ActiveCfg = Debug|x64
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x64.Build.0 = Debug|x64
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|Win32.ActiveCfg = Debug|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|Win32.Build.0 = Debug|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.ActiveCfg = Release|x64
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.Build.0 = Release|x64
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|Win32.ActiveCfg = Release|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading