Upgrade code for 64-bit build in Visual Studio.

pull/421/head
Dmitry Brant 2017-04-08 16:51:31 -04:00 committed by Hleb Valoshka
parent ae31662a96
commit ac3c5b25fe
11 changed files with 99 additions and 96 deletions

View File

@ -13,7 +13,7 @@
type="win32" type="win32"
name="Microsoft.Windows.Common-Controls" name="Microsoft.Windows.Common-Controls"
version="6.0.0.0" version="6.0.0.0"
processorArchitecture="X86" processorArchitecture="*"
publicKeyToken="6595b64144ccf1df" publicKeyToken="6595b64144ccf1df"
language="*" language="*"
/> />

View File

@ -292,10 +292,11 @@ BOOL APIENTRY EclipseListViewProc(HWND hWnd,
BOOL APIENTRY EclipseFinderProc(HWND hDlg, BOOL APIENTRY EclipseFinderProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
EclipseFinderDialog* eclipseFinderDlg = reinterpret_cast<EclipseFinderDialog*>(GetWindowLong(hDlg, DWL_USER)); //EclipseFinderDialog* eclipseFinderDlg = reinterpret_cast<EclipseFinderDialog*>(GetWindowLong(hDlg, DWL_USER));
EclipseFinderDialog* eclipseFinderDlg = reinterpret_cast<EclipseFinderDialog*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message) switch (message)
{ {
@ -304,7 +305,8 @@ BOOL APIENTRY EclipseFinderProc(HWND hDlg,
EclipseFinderDialog* efd = reinterpret_cast<EclipseFinderDialog*>(lParam); EclipseFinderDialog* efd = reinterpret_cast<EclipseFinderDialog*>(lParam);
if (efd == NULL) if (efd == NULL)
return EndDialog(hDlg, 0); return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam); //SetWindowLong(hDlg, DWL_USER, lParam);
SetWindowLongPtr(hDlg, DWLP_USER, lParam);
HWND hwnd = GetDlgItem(hDlg, IDC_ECLIPSES_LIST); HWND hwnd = GetDlgItem(hDlg, IDC_ECLIPSES_LIST);
InitEclipseFinderColumns(hwnd); InitEclipseFinderColumns(hwnd);
SendDlgItemMessage(hDlg, IDC_ECLIPSES_LIST, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); SendDlgItemMessage(hDlg, IDC_ECLIPSES_LIST, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
@ -328,7 +330,8 @@ BOOL APIENTRY EclipseFinderProc(HWND hDlg,
// Subclass the ListView to intercept WM_LBUTTONUP messages // Subclass the ListView to intercept WM_LBUTTONUP messages
HWND hCtrl; HWND hCtrl;
if (hCtrl = GetDlgItem(hDlg, IDC_ECLIPSES_LIST)) if (hCtrl = GetDlgItem(hDlg, IDC_ECLIPSES_LIST))
oldListViewProc = (WNDPROC) SetWindowLong(hCtrl, GWL_WNDPROC, (DWORD) EclipseListViewProc); oldListViewProc = (WNDPROC)SetWindowLongPtr(hCtrl, GWLP_WNDPROC, (LPARAM)EclipseListViewProc);
//oldListViewProc = (WNDPROC) SetWindowLong(hCtrl, GWL_WNDPROC, (DWORD) EclipseListViewProc);
} }
return(TRUE); return(TRUE);
@ -515,6 +518,6 @@ EclipseFinderDialog::EclipseFinderDialog(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance, hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_ECLIPSEFINDER), MAKEINTRESOURCE(IDD_ECLIPSEFINDER),
parent, parent,
EclipseFinderProc, (DLGPROC)EclipseFinderProc,
reinterpret_cast<LONG>(this)); reinterpret_cast<LPARAM>(this));
} }

View File

