@@ -40,7 +40,7 @@ LRESULT CALLBACK _HyperlinkParentProc(HWND hwnd, UINT message, WPARAM wParam, LP
4040 }
4141 case WM_DESTROY:
4242 {
43- SetWindowLong (hwnd, GWL_WNDPROC, (LONG) pfnOrigProc);
43+ SetWindowLongPtr (hwnd, GWLP_WNDPROC, reinterpret_cast <LONG_PTR>( pfnOrigProc) );
4444 RemoveProp (hwnd, PROP_ORIGINAL_PROC);
4545 break ;
4646 }
@@ -56,7 +56,7 @@ LRESULT CALLBACK _HyperlinkProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
5656 {
5757 case WM_DESTROY:
5858 {
59- SetWindowLong (hwnd, GWL_WNDPROC, (LONG) pfnOrigProc);
59+ SetWindowLongPtr (hwnd, GWLP_WNDPROC, reinterpret_cast <LONG_PTR>( pfnOrigProc) );
6060 RemoveProp (hwnd, PROP_ORIGINAL_PROC);
6161
6262 HFONT hOrigFont = (HFONT) GetProp (hwnd, PROP_ORIGINAL_FONT);
@@ -102,10 +102,10 @@ LRESULT CALLBACK _HyperlinkProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
102102 {
103103 // Since IDC_HAND is not available on all operating systems,
104104 // we will load the arrow cursor if IDC_HAND is not present.
105- HCURSOR hCursor = LoadCursor (NULL , MAKEINTRESOURCE ( IDC_HAND) );
105+ HCURSOR hCursor = LoadCursor (NULL , IDC_HAND);
106106 if (NULL == hCursor)
107107 {
108- hCursor = LoadCursor (NULL , MAKEINTRESOURCE ( IDC_ARROW) );
108+ hCursor = LoadCursor (NULL , IDC_ARROW);
109109 }
110110 SetCursor (hCursor);
111111 return TRUE ;
@@ -122,24 +122,24 @@ BOOL ConvertStaticToHyperlink(HWND hwndCtl)
122122 HWND hwndParent = GetParent (hwndCtl);
123123 if (NULL != hwndParent)
124124 {
125- WNDPROC pfnOrigProc = (WNDPROC) GetWindowLong (hwndParent, GWL_WNDPROC );
125+ WNDPROC pfnOrigProc = (WNDPROC) GetWindowLongPtr (hwndParent, GWLP_WNDPROC );
126126 if (pfnOrigProc != _HyperlinkParentProc)
127127 {
128128 SetProp (hwndParent, PROP_ORIGINAL_PROC, (HANDLE) pfnOrigProc);
129- SetWindowLong (hwndParent, GWL_WNDPROC, (LONG) (WNDPROC) _HyperlinkParentProc);
129+ SetWindowLongPtr (hwndParent, GWLP_WNDPROC, reinterpret_cast <LONG_PTR>( _HyperlinkParentProc) );
130130 }
131131 }
132132
133133 // Make sure the control will send notifications.
134134
135- DWORD dwStyle = GetWindowLong (hwndCtl, GWL_STYLE);
136- SetWindowLong (hwndCtl, GWL_STYLE, dwStyle | SS_NOTIFY);
135+ LONG_PTR dwStyle = GetWindowLongPtr (hwndCtl, GWL_STYLE);
136+ SetWindowLongPtr (hwndCtl, GWL_STYLE, dwStyle | SS_NOTIFY);
137137
138138 // Subclass the existing control.
139139
140- WNDPROC pfnOrigProc = (WNDPROC) GetWindowLong (hwndCtl, GWL_WNDPROC );
140+ WNDPROC pfnOrigProc = (WNDPROC)GetWindowLongPtr (hwndCtl, GWLP_WNDPROC );
141141 SetProp (hwndCtl, PROP_ORIGINAL_PROC, (HANDLE) pfnOrigProc);
142- SetWindowLong (hwndCtl, GWL_WNDPROC, (LONG) (WNDPROC) _HyperlinkProc);
142+ SetWindowLongPtr (hwndCtl, GWLP_WNDPROC, reinterpret_cast <LONG_PTR>( _HyperlinkProc) );
143143
144144 // Create an updated font by adding an underline.
145145
0 commit comments