@ -41,10 +41,10 @@ static bool SetDialogFloat(HWND hDlg, int id, char* format, float f)
static BOOL APIENTRY GotoObjectProc(HWND hDlg, static BOOL APIENTRY GotoObjectProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
GotoObjectDialog* gotoDlg = reinterpret_cast<GotoObjectDialog*>(GetWindowLong(hDlg, DWL_USER)); GotoObjectDialog* gotoDlg = reinterpret_cast<GotoObjectDialog*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message) switch (message)
{ {
@ -53,7 +53,7 @@ static BOOL APIENTRY GotoObjectProc(HWND hDlg,
GotoObjectDialog* gotoDlg = reinterpret_cast<GotoObjectDialog*>(lParam); GotoObjectDialog* gotoDlg = reinterpret_cast<GotoObjectDialog*>(lParam);
if (gotoDlg == NULL) if (gotoDlg == NULL)
return EndDialog(hDlg, 0); return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam); SetWindowLongPtr(hDlg, DWLP_USER, lParam);
CheckRadioButton(hDlg, CheckRadioButton(hDlg,
IDC_RADIO_KM, IDC_RADIO_RADII, IDC_RADIO_KM, IDC_RADIO_RADII,
IDC_RADIO_KM); IDC_RADIO_KM);
@ -172,6 +172,6 @@ GotoObjectDialog::GotoObjectDialog(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance, hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_GOTO_OBJECT), MAKEINTRESOURCE(IDD_GOTO_OBJECT),
parent, parent,
GotoObjectProc, (DLGPROC)GotoObjectProc,
reinterpret_cast<LONG>(this)); reinterpret_cast<LPARAM>(this));
} }

View File

@ -76,7 +76,7 @@ LRESULT CALLBACK _HyperlinkParentProc(HWND hWnd, UINT message, WPARAM wParam, LP
} }
case WM_DESTROY: case WM_DESTROY:
{ {
SetWindowLong(hWnd, GWL_WNDPROC, (LONG)origProc); SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)origProc);
RemoveProp(hWnd, hyperLinkOriginalProc); RemoveProp(hWnd, hyperLinkOriginalProc);
break; break;
} }
@ -131,7 +131,7 @@ LRESULT CALLBACK _HyperlinkProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
} }
case WM_DESTROY: case WM_DESTROY:
{ {
SetWindowLong(hWnd, GWL_WNDPROC, (LONG)origProc); SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)origProc);
RemoveProp(hWnd, hyperLinkOriginalProc); RemoveProp(hWnd, hyperLinkOriginalProc);
HFONT hOrigFont = (HFONT)GetProp(hWnd, hyperLinkOriginalFont); HFONT hOrigFont = (HFONT)GetProp(hWnd, hyperLinkOriginalFont);
@ -162,11 +162,11 @@ BOOL MakeHyperlinkFromStaticCtrl(HWND hDlg, UINT ctrlID)
HWND hParent = GetParent(hCtrl); HWND hParent = GetParent(hCtrl);
if (hParent) if (hParent)
{ {
WNDPROC origProc = (WNDPROC)GetWindowLong(hParent, GWL_WNDPROC); WNDPROC origProc = (WNDPROC)GetWindowLongPtr(hParent, GWLP_WNDPROC);
if (origProc != _HyperlinkParentProc) if (origProc != _HyperlinkParentProc)
{ {
SetProp(hParent, hyperLinkOriginalProc, (HANDLE)origProc); SetProp(hParent, hyperLinkOriginalProc, (HANDLE)origProc);
SetWindowLong(hParent, GWL_WNDPROC, (LONG)(WNDPROC)_HyperlinkParentProc); SetWindowLong(hParent, GWLP_WNDPROC, (LONG_PTR)(WNDPROC)_HyperlinkParentProc);
} }
} }
@ -175,9 +175,9 @@ BOOL MakeHyperlinkFromStaticCtrl(HWND hDlg, UINT ctrlID)
SetWindowLong(hCtrl, GWL_STYLE, dwStyle | SS_NOTIFY); SetWindowLong(hCtrl, GWL_STYLE, dwStyle | SS_NOTIFY);
// Subclass the existing control. // Subclass the existing control.
WNDPROC origProc = (WNDPROC)GetWindowLong(hCtrl, GWL_WNDPROC); WNDPROC origProc = (WNDPROC)GetWindowLongPtr(hCtrl, GWLP_WNDPROC);
SetProp(hCtrl, hyperLinkOriginalProc, (HANDLE)origProc); SetProp(hCtrl, hyperLinkOriginalProc, (HANDLE)origProc);
SetWindowLong(hCtrl, GWL_WNDPROC, (LONG)(WNDPROC)_HyperlinkProc); SetWindowLong(hCtrl, GWLP_WNDPROC, (LONG_PTR)(WNDPROC)_HyperlinkProc);
// Create an updated font by adding an underline. // Create an updated font by adding an underline.
HFONT hOrigFont = (HFONT) SendMessage(hCtrl, WM_GETFONT, 0, 0); HFONT hOrigFont = (HFONT) SendMessage(hCtrl, WM_GETFONT, 0, 0);

View File

@ -31,10 +31,10 @@ static const uint32 FilterOther = ~(Location::City |
static BOOL APIENTRY LocationsProc(HWND hDlg, static BOOL APIENTRY LocationsProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
LocationsDialog* dlg = reinterpret_cast<LocationsDialog*>(GetWindowLong(hDlg, DWL_USER)); LocationsDialog* dlg = reinterpret_cast<LocationsDialog*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message) switch (message)
{ {
@ -43,7 +43,7 @@ static BOOL APIENTRY LocationsProc(HWND hDlg,
dlg = reinterpret_cast<LocationsDialog*>(lParam); dlg = reinterpret_cast<LocationsDialog*>(lParam);
if (dlg == NULL) if (dlg == NULL)
return EndDialog(hDlg, 0); return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam); SetWindowLongPtr(hDlg, DWLP_USER, lParam);
// Store original settings in case user cancels the dialog // Store original settings in case user cancels the dialog
// dlg->initialLocationFlags = dlg->appCore->getSimulation()->getActiveObserver(); // dlg->initialLocationFlags = dlg->appCore->getSimulation()->getActiveObserver();
@ -167,8 +167,8 @@ LocationsDialog::LocationsDialog(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance, hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_LOCATIONS), MAKEINTRESOURCE(IDD_LOCATIONS),
parent, parent,
LocationsProc, (DLGPROC)LocationsProc,
reinterpret_cast<LONG>(this)); reinterpret_cast<LPARAM>(this));
} }

View File

@ -526,8 +526,8 @@ bool LoadItemTextFromFile(HWND hWnd,
BOOL APIENTRY AboutProc(HWND hDlg, BOOL APIENTRY AboutProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -563,8 +563,8 @@ BOOL APIENTRY AboutProc(HWND hDlg,
BOOL APIENTRY ControlsHelpProc(HWND hDlg, BOOL APIENTRY ControlsHelpProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -587,8 +587,8 @@ BOOL APIENTRY ControlsHelpProc(HWND hDlg,
BOOL APIENTRY LicenseProc(HWND hDlg, BOOL APIENTRY LicenseProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -611,8 +611,8 @@ BOOL APIENTRY LicenseProc(HWND hDlg,
BOOL APIENTRY GLInfoProc(HWND hDlg, BOOL APIENTRY GLInfoProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -779,8 +779,8 @@ UINT CALLBACK ChooseMovieParamsProc(HWND hDlg, UINT message,
BOOL APIENTRY FindObjectProc(HWND hDlg, BOOL APIENTRY FindObjectProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -818,8 +818,8 @@ BOOL APIENTRY FindObjectProc(HWND hDlg,
BOOL APIENTRY AddBookmarkFolderProc(HWND hDlg, BOOL APIENTRY AddBookmarkFolderProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -909,8 +909,8 @@ BOOL APIENTRY AddBookmarkFolderProc(HWND hDlg,
BOOL APIENTRY AddBookmarkProc(HWND hDlg, BOOL APIENTRY AddBookmarkProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -1077,7 +1077,7 @@ BOOL APIENTRY AddBookmarkProc(HWND hDlg,
if(hBookmarkTree = GetDlgItem(hDlg, IDC_BOOKMARK_FOLDERTREE)) if(hBookmarkTree = GetDlgItem(hDlg, IDC_BOOKMARK_FOLDERTREE))
{ {
DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK_FOLDER), DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK_FOLDER),
hDlg, AddBookmarkFolderProc); hDlg, (DLGPROC)AddBookmarkFolderProc);
} }
} }
break; break;
@ -1089,8 +1089,8 @@ BOOL APIENTRY AddBookmarkProc(HWND hDlg,
BOOL APIENTRY RenameBookmarkProc(HWND hDlg, BOOL APIENTRY RenameBookmarkProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -1173,8 +1173,8 @@ BOOL APIENTRY RenameBookmarkProc(HWND hDlg,
BOOL APIENTRY OrganizeBookmarksProc(HWND hDlg, BOOL APIENTRY OrganizeBookmarksProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
static UINT_PTR dragDropTimer; static UINT_PTR dragDropTimer;
switch (message) switch (message)
@ -1230,7 +1230,7 @@ BOOL APIENTRY OrganizeBookmarksProc(HWND hDlg,
{ {
if (hBookmarkTree = GetDlgItem(hDlg, IDC_ORGANIZE_BOOKMARK_TREE)) if (hBookmarkTree = GetDlgItem(hDlg, IDC_ORGANIZE_BOOKMARK_TREE))
{ {
DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK_FOLDER), hDlg, AddBookmarkFolderProc); DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK_FOLDER), hDlg, (DLGPROC)AddBookmarkFolderProc);
} }
} }
else if (LOWORD(wParam) == IDC_ORGANIZE_BOOKMARKS_RENAME) else if (LOWORD(wParam) == IDC_ORGANIZE_BOOKMARKS_RENAME)
@ -1249,7 +1249,7 @@ BOOL APIENTRY OrganizeBookmarksProc(HWND hDlg,
{ {
DialogBox(hRes, DialogBox(hRes,
MAKEINTRESOURCE(IDD_RENAME_BOOKMARK), MAKEINTRESOURCE(IDD_RENAME_BOOKMARK),
hDlg, RenameBookmarkProc); hDlg, (DLGPROC)RenameBookmarkProc);
} }
} }
} }
@ -1371,8 +1371,8 @@ BOOL APIENTRY OrganizeBookmarksProc(HWND hDlg,
int selectedScreenMode = 0; int selectedScreenMode = 0;
BOOL APIENTRY SelectDisplayModeProc(HWND hDlg, BOOL APIENTRY SelectDisplayModeProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -1559,7 +1559,7 @@ static HMENU CreatePlanetarySystemMenu(string parentName, const PlanetarySystem*
for(it=obj->begin(); it != obj->end(); it++) for(it=obj->begin(); it != obj->end(); it++)
AppendMenu(hSubMenu, MF_STRING, MENU_CHOOSE_PLANET + it->first, it->second.c_str()); AppendMenu(hSubMenu, MF_STRING, MENU_CHOOSE_PLANET + it->first, it->second.c_str());
AppendMenu(menu, MF_POPUP | MF_STRING, (DWORD)hSubMenu, menuName->c_str()); AppendMenu(menu, MF_POPUP | MF_STRING, (UINT_PTR)hSubMenu, menuName->c_str());
} }
else else
{ {
@ -1611,7 +1611,7 @@ VOID APIENTRY handlePopupMenu(HWND hwnd,
AppendMenu(hMenu, MF_STRING, ID_NAVIGATION_SYNCORBIT, UTF8ToCurrentCP(_("S&ync Orbit")).c_str()); AppendMenu(hMenu, MF_STRING, ID_NAVIGATION_SYNCORBIT, UTF8ToCurrentCP(_("S&ync Orbit")).c_str());
AppendMenu(hMenu, MF_STRING, ID_INFO, UTF8ToCurrentCP(_("&Info")).c_str()); AppendMenu(hMenu, MF_STRING, ID_INFO, UTF8ToCurrentCP(_("&Info")).c_str());
HMENU refVectorMenu = CreatePopupMenu(); HMENU refVectorMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) refVectorMenu, UTF8ToCurrentCP(_("&Reference Marks")).c_str()); AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR) refVectorMenu, UTF8ToCurrentCP(_("&Reference Marks")).c_str());
AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_BODY_AXES, UTF8ToCurrentCP(_("Show Body Axes")).c_str()); AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_BODY_AXES, UTF8ToCurrentCP(_("Show Body Axes")).c_str());
AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_FRAME_AXES, UTF8ToCurrentCP(_("Show Frame Axes")).c_str()); AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_FRAME_AXES, UTF8ToCurrentCP(_("Show Frame Axes")).c_str());
AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_SUN_DIRECTION, UTF8ToCurrentCP(_("Show Sun Direction")).c_str()); AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_SUN_DIRECTION, UTF8ToCurrentCP(_("Show Sun Direction")).c_str());
@ -1630,7 +1630,7 @@ VOID APIENTRY handlePopupMenu(HWND hwnd,
if (satellites != NULL && satellites->getSystemSize() != 0) if (satellites != NULL && satellites->getSystemSize() != 0)
{ {
HMENU satMenu = CreatePlanetarySystemMenu(name, satellites); HMENU satMenu = CreatePlanetarySystemMenu(name, satellites);
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) satMenu, AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR) satMenu,
UTF8ToCurrentCP(_("&Satellites")).c_str()); UTF8ToCurrentCP(_("&Satellites")).c_str());
} }
@ -1640,7 +1640,7 @@ VOID APIENTRY handlePopupMenu(HWND hwnd,
if (altSurfaces->size() != NULL) if (altSurfaces->size() != NULL)
{ {
HMENU surfMenu = CreateAlternateSurfaceMenu(*altSurfaces); HMENU surfMenu = CreateAlternateSurfaceMenu(*altSurfaces);
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) surfMenu, AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR) surfMenu,
UTF8ToCurrentCP(_("&Alternate Surfaces")).c_str()); UTF8ToCurrentCP(_("&Alternate Surfaces")).c_str());
} }
delete altSurfaces; delete altSurfaces;
@ -1664,9 +1664,9 @@ VOID APIENTRY handlePopupMenu(HWND hwnd,
SolarSystem* solarSys = iter->second; SolarSystem* solarSys = iter->second;
HMENU planetsMenu = CreatePlanetarySystemMenu(name, solarSys->getPlanets()); HMENU planetsMenu = CreatePlanetarySystemMenu(name, solarSys->getPlanets());
if (name == "Sol") if (name == "Sol")
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) planetsMenu, UTF8ToCurrentCP(_("Orbiting Bodies")).c_str()); AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR) planetsMenu, UTF8ToCurrentCP(_("Orbiting Bodies")).c_str());
else else
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) planetsMenu, UTF8ToCurrentCP(_("Planets")).c_str()); AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR) planetsMenu, UTF8ToCurrentCP(_("Planets")).c_str());
} }
} }
break; break;
@ -2739,7 +2739,7 @@ static void HandleCaptureMovie(HWND hWnd)
Ofn.hInstance = appInstance; Ofn.hInstance = appInstance;
Ofn.lpTemplateName = MAKEINTRESOURCE(IDD_MOVIE_PARAMS_CHOOSER); Ofn.lpTemplateName = MAKEINTRESOURCE(IDD_MOVIE_PARAMS_CHOOSER);
Ofn.lpfnHook = ChooseMovieParamsProc; Ofn.lpfnHook = (LPOFNHOOKPROC)ChooseMovieParamsProc;
// Display the Save dialog box. // Display the Save dialog box.
if (GetSaveFileName(&Ofn)) if (GetSaveFileName(&Ofn))
@ -3983,7 +3983,7 @@ LRESULT CALLBACK MainWindowProc(HWND hWnd,
appCore->charEntered('H'); appCore->charEntered('H');
break; break;
case ID_NAVIGATION_SELECT: case ID_NAVIGATION_SELECT:
DialogBox(hRes, MAKEINTRESOURCE(IDD_FINDOBJECT), hWnd, FindObjectProc); DialogBox(hRes, MAKEINTRESOURCE(IDD_FINDOBJECT), hWnd, (DLGPROC)FindObjectProc);
break; break;
case ID_NAVIGATION_GOTO_OBJECT: case ID_NAVIGATION_GOTO_OBJECT:
if (gotoObjectDlg == NULL) if (gotoObjectDlg == NULL)
@ -4059,7 +4059,7 @@ LRESULT CALLBACK MainWindowProc(HWND hWnd,
CreateDialogParam(hRes, CreateDialogParam(hRes,
MAKEINTRESOURCE(IDD_DISPLAYMODE), MAKEINTRESOURCE(IDD_DISPLAYMODE),
hWnd, hWnd,
SelectDisplayModeProc, (DLGPROC)SelectDisplayModeProc,
NULL); NULL);
break; break;
@ -4234,11 +4234,11 @@ LRESULT CALLBACK MainWindowProc(HWND hWnd,
break; break;
case ID_BOOKMARKS_ADDBOOKMARK: case ID_BOOKMARKS_ADDBOOKMARK:
DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK), hWnd, AddBookmarkProc); DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK), hWnd, (DLGPROC)AddBookmarkProc);
break; break;
case ID_BOOKMARKS_ORGANIZE: case ID_BOOKMARKS_ORGANIZE:
DialogBox(hRes, MAKEINTRESOURCE(IDD_ORGANIZE_BOOKMARKS), hWnd, OrganizeBookmarksProc); DialogBox(hRes, MAKEINTRESOURCE(IDD_ORGANIZE_BOOKMARKS), hWnd, (DLGPROC)OrganizeBookmarksProc);
break; break;
case ID_HELP_RUNDEMO: case ID_HELP_RUNDEMO:
@ -4254,20 +4254,20 @@ LRESULT CALLBACK MainWindowProc(HWND hWnd,
CreateDialogParam(hRes, CreateDialogParam(hRes,
MAKEINTRESOURCE(IDD_CONTROLSHELP), MAKEINTRESOURCE(IDD_CONTROLSHELP),
hWnd, hWnd,
ControlsHelpProc, (DLGPROC)ControlsHelpProc,
NULL); NULL);
break; break;
case ID_HELP_ABOUT: case ID_HELP_ABOUT:
DialogBox(hRes, MAKEINTRESOURCE(IDD_ABOUT), hWnd, AboutProc); DialogBox(hRes, MAKEINTRESOURCE(IDD_ABOUT), hWnd, (DLGPROC)AboutProc);
break; break;
case ID_HELP_GLINFO: case ID_HELP_GLINFO:
DialogBox(hRes, MAKEINTRESOURCE(IDD_GLINFO), hWnd, GLInfoProc); DialogBox(hRes, MAKEINTRESOURCE(IDD_GLINFO), hWnd, (DLGPROC)GLInfoProc);
break; break;
case ID_HELP_LICENSE: case ID_HELP_LICENSE:
DialogBox(hRes, MAKEINTRESOURCE(IDD_LICENSE), hWnd, LicenseProc); DialogBox(hRes, MAKEINTRESOURCE(IDD_LICENSE), hWnd, (DLGPROC)LicenseProc);
break; break;
case ID_INFO: case ID_INFO:

View File

@ -93,10 +93,10 @@ void AddPlanetarySystemToTree(const PlanetarySystem* sys, HWND treeView, int lev
BOOL APIENTRY SolarSystemBrowserProc(HWND hDlg, BOOL APIENTRY SolarSystemBrowserProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
SolarSystemBrowser* browser = reinterpret_cast<SolarSystemBrowser*>(GetWindowLong(hDlg, DWL_USER)); SolarSystemBrowser* browser = reinterpret_cast<SolarSystemBrowser*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message) switch (message)
{ {
@ -105,7 +105,7 @@ BOOL APIENTRY SolarSystemBrowserProc(HWND hDlg,
SolarSystemBrowser* browser = reinterpret_cast<SolarSystemBrowser*>(lParam); SolarSystemBrowser* browser = reinterpret_cast<SolarSystemBrowser*>(lParam);
if (browser == NULL) if (browser == NULL)
return EndDialog(hDlg, 0); return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam); SetWindowLongPtr(hDlg, DWLP_USER, lParam);
HWND hwnd = GetDlgItem(hDlg, IDC_SSBROWSER_TREE); HWND hwnd = GetDlgItem(hDlg, IDC_SSBROWSER_TREE);
const SolarSystem* solarSys = browser->appCore->getSimulation()->getNearestSolarSystem(); const SolarSystem* solarSys = browser->appCore->getSimulation()->getNearestSolarSystem();
@ -190,12 +190,12 @@ SolarSystemBrowser::SolarSystemBrowser(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance, hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_SSBROWSER), MAKEINTRESOURCE(IDD_SSBROWSER),
parent, parent,
SolarSystemBrowserProc, (DLGPROC)SolarSystemBrowserProc,
reinterpret_cast<LONG>(this)); reinterpret_cast<LONG_PTR>(this));
} }
SolarSystemBrowser::~SolarSystemBrowser() SolarSystemBrowser::~SolarSystemBrowser()
{ {
SetWindowLong(hwnd, DWL_USER, 0); SetWindowLongPtr(hwnd, DWLP_USER, 0);
} }

View File

@ -257,7 +257,7 @@ bool InitStarBrowserItems(HWND listView, StarBrowser* browser)
solarSysPred.pos = browser->pos; solarSysPred.pos = browser->pos;
solarSysPred.solarSystems = solarSystems; solarSysPred.solarSystems = solarSystems;
stars = FindStars(*stardb, solarSysPred, stars = FindStars(*stardb, solarSysPred,
min((unsigned int) browser->nStars, solarSystems->size())); min((unsigned int) browser->nStars, (unsigned int) solarSystems->size()));
} }
break; break;
@ -398,10 +398,10 @@ void RefreshItems(HWND hDlg, StarBrowser* browser)
BOOL APIENTRY StarBrowserProc(HWND hDlg, BOOL APIENTRY StarBrowserProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
StarBrowser* browser = reinterpret_cast<StarBrowser*>(GetWindowLong(hDlg, DWL_USER)); StarBrowser* browser = reinterpret_cast<StarBrowser*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message) switch (message)
{ {
@ -410,7 +410,7 @@ BOOL APIENTRY StarBrowserProc(HWND hDlg,
StarBrowser* browser = reinterpret_cast<StarBrowser*>(lParam); StarBrowser* browser = reinterpret_cast<StarBrowser*>(lParam);
if (browser == NULL) if (browser == NULL)
return EndDialog(hDlg, 0); return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam); SetWindowLongPtr(hDlg, DWLP_USER, lParam);
HWND hwnd = GetDlgItem(hDlg, IDC_STARBROWSER_LIST); HWND hwnd = GetDlgItem(hDlg, IDC_STARBROWSER_LIST);
InitStarBrowserColumns(hwnd); InitStarBrowserColumns(hwnd);
@ -613,12 +613,12 @@ StarBrowser::StarBrowser(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance, hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_STARBROWSER), MAKEINTRESOURCE(IDD_STARBROWSER),
parent, parent,
StarBrowserProc, (DLGPROC)StarBrowserProc,
reinterpret_cast<LONG>(this)); reinterpret_cast<LONG_PTR>(this));
} }
StarBrowser::~StarBrowser() StarBrowser::~StarBrowser()
{ {
SetWindowLong(hwnd, DWL_USER, 0); SetWindowLongPtr(hwnd, DWLP_USER, 0);
} }

View File

@ -84,7 +84,7 @@ SetTimeDialog::init(HWND _hDlg)
{ {
hDlg = _hDlg; hDlg = _hDlg;
SetWindowLong(hDlg, DWL_USER, reinterpret_cast<LPARAM>(this)); SetWindowLongPtr(hDlg, DWLP_USER, reinterpret_cast<LPARAM>(this));
getLocalTimeZoneInfo(); getLocalTimeZoneInfo();
tdb = appCore->getSimulation()->getTime(); tdb = appCore->getSimulation()->getTime();
@ -292,10 +292,10 @@ SetTimeDialog::notify(int id, const NMHDR& hdr)
static BOOL APIENTRY static BOOL APIENTRY
SetTimeProc(HWND hDlg, SetTimeProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
SetTimeDialog* timeDialog = reinterpret_cast<SetTimeDialog*>(GetWindowLong(hDlg, DWL_USER)); SetTimeDialog* timeDialog = reinterpret_cast<SetTimeDialog*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message) switch (message)
{ {
@ -327,7 +327,7 @@ ShowSetTimeDialog(HINSTANCE appInstance,
{ {
SetTimeDialog* timeDialog = new SetTimeDialog(appCore); SetTimeDialog* timeDialog = new SetTimeDialog(appCore);
DialogBoxParam(appInstance, MAKEINTRESOURCE(IDD_SETTIME), appWindow, SetTimeProc, reinterpret_cast<LPARAM>(timeDialog)); DialogBoxParam(appInstance, MAKEINTRESOURCE(IDD_SETTIME), appWindow, (DLGPROC)SetTimeProc, reinterpret_cast<LPARAM>(timeDialog));
delete timeDialog; delete timeDialog;
} }

View File

@ -26,10 +26,10 @@ using namespace std;
BOOL APIENTRY TourGuideProc(HWND hDlg, BOOL APIENTRY TourGuideProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
TourGuide* tourGuide = reinterpret_cast<TourGuide*>(GetWindowLong(hDlg, DWL_USER)); TourGuide* tourGuide = reinterpret_cast<TourGuide*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message) switch (message)
{ {
@ -38,7 +38,7 @@ BOOL APIENTRY TourGuideProc(HWND hDlg,
TourGuide* guide = reinterpret_cast<TourGuide*>(lParam); TourGuide* guide = reinterpret_cast<TourGuide*>(lParam);
if (guide == NULL) if (guide == NULL)
return EndDialog(hDlg, 0); return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam); SetWindowLongPtr(hDlg, DWLP_USER, lParam);
guide->selectedDest = NULL; guide->selectedDest = NULL;
@ -148,6 +148,6 @@ TourGuide::TourGuide(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance, hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_TOURGUIDE), MAKEINTRESOURCE(IDD_TOURGUIDE),
parent, parent,
TourGuideProc, (DLGPROC)TourGuideProc,
reinterpret_cast<LONG>(this)); reinterpret_cast<LONG_PTR>(this));
} }

View File

@ -24,10 +24,10 @@ static const float MaxDistanceLimit = 1.0e6f;
static BOOL APIENTRY ViewOptionsProc(HWND hDlg, static BOOL APIENTRY ViewOptionsProc(HWND hDlg,
UINT message, UINT message,
UINT wParam, WPARAM wParam,
LONG lParam) LPARAM lParam)
{ {
ViewOptionsDialog* Dlg = reinterpret_cast<ViewOptionsDialog*>(GetWindowLong(hDlg, DWL_USER)); ViewOptionsDialog* Dlg = reinterpret_cast<ViewOptionsDialog*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message) switch (message)
{ {
@ -36,7 +36,7 @@ static BOOL APIENTRY ViewOptionsProc(HWND hDlg,
ViewOptionsDialog* Dlg = reinterpret_cast<ViewOptionsDialog*>(lParam); ViewOptionsDialog* Dlg = reinterpret_cast<ViewOptionsDialog*>(lParam);
if (Dlg == NULL) if (Dlg == NULL)
return EndDialog(hDlg, 0); return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam); SetWindowLongPtr(hDlg, DWLP_USER, lParam);
//Read labelMode, renderFlags and hud detail //Read labelMode, renderFlags and hud detail
Dlg->initialRenderFlags = Dlg->appCore->getRenderer()->getRenderFlags(); Dlg->initialRenderFlags = Dlg->appCore->getRenderer()->getRenderFlags();
@ -280,8 +280,8 @@ ViewOptionsDialog::ViewOptionsDialog(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance, hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_VIEWOPTIONS), MAKEINTRESOURCE(IDD_VIEWOPTIONS),
parent, parent,
ViewOptionsProc, (DLGPROC)ViewOptionsProc,
reinterpret_cast<LONG>(this)); reinterpret_cast<LONG_PTR>(this));
} }