From c33ab17da4aa6e3aab481cf3fc26dc00ee2f55e0 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Fri, 21 Jun 2019 14:03:05 -0400 Subject: [PATCH 1/6] DLGPROC return type is INT_PTR, not BOOL and not LRESULT. These are compatible return types in 32-bit but not 64-bit. --- src/drivers/win/Win32InputBox.cpp | 4 ++-- src/drivers/win/Win32InputBox.h | 2 +- src/drivers/win/archive.cpp | 2 +- src/drivers/win/cdlogger.cpp | 2 +- src/drivers/win/debugger.cpp | 8 ++++---- src/drivers/win/debuggersp.cpp | 4 ++-- src/drivers/win/directories.cpp | 2 +- src/drivers/win/guiconfig.cpp | 2 +- src/drivers/win/input.cpp | 6 +++--- src/drivers/win/log.cpp | 2 +- src/drivers/win/mapinput.cpp | 4 ++-- src/drivers/win/memview.cpp | 4 ++-- src/drivers/win/memviewsp.cpp | 2 +- src/drivers/win/memwatch.cpp | 2 +- src/drivers/win/monitor.cpp | 2 +- src/drivers/win/movieoptions.cpp | 2 +- src/drivers/win/netplay.cpp | 2 +- src/drivers/win/ntview.cpp | 2 +- src/drivers/win/palette.cpp | 2 +- src/drivers/win/ppuview.cpp | 2 +- src/drivers/win/ram_search.cpp | 8 ++++---- src/drivers/win/ram_search.h | 2 +- src/drivers/win/ramwatch.cpp | 16 ++++++++-------- src/drivers/win/ramwatch.h | 4 ++-- src/drivers/win/replay.cpp | 6 +++--- src/drivers/win/sound.cpp | 2 +- src/drivers/win/taseditor.cpp | 10 +++++----- src/drivers/win/taseditor/markers_manager.cpp | 2 +- src/drivers/win/taseditor/taseditor_window.cpp | 10 +++++----- src/drivers/win/texthook.cpp | 2 +- src/drivers/win/timing.cpp | 2 +- src/drivers/win/tracer.cpp | 2 +- src/drivers/win/video.cpp | 2 +- src/drivers/win/window.cpp | 8 ++++---- src/lua-engine.cpp | 2 +- 35 files changed, 68 insertions(+), 68 deletions(-) diff --git a/src/drivers/win/Win32InputBox.cpp b/src/drivers/win/Win32InputBox.cpp index a7122dcb..4c9956d4 100644 --- a/src/drivers/win/Win32InputBox.cpp +++ b/src/drivers/win/Win32InputBox.cpp @@ -198,7 +198,7 @@ INT_PTR CWin32InputBox::InputBoxEx(WIN32INPUTBOX_PARAM *param) CWin32InputBox inputbox(param); // Resize dialog and SHOW or HIDE multiline - INT_PTR r = ::DialogBoxIndirectParam(param->hInstance, dlgTemplate, param->hwndOwner, (DLGPROC)DlgProc, (LPARAM)&inputbox); + INT_PTR r = ::DialogBoxIndirectParam(param->hInstance, dlgTemplate, param->hwndOwner, DlgProc, (LPARAM)&inputbox); return r; } @@ -310,7 +310,7 @@ void CWin32InputBox::InitDialog() } // Message handler for about box. -LRESULT CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { CWin32InputBox *_this = (CWin32InputBox *) ::GetWindowLong(hDlg, GWL_USERDATA); WIN32INPUTBOX_PARAM *param = _this ? _this->GetParam() : 0; diff --git a/src/drivers/win/Win32InputBox.h b/src/drivers/win/Win32InputBox.h index ff1acbe0..e7c87fbf 100644 --- a/src/drivers/win/Win32InputBox.h +++ b/src/drivers/win/Win32InputBox.h @@ -73,7 +73,7 @@ class CWin32InputBox { private: WIN32INPUTBOX_PARAM *_param; - static LRESULT CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM); + static INT_PTR CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM); HWND _hwndEditCtrl; void InitDialog(); diff --git a/src/drivers/win/archive.cpp b/src/drivers/win/archive.cpp index 845acfbc..75bdfff7 100644 --- a/src/drivers/win/archive.cpp +++ b/src/drivers/win/archive.cpp @@ -275,7 +275,7 @@ public: } }; -static BOOL CALLBACK ArchiveFileSelectorCallback(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK ArchiveFileSelectorCallback(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/cdlogger.cpp b/src/drivers/win/cdlogger.cpp index fb3d174c..3d88ced9 100644 --- a/src/drivers/win/cdlogger.cpp +++ b/src/drivers/win/cdlogger.cpp @@ -60,7 +60,7 @@ bool autoloadCDL = true; bool autoresumeCDLogging = false; char loadedcdfile[2048] = {0}; -BOOL CALLBACK CDLoggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK CDLoggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/debugger.cpp b/src/drivers/win/debugger.cpp index 1e9c5846..2aed3b66 100644 --- a/src/drivers/win/debugger.cpp +++ b/src/drivers/win/debugger.cpp @@ -267,7 +267,7 @@ static void UpdateDialog(HWND hwndDlg) { //CheckDlgButton(hwndDlg,IDC_ADDBP_MEM_SPR,BST_UNCHECKED); } -BOOL CALLBACK AddbpCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK AddbpCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { char str[8] = {0}; int tmp; @@ -1224,7 +1224,7 @@ int AddAsmHistory(HWND hwndDlg, int id, char *str) { return 1; } -BOOL CALLBACK AssemblerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { +INT_PTR CALLBACK AssemblerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { int romaddr,count,i,j; char str[128],*dasm; static int patchlen,applied,saved,lastundo; @@ -1358,7 +1358,7 @@ BOOL CALLBACK AssemblerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar return FALSE; } -BOOL CALLBACK PatcherCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { +INT_PTR CALLBACK PatcherCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { char str[64]; //mbg merge 7/18/06 changed from unsigned char uint8 *c; int i; @@ -1756,7 +1756,7 @@ BOOL CALLBACK IDC_DEBUGGER_DISASSEMBLY_WndProc(HWND hwndDlg, UINT uMsg, WPARAM w return CallWindowProc(IDC_DEBUGGER_DISASSEMBLY_oldWndProc, hwndDlg, uMsg, wParam, lParam); } -BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { RECT wrect; char str[256] = {0}; diff --git a/src/drivers/win/debuggersp.cpp b/src/drivers/win/debuggersp.cpp index e2180ef9..018c084f 100644 --- a/src/drivers/win/debuggersp.cpp +++ b/src/drivers/win/debuggersp.cpp @@ -62,7 +62,7 @@ int debuggerWasActive = 0; char temp_chr[40] = {0}; char delimiterChar[2] = "#"; -extern BOOL CALLBACK nameBookmarkCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK nameBookmarkCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); extern char bookmarkDescription[]; MemoryMappedRegister RegNames[] = { @@ -919,7 +919,7 @@ void GoToDebuggerBookmark(HWND hwnd) Disassemble(hwnd, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, n); } -BOOL CALLBACK SymbolicNamingCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK SymbolicNamingCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/directories.cpp b/src/drivers/win/directories.cpp index accda7d5..09fdc8db 100644 --- a/src/drivers/win/directories.cpp +++ b/src/drivers/win/directories.cpp @@ -89,7 +89,7 @@ void CloseDirectoriesDialog(HWND hwndDlg) } ///Callback function for the directories configuration dialog. -static BOOL CALLBACK DirConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK DirConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/guiconfig.cpp b/src/drivers/win/guiconfig.cpp index 9c31aeb5..93c19ee0 100644 --- a/src/drivers/win/guiconfig.cpp +++ b/src/drivers/win/guiconfig.cpp @@ -107,7 +107,7 @@ void CloseGuiDialog(HWND hwndDlg) /** * Message loop of the GUI configuration dialog. **/ -BOOL CALLBACK GUIConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK GUIConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/input.cpp b/src/drivers/win/input.cpp index 50668570..4b1165a7 100644 --- a/src/drivers/win/input.cpp +++ b/src/drivers/win/input.cpp @@ -842,7 +842,7 @@ static const uint8 *DWBText; static HWND die; -static BOOL CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { @@ -1060,7 +1060,7 @@ static const char *DoTBTitle=0; static int DoTBMax=0; static int DoTBType=0,DoTBPort=0; -static BOOL CALLBACK DoTBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK DoTBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_INITDIALOG: @@ -1208,7 +1208,7 @@ static void UpdateFourscoreState(HWND dlg) } //Callback function of the input configuration dialog. -BOOL CALLBACK InputConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK InputConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/log.cpp b/src/drivers/win/log.cpp index 4232180b..70ad7115 100644 --- a/src/drivers/win/log.cpp +++ b/src/drivers/win/log.cpp @@ -73,7 +73,7 @@ void RedoText(void) /** * Callback function for the log window. **/ -BOOL CALLBACK LogCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK LogCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { RECT wrect; //For remembering window position switch(uMsg) diff --git a/src/drivers/win/mapinput.cpp b/src/drivers/win/mapinput.cpp index 131740bb..aca19ad1 100644 --- a/src/drivers/win/mapinput.cpp +++ b/src/drivers/win/mapinput.cpp @@ -332,7 +332,7 @@ char* GetKeyComboName(int c) } //Callback function for the dialog where the user can change hotkeys. -BOOL CALLBACK ChangeInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK ChangeInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static HANDLE hThread = NULL; static DWORD dwThreadId = 0; @@ -702,7 +702,7 @@ void ApplyDefaultCommandMapping() /** * Callback function of the Map Input dialog **/ -BOOL CALLBACK MapInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK MapInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/memview.cpp b/src/drivers/win/memview.cpp index fedd28b1..96ccbfdd 100644 --- a/src/drivers/win/memview.cpp +++ b/src/drivers/win/memview.cpp @@ -142,7 +142,7 @@ int GetHexScreenCoordy(int offset); int GetAddyFromCoord(int x,int y); void AutoScrollFromCoord(int x,int y); LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK MemFindCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK MemFindCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); void FindNext(); void OpenFindDialog(); static int GetFileData(uint32 offset); @@ -2218,7 +2218,7 @@ void DoMemView() } } -BOOL CALLBACK MemFindCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { +INT_PTR CALLBACK MemFindCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_INITDIALOG: diff --git a/src/drivers/win/memviewsp.cpp b/src/drivers/win/memviewsp.cpp index 1f155455..d65e2ace 100644 --- a/src/drivers/win/memviewsp.cpp +++ b/src/drivers/win/memviewsp.cpp @@ -57,7 +57,7 @@ char bookmarkDescription[51] = {0}; BOOL CenterWindow(HWND hwndDlg); /// Callback function for the name bookmark dialog -BOOL CALLBACK nameBookmarkCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK nameBookmarkCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { diff --git a/src/drivers/win/memwatch.cpp b/src/drivers/win/memwatch.cpp index 9f3af8a2..e1ab530f 100644 --- a/src/drivers/win/memwatch.cpp +++ b/src/drivers/win/memwatch.cpp @@ -697,7 +697,7 @@ void ClearAllText() fileChanged = false; } -static BOOL CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { const int FMAX = 6; string formula[FMAX] = {"> than", "> by 1", "< than", "< by 1", "equal", "!equal"}; diff --git a/src/drivers/win/monitor.cpp b/src/drivers/win/monitor.cpp index da402c1e..d70c13a4 100644 --- a/src/drivers/win/monitor.cpp +++ b/src/drivers/win/monitor.cpp @@ -219,7 +219,7 @@ unsigned int ruleBox_to_ruleInput(unsigned int ruleBox) return ruleBox - RULE_BOX_1 + RULE_INPUT_1; } -BOOL CALLBACK MonitorCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK MonitorCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_MOVE: { diff --git a/src/drivers/win/movieoptions.cpp b/src/drivers/win/movieoptions.cpp index fc4bcb80..8316cb74 100644 --- a/src/drivers/win/movieoptions.cpp +++ b/src/drivers/win/movieoptions.cpp @@ -53,7 +53,7 @@ void CloseMovieOptionsDialog(HWND hwndDlg) /** * Callback function of the Timing configuration dialog. **/ -BOOL CALLBACK MovieOptionsCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK MovieOptionsCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/netplay.cpp b/src/drivers/win/netplay.cpp index 9afbdb8d..3c4b4009 100644 --- a/src/drivers/win/netplay.cpp +++ b/src/drivers/win/netplay.cpp @@ -393,7 +393,7 @@ CFGSTRUCT NetplayConfig[]={ }; -static BOOL CALLBACK NetCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK NetCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/ntview.cpp b/src/drivers/win/ntview.cpp index 9a820c3d..87f5c9ac 100644 --- a/src/drivers/win/ntview.cpp +++ b/src/drivers/win/ntview.cpp @@ -435,7 +435,7 @@ void KillNTView() { NTViewSkip=0; } -BOOL CALLBACK NTViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { +INT_PTR CALLBACK NTViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { RECT wrect; char str[50]; int TileID, TileX, TileY, NameTable, PPUAddress, AttAddress, Attrib; diff --git a/src/drivers/win/palette.cpp b/src/drivers/win/palette.cpp index bed79087..bf3c3a01 100644 --- a/src/drivers/win/palette.cpp +++ b/src/drivers/win/palette.cpp @@ -68,7 +68,7 @@ int LoadPaletteFile() /** * Callback function for the palette configuration dialog. **/ -BOOL CALLBACK PaletteConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PaletteConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { char text[40]; switch(uMsg) diff --git a/src/drivers/win/ppuview.cpp b/src/drivers/win/ppuview.cpp index 4f9f7673..140c94fe 100644 --- a/src/drivers/win/ppuview.cpp +++ b/src/drivers/win/ppuview.cpp @@ -364,7 +364,7 @@ void KillPPUView() PPUViewSkip=0; } -BOOL CALLBACK PPUViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PPUViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { RECT wrect; char str[20]; diff --git a/src/drivers/win/ram_search.cpp b/src/drivers/win/ram_search.cpp index a2e38a0c..d66ac558 100644 --- a/src/drivers/win/ram_search.cpp +++ b/src/drivers/win/ram_search.cpp @@ -1101,15 +1101,15 @@ void ReopenRamWindows() //Reopen them when a new Rom is loaded if(!RamSearchHWnd) { reset_address_info(); - LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - RamSearchHWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_RAMSEARCH), hWnd, (DLGPROC) RamSearchProc); + INT_PTR CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + RamSearchHWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_RAMSEARCH), hWnd, RamSearchProc); } if (AutoRWLoad) OpenRWRecentFile(0); if (!RamWatchHWnd) - RamWatchHWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_RAMWATCH), hWnd, (DLGPROC) RamWatchProc); + RamWatchHWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_RAMWATCH), hWnd, RamWatchProc); if (hwnd == hWnd && hwnd != GetActiveWindow()) SetActiveWindow(hWnd); // restore focus to the main window if it had it before @@ -1396,7 +1396,7 @@ static BOOL SelectingByKeyboard() return (a | b | c | d) & 0x80; } -LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { RECT r; RECT r2; diff --git a/src/drivers/win/ram_search.h b/src/drivers/win/ram_search.h index 122fa82c..66a5457f 100644 --- a/src/drivers/win/ram_search.h +++ b/src/drivers/win/ram_search.h @@ -29,7 +29,7 @@ void SetSearchType(int SearchType); //Set the search type void DoRamSearchOperation(); //Perform a search extern HWND RamSearchHWnd; -extern LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); // Too much work to do for resorting the values, and finding the biggest number // by sorting in ram list doesn't help too much in usually use, so I gave it up. diff --git a/src/drivers/win/ramwatch.cpp b/src/drivers/win/ramwatch.cpp index 11769cf1..854f020f 100644 --- a/src/drivers/win/ramwatch.cpp +++ b/src/drivers/win/ramwatch.cpp @@ -154,7 +154,7 @@ bool InsertWatch(const AddressWatcher& Watch, HWND parent) rswatches[tmpWatchIndex] = Watch; rswatches[tmpWatchIndex].CurValue = GetCurrentValue(rswatches[tmpWatchIndex]); - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), parent, (DLGPROC)EditWatchProc, tmpWatchIndex); + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), parent, EditWatchProc, tmpWatchIndex); rswatches.erase(tmpWatchIndex); return WatchCount > prevWatchCount; @@ -170,7 +170,7 @@ bool InsertWatches(const AddressWatcher* watches, HWND parent, const int count) char comment[256]; rswatches[-1] = watches[0]; rswatches[-1].comment = comment; - if(DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), parent, (DLGPROC)EditWatchProc, (LPARAM)-1)) + if(DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), parent, EditWatchProc, (LPARAM)-1)) for (int i = 0; i < count; ++i) { AddressWatcher watcher = watches[i]; @@ -775,7 +775,7 @@ void RefreshWatchListSelectedItemControlStatus(HWND hDlg) } } -LRESULT CALLBACK EditWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) //Gets info for a RAM Watch, and then inserts it into the Watch List +INT_PTR CALLBACK EditWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) //Gets info for a RAM Watch, and then inserts it into the Watch List { // since there are 3 windows can pops up the add watch dialog, we should store them separately. @@ -1002,7 +1002,7 @@ void RefreshWatchListSelectedCountControlStatus(HWND hDlg, int newComer) } } -LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static int watchIndex = 0; // current watch index static bool listFocus; @@ -1307,7 +1307,7 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST)); if(watchIndex != -1) { - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC)EditWatchProc, watchIndex); + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, EditWatchProc, watchIndex); SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST)); } return true; @@ -1318,7 +1318,7 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam target.WrongEndian = 0; target.Size = 'b'; target.Type = 's'; - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC)EditWatchProc, WatchCount); + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, EditWatchProc, WatchCount); SetFocus(GetDlgItem(hDlg, IDC_WATCHLIST)); return true; } @@ -1332,7 +1332,7 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam AddressWatcher* source = &rswatches[watchIndex]; memcpy(target, source, sizeof(AddressWatcher)); target->comment = strcpy(str_tmp, source->comment); - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC)EditWatchProc, WatchCount); + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, EditWatchProc, WatchCount); SetFocus(GetDlgItem(hDlg, IDC_WATCHLIST)); } return true; @@ -1345,7 +1345,7 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam target->Size = 'S'; target->Type = 'S'; - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC)EditWatchProc, (LPARAM)WatchCount); + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, EditWatchProc, (LPARAM)WatchCount); // InsertWatch(separator, "----------------------------"); SetFocus(GetDlgItem(hDlg, IDC_WATCHLIST)); diff --git a/src/drivers/win/ramwatch.h b/src/drivers/win/ramwatch.h index 2df1638d..1225a689 100644 --- a/src/drivers/win/ramwatch.h +++ b/src/drivers/win/ramwatch.h @@ -70,8 +70,8 @@ bool Load_Watches(bool clear, const char* filename); void RWAddRecentFile(const char *filename); void UpdateWatchCheats(); -LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -LRESULT CALLBACK EditWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK EditWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); extern HWND RamWatchHWnd; diff --git a/src/drivers/win/replay.cpp b/src/drivers/win/replay.cpp index acfecfbd..f651dd00 100644 --- a/src/drivers/win/replay.cpp +++ b/src/drivers/win/replay.cpp @@ -323,7 +323,7 @@ void AbsoluteToRelative(char *const dst, const char *const dir, const char *cons } -BOOL CALLBACK ReplayMetadataDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK ReplayMetadataDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { RECT wrect; switch(uMsg) @@ -502,7 +502,7 @@ void HandleScan(HWND hwndDlg, FCEUFILE* file, int& i) SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_INSERTSTRING, i++, (LPARAM)relative); } -BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { @@ -841,7 +841,7 @@ static void UpdateRecordDialogPath(HWND hwndDlg, const std::string &fname) } } -static BOOL CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static struct CreateMovieParameters* p = NULL; diff --git a/src/drivers/win/sound.cpp b/src/drivers/win/sound.cpp index ae5f1a86..c751c586 100644 --- a/src/drivers/win/sound.cpp +++ b/src/drivers/win/sound.cpp @@ -500,7 +500,7 @@ static void UpdateSD(HWND hwndDlg) UpdateSoundChannelQualityMode(hwndDlg); } -BOOL CALLBACK SoundConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK SoundConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/taseditor.cpp b/src/drivers/win/taseditor.cpp index d0daa0f8..9e1b0f61 100644 --- a/src/drivers/win/taseditor.cpp +++ b/src/drivers/win/taseditor.cpp @@ -245,7 +245,7 @@ void updateTASEditor() } } -BOOL CALLBACK newProjectProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK newProjectProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { static struct NewProjectParameters* p = NULL; switch (message) @@ -518,7 +518,7 @@ void SaveCompact_GetDialogItems(HWND hwndDlg) else taseditorConfig.saveCompact_GreenzoneSavingMode = GREENZONE_SAVING_MODE_NO; } -BOOL CALLBACK SaveCompactProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK SaveCompactProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { @@ -655,7 +655,7 @@ void importInputData() } } -BOOL CALLBACK aboutWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK aboutWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { @@ -678,7 +678,7 @@ BOOL CALLBACK aboutWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam return FALSE; } -BOOL CALLBACK savingOptionsWndProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK savingOptionsWndProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { @@ -768,7 +768,7 @@ BOOL CALLBACK savingOptionsWndProc(HWND hwndDlg, UINT message, WPARAM wParam, LP return FALSE; } -BOOL CALLBACK ExportProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK ExportProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { diff --git a/src/drivers/win/taseditor/markers_manager.cpp b/src/drivers/win/taseditor/markers_manager.cpp index 654a46c4..dba27a4e 100644 --- a/src/drivers/win/taseditor/markers_manager.cpp +++ b/src/drivers/win/taseditor/markers_manager.cpp @@ -619,7 +619,7 @@ void MARKERS_MANAGER::updateEditedMarkerNote() } } // ------------------------------------------------------------------------------------ -BOOL CALLBACK findNoteWndProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK findNoteWndProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { extern MARKERS_MANAGER markersManager; switch (message) diff --git a/src/drivers/win/taseditor/taseditor_window.cpp b/src/drivers/win/taseditor/taseditor_window.cpp index 55699f18..8e3134a7 100644 --- a/src/drivers/win/taseditor/taseditor_window.cpp +++ b/src/drivers/win/taseditor/taseditor_window.cpp @@ -53,12 +53,12 @@ extern bool mustCallManualLuaFunction; extern char* GetKeyComboName(int c); -extern BOOL CALLBACK findNoteWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -extern BOOL CALLBACK aboutWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -extern BOOL CALLBACK savingOptionsWndProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK findNoteWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK aboutWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK savingOptionsWndProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam); // main window wndproc -BOOL CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); // wndprocs for "Marker X" text fields LRESULT APIENTRY IDC_PLAYBACK_MARKER_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY IDC_SELECTION_MARKER_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); @@ -780,7 +780,7 @@ void TASEDITOR_WINDOW::recheckPatternsMenu() } // ==================================================================================================== -BOOL CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { extern TASEDITOR_WINDOW taseditorWindow; switch(uMsg) diff --git a/src/drivers/win/texthook.cpp b/src/drivers/win/texthook.cpp index 934e946c..5b319a1f 100644 --- a/src/drivers/win/texthook.cpp +++ b/src/drivers/win/texthook.cpp @@ -777,7 +777,7 @@ int TextHookerSaveTableFile(){ * Looking for comments? Inqure within! * */ -BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { +INT_PTR CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { RECT wrect; char str[2048]; char bufferstr[10240]; //holds the entire buffer, so it needs to be big... diff --git a/src/drivers/win/timing.cpp b/src/drivers/win/timing.cpp index 89bc6e35..0b833a6b 100644 --- a/src/drivers/win/timing.cpp +++ b/src/drivers/win/timing.cpp @@ -71,7 +71,7 @@ void CloseTimingDialog(HWND hwndDlg) /** * Callback function of the Timing configuration dialog. **/ -BOOL CALLBACK TimingConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK TimingConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { diff --git a/src/drivers/win/tracer.cpp b/src/drivers/win/tracer.cpp index a24ca6a8..314d751a 100644 --- a/src/drivers/win/tracer.cpp +++ b/src/drivers/win/tracer.cpp @@ -373,7 +373,7 @@ BOOL CALLBACK TracerResizingEnumWindowsProc(HWND hwnd, LPARAM lParam) return TRUE; } -BOOL CALLBACK TracerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK TracerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { int i; switch(uMsg) diff --git a/src/drivers/win/video.cpp b/src/drivers/win/video.cpp index e48bcd72..42910f91 100644 --- a/src/drivers/win/video.cpp +++ b/src/drivers/win/video.cpp @@ -1148,7 +1148,7 @@ double GetDlgItemDouble(HWND hDlg, int item) return(ret); } -BOOL CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static char *vmstr[11]={ "Custom", diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index ddfa0d37..6c40b5dd 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -117,7 +117,7 @@ extern bool turbo; extern bool movie_readonly; extern bool AutoSS; //flag for whether an auto-save has been made extern int newppu; -extern BOOL CALLBACK ReplayMetadataDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); //Metadata dialog +extern INT_PTR CALLBACK ReplayMetadataDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); //Metadata dialog extern bool CheckFileExists(const char* filename); //Receives a filename (fullpath) and checks to see if that file exists extern bool oldInputDisplay; extern int RAMInitOption; @@ -1870,7 +1870,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) case ID_FILE_OPENLUAWINDOW: if (!LuaConsoleHWnd) { - LuaConsoleHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_LUA), hWnd, (DLGPROC) DlgLuaScriptDialog); + LuaConsoleHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_LUA), hWnd, DlgLuaScriptDialog); } else { ShowWindow(LuaConsoleHWnd, SW_SHOWNORMAL); @@ -3159,14 +3159,14 @@ void OpenRamSearch() if (GameInfo) { reset_address_info(); - RamSearchHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_RAMSEARCH), MainhWnd, (DLGPROC)RamSearchProc); + RamSearchHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_RAMSEARCH), MainhWnd, RamSearchProc); } } void OpenRamWatch() { if (GameInfo) - RamWatchHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_RAMWATCH), MainhWnd, (DLGPROC) RamWatchProc); + RamWatchHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_RAMWATCH), MainhWnd, RamWatchProc); } void SaveSnapshotAs() diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 424c9669..417f5c3f 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -6193,7 +6193,7 @@ int FCEU_LoadLuaCode(const char *filename, const char *arg) { info_onstart = WinLuaOnStart; info_onstop = WinLuaOnStop; if(!LuaConsoleHWnd) - LuaConsoleHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_LUA), hAppWnd, (DLGPROC) DlgLuaScriptDialog); + LuaConsoleHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_LUA), hAppWnd, DlgLuaScriptDialog); info_uid = (int)LuaConsoleHWnd; #else info_print = NULL; From 2396d1c7027bae43202cc3ae5e4bdddedcbc2833 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Fri, 21 Jun 2019 15:02:11 -0400 Subject: [PATCH 2/6] Replace SetWindowLong with SetWindowLongPtr for 64-bit compliance --- src/drivers/win/Win32InputBox.cpp | 2 +- src/drivers/win/cheat.cpp | 28 ++++----- src/drivers/win/debugger.cpp | 18 +++--- src/drivers/win/debugger.h | 2 +- src/drivers/win/header_editor.cpp | 30 +++++----- src/drivers/win/header_editor.h | 2 +- src/drivers/win/memwatch.cpp | 2 +- src/drivers/win/ram_search.cpp | 2 +- src/drivers/win/ramwatch.cpp | 10 ++-- src/drivers/win/taseditor/bookmarks.cpp | 2 +- src/drivers/win/taseditor/branches.cpp | 2 +- src/drivers/win/taseditor/history.cpp | 2 +- src/drivers/win/taseditor/piano_roll.cpp | 4 +- src/drivers/win/taseditor/playback.cpp | 2 +- src/drivers/win/taseditor/selection.cpp | 2 +- .../win/taseditor/taseditor_window.cpp | 58 +++++++++---------- src/drivers/win/tracer.cpp | 2 +- src/drivers/win/video.cpp | 8 +-- src/drivers/win/window.cpp | 4 +- 19 files changed, 91 insertions(+), 91 deletions(-) diff --git a/src/drivers/win/Win32InputBox.cpp b/src/drivers/win/Win32InputBox.cpp index 4c9956d4..34ebc496 100644 --- a/src/drivers/win/Win32InputBox.cpp +++ b/src/drivers/win/Win32InputBox.cpp @@ -319,7 +319,7 @@ INT_PTR CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam, { case WM_INITDIALOG: { - ::SetWindowLong(hDlg, GWL_USERDATA, (LONG) lParam); + ::SetWindowLongPtr(hDlg, GWL_USERDATA, lParam); _this = (CWin32InputBox *) lParam; _this->_param->hDlg = hDlg; diff --git a/src/drivers/win/cheat.cpp b/src/drivers/win/cheat.cpp index 530a12ea..5072bb3f 100644 --- a/src/drivers/win/cheat.cpp +++ b/src/drivers/win/cheat.cpp @@ -341,16 +341,16 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l SendDlgItemMessage(hwndDlg, IDC_CHEAT_GAME_GENIE_TEXT, EM_SETLIMITTEXT, 8, 0); // limit their characters - DefaultEditCtrlProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndDlg, IDC_CHEAT_ADDR), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_CHEAT_ADDR), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_CHEAT_VAL), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_CHEAT_COM), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_CHEAT_VAL_KNOWN), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_CHEAT_VAL_NE_BY), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_CHEAT_VAL_GT_BY), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_CHEAT_VAL_LT_BY), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_CHEAT_TEXT), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_CHEAT_GAME_GENIE_TEXT), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + DefaultEditCtrlProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHEAT_ADDR), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHEAT_ADDR), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHEAT_VAL), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHEAT_COM), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHEAT_VAL_KNOWN), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHEAT_VAL_NE_BY), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHEAT_VAL_GT_BY), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHEAT_VAL_LT_BY), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHEAT_TEXT), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHEAT_GAME_GENIE_TEXT), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); @@ -1092,10 +1092,10 @@ BOOL CALLBACK GGConvCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) SendDlgItemMessage(hwndDlg, IDC_GAME_GENIE_VAL, WM_SETFONT, (WPARAM)hNewFont, FALSE); // limit their characters - DefaultEditCtrlProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndDlg, IDC_GAME_GENIE_CODE), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_GAME_GENIE_ADDR), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_GAME_GENIE_COMP), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_GAME_GENIE_VAL), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + DefaultEditCtrlProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GAME_GENIE_CODE), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GAME_GENIE_ADDR), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GAME_GENIE_COMP), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GAME_GENIE_VAL), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); } break; case WM_CLOSE: diff --git a/src/drivers/win/debugger.cpp b/src/drivers/win/debugger.cpp index 484aa529..12844805 100644 --- a/src/drivers/win/debugger.cpp +++ b/src/drivers/win/debugger.cpp @@ -279,8 +279,8 @@ INT_PTR CALLBACK AddbpCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara SendDlgItemMessage(hwndDlg, IDC_ADDBP_ADDR_START, EM_SETLIMITTEXT, 4, 0); SendDlgItemMessage(hwndDlg, IDC_ADDBP_ADDR_END, EM_SETLIMITTEXT, 4, 0); - DefaultEditCtrlProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndDlg, IDC_ADDBP_ADDR_START), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_ADDBP_ADDR_END), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + DefaultEditCtrlProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_ADDBP_ADDR_START), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_ADDBP_ADDR_END), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); if (WP_edit >= 0) { @@ -1825,12 +1825,12 @@ INT_PTR CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_SPR,EM_SETLIMITTEXT,2,0); // limit input - DefaultEditCtrlProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndDlg, IDC_DEBUGGER_VAL_PCSEEK), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_DEBUGGER_VAL_PC), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_DEBUGGER_VAL_A), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_DEBUGGER_VAL_X), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_DEBUGGER_VAL_Y), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_DEBUGGER_BOOKMARK), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + DefaultEditCtrlProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DEBUGGER_VAL_PCSEEK), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DEBUGGER_VAL_PC), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DEBUGGER_VAL_A), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DEBUGGER_VAL_X), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DEBUGGER_VAL_Y), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DEBUGGER_BOOKMARK), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); //I'm lazy, disable the controls which I can't mess with right now SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_PPU,EM_SETREADONLY,TRUE,0); @@ -1851,7 +1851,7 @@ INT_PTR CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP hDisasmcontext = LoadMenu(fceu_hInstance,"DISASMCONTEXTMENUS"); // subclass editfield - IDC_DEBUGGER_DISASSEMBLY_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndDlg, IDC_DEBUGGER_DISASSEMBLY), GWL_WNDPROC, (LONG)IDC_DEBUGGER_DISASSEMBLY_WndProc); + IDC_DEBUGGER_DISASSEMBLY_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DEBUGGER_DISASSEMBLY), GWLP_WNDPROC, (LONG_PTR)IDC_DEBUGGER_DISASSEMBLY_WndProc); debugger_open = 1; inDebugger = true; diff --git a/src/drivers/win/debugger.h b/src/drivers/win/debugger.h index 63e9722d..4f5a2d9f 100644 --- a/src/drivers/win/debugger.h +++ b/src/drivers/win/debugger.h @@ -70,6 +70,6 @@ public: } *debugSystem; // extern WNDPROC DefaultEditCtrlProc; -// extern LRESULT APIENTRY FilterEditCtrlProc(HWND hwnd, UINT msg, WPARAM wP, LPARAM lP); +// extern INT_PTR APIENTRY FilterEditCtrlProc(HWND hwnd, UINT msg, WPARAM wP, LPARAM lP); #endif diff --git a/src/drivers/win/header_editor.cpp b/src/drivers/win/header_editor.cpp index 14c95733..d964d81c 100644 --- a/src/drivers/win/header_editor.cpp +++ b/src/drivers/win/header_editor.cpp @@ -281,32 +281,32 @@ HWND InitHeaderEditDialog(HWND hwnd, iNES_HEADER* header) // Assign ID to the sub edit control in these comboboxes // PRG ROM - SetWindowLong(GetWindow(GetDlgItem(hwnd, IDC_PRGROM_COMBO), GW_CHILD), GWL_ID, IDC_PRGROM_EDIT); + SetWindowLongPtr(GetWindow(GetDlgItem(hwnd, IDC_PRGROM_COMBO), GW_CHILD), GWL_ID, IDC_PRGROM_EDIT); // PRG RAM - SetWindowLong(GetWindow(GetDlgItem(hwnd, IDC_PRGRAM_COMBO), GW_CHILD), GWL_ID, IDC_PRGRAM_EDIT); + SetWindowLongPtr(GetWindow(GetDlgItem(hwnd, IDC_PRGRAM_COMBO), GW_CHILD), GWL_ID, IDC_PRGRAM_EDIT); // PRG NVRAM - SetWindowLong(GetWindow(GetDlgItem(hwnd, IDC_PRGNVRAM_COMBO), GW_CHILD), GWL_ID, IDC_PRGNVRAM_EDIT); + SetWindowLongPtr(GetWindow(GetDlgItem(hwnd, IDC_PRGNVRAM_COMBO), GW_CHILD), GWL_ID, IDC_PRGNVRAM_EDIT); // CHR ROM - SetWindowLong(GetWindow(GetDlgItem(hwnd, IDC_CHRROM_COMBO), GW_CHILD), GWL_ID, IDC_CHRROM_EDIT); + SetWindowLongPtr(GetWindow(GetDlgItem(hwnd, IDC_CHRROM_COMBO), GW_CHILD), GWL_ID, IDC_CHRROM_EDIT); // CHR RAM - SetWindowLong(GetWindow(GetDlgItem(hwnd, IDC_CHRRAM_COMBO), GW_CHILD), GWL_ID, IDC_CHRRAM_EDIT); + SetWindowLongPtr(GetWindow(GetDlgItem(hwnd, IDC_CHRRAM_COMBO), GW_CHILD), GWL_ID, IDC_CHRRAM_EDIT); // CHR NVRAM - SetWindowLong(GetWindow(GetDlgItem(hwnd, IDC_CHRNVRAM_COMBO), GW_CHILD), GWL_ID, IDC_CHRNVRAM_EDIT); + SetWindowLongPtr(GetWindow(GetDlgItem(hwnd, IDC_CHRNVRAM_COMBO), GW_CHILD), GWL_ID, IDC_CHRNVRAM_EDIT); // Change the default wndproc of these control to limit their text // PRG ROM - DefaultEditCtrlProc = (WNDPROC)SetWindowLong(GetDlgItem(GetDlgItem(hwnd, IDC_PRGROM_COMBO), IDC_PRGROM_EDIT), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + DefaultEditCtrlProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(GetDlgItem(hwnd, IDC_PRGROM_COMBO), IDC_PRGROM_EDIT), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); // PRG RAM - SetWindowLong(GetDlgItem(GetDlgItem(hwnd, IDC_PRGRAM_COMBO), IDC_PRGRAM_EDIT), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(GetDlgItem(hwnd, IDC_PRGRAM_COMBO), IDC_PRGRAM_EDIT), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); // PRG NVRAM - SetWindowLong(GetDlgItem(GetDlgItem(hwnd, IDC_PRGNVRAM_COMBO), IDC_PRGNVRAM_EDIT), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(GetDlgItem(hwnd, IDC_PRGNVRAM_COMBO), IDC_PRGNVRAM_EDIT), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); // CHR ROM - SetWindowLong(GetDlgItem(GetDlgItem(hwnd, IDC_CHRROM_COMBO), IDC_CHRROM_EDIT), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(GetDlgItem(hwnd, IDC_CHRROM_COMBO), IDC_CHRROM_EDIT), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); // CHR RAM - SetWindowLong(GetDlgItem(GetDlgItem(hwnd, IDC_CHRRAM_COMBO), IDC_CHRRAM_EDIT), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(GetDlgItem(hwnd, IDC_CHRRAM_COMBO), IDC_CHRRAM_EDIT), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); // CHR NVRAM - SetWindowLong(GetDlgItem(GetDlgItem(hwnd, IDC_CHRNVRAM_COMBO), IDC_CHRNVRAM_EDIT), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(GetDlgItem(hwnd, IDC_CHRNVRAM_COMBO), IDC_CHRNVRAM_EDIT), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); ToggleINES20(hwnd, IsDlgButtonChecked(hwnd, IDC_RADIO_VERSION_INES20) == BST_CHECKED); @@ -496,7 +496,7 @@ void ToggleUnofficialPrgRamPresent(HWND hwnd, bool ines20, bool unofficial_check EnableWindow(GetDlgItem(hwnd, IDC_PRGRAM_COMBO), enable); } -LRESULT CALLBACK HeaderEditorProc(HWND hDlg, UINT uMsg, WPARAM wP, LPARAM lP) +INT_PTR CALLBACK HeaderEditorProc(HWND hDlg, UINT uMsg, WPARAM wP, LPARAM lP) { static iNES_HEADER* header; @@ -599,7 +599,7 @@ void DoHeadEdit() if (GameInfo) { if (LoadHeader(hAppWnd, header)) - CreateDialogParam(fceu_hInstance, MAKEINTRESOURCE(IDD_EDIT_HEADER), hAppWnd, (DLGPROC)HeaderEditorProc, (LPARAM)header); + CreateDialogParam(fceu_hInstance, MAKEINTRESOURCE(IDD_EDIT_HEADER), hAppWnd, HeaderEditorProc, (LPARAM)header); else free(header); } @@ -607,7 +607,7 @@ void DoHeadEdit() // temporarily borrow LoadedRomFName, when no game is loaded, it is unused. LoadedRomFName[0] = 0; if (ShowINESFileBox(hAppWnd) && LoadHeader(hAppWnd, header)) - DialogBoxParam(fceu_hInstance, MAKEINTRESOURCE(IDD_EDIT_HEADER), hAppWnd, (DLGPROC)HeaderEditorProc, (LPARAM)header); + DialogBoxParam(fceu_hInstance, MAKEINTRESOURCE(IDD_EDIT_HEADER), hAppWnd, HeaderEditorProc, (LPARAM)header); else free(header); } diff --git a/src/drivers/win/header_editor.h b/src/drivers/win/header_editor.h index 6548f35a..28ee64a8 100644 --- a/src/drivers/win/header_editor.h +++ b/src/drivers/win/header_editor.h @@ -23,7 +23,7 @@ bool GetComboBoxListItemData(HWND hwnd, UINT id, int* value, char* buf, bool exa bool SaveINESFile(HWND hwnd, char* path, iNES_HEADER* header); -LRESULT CALLBACK HeaderEditorProc(HWND hDlg, UINT uMsg, WPARAM wP, LPARAM lP); +INT_PTR CALLBACK HeaderEditorProc(HWND hDlg, UINT uMsg, WPARAM wP, LPARAM lP); extern WNDPROC DefaultEditCtrlProc; extern LRESULT APIENTRY FilterEditCtrlProc(HWND hwnd, UINT msg, WPARAM wP, LPARAM lP); diff --git a/src/drivers/win/memwatch.cpp b/src/drivers/win/memwatch.cpp index 531f83f8..8da937f0 100644 --- a/src/drivers/win/memwatch.cpp +++ b/src/drivers/win/memwatch.cpp @@ -795,7 +795,7 @@ static INT_PTR CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP // experimental: limit the text length and input to hex values SendDlgItemMessage(hwndDlg, MW_ADDR[i], EM_SETLIMITTEXT, 4, 0); - DefaultEditCtrlProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndDlg, MW_ADDR[i]), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + DefaultEditCtrlProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, MW_ADDR[i]), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); } //Populate Formula pulldown menus diff --git a/src/drivers/win/ram_search.cpp b/src/drivers/win/ram_search.cpp index 9e114469..2921236f 100644 --- a/src/drivers/win/ram_search.cpp +++ b/src/drivers/win/ram_search.cpp @@ -1526,7 +1526,7 @@ INT_PTR CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara { case NM_CUSTOMDRAW: { - SetWindowLong(hDlg, DWL_MSGRESULT, CustomDraw(lParam)); + SetWindowLongPtr(hDlg, DWL_MSGRESULT, CustomDraw(lParam)); return TRUE; } diff --git a/src/drivers/win/ramwatch.cpp b/src/drivers/win/ramwatch.cpp index a464dc0c..897bb434 100644 --- a/src/drivers/win/ramwatch.cpp +++ b/src/drivers/win/ramwatch.cpp @@ -1180,7 +1180,7 @@ INT_PTR CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam // disable search by keyboard typing, // because it interferes with some of the accelerators // and it isn't very useful here anyway - SetWindowLong(hDlg, DWL_MSGRESULT, ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST))); + SetWindowLongPtr(hDlg, DWL_MSGRESULT, ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST))); return 1; } case NM_SETFOCUS: @@ -1197,12 +1197,12 @@ INT_PTR CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam switch (nmcd->dwDrawStage) { case CDDS_PREPAINT: - SetWindowLong(hDlg, DWL_MSGRESULT, CDRF_NOTIFYITEMDRAW); + SetWindowLongPtr(hDlg, DWL_MSGRESULT, CDRF_NOTIFYITEMDRAW); break; case CDDS_ITEMPREPAINT: if (rswatches[nmcd->dwItemSpec].Type == 'S') // A separator looks very different from normal watches, it should be drawn in another space while I want to use the highlight bar and the focus frame from the system. - SetWindowLong(hDlg, DWL_MSGRESULT, CDRF_NOTIFYPOSTPAINT); + SetWindowLongPtr(hDlg, DWL_MSGRESULT, CDRF_NOTIFYPOSTPAINT); else { NMLVCUSTOMDRAW* lplvcd = (NMLVCUSTOMDRAW*)lParam; @@ -1210,7 +1210,7 @@ INT_PTR CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam { default: case 0: - SetWindowLong(hDlg, DWL_MSGRESULT, CDRF_DODEFAULT); + SetWindowLongPtr(hDlg, DWL_MSGRESULT, CDRF_DODEFAULT); return TRUE; case 1: lplvcd->clrTextBk = RGB(216, 203, 253); break; @@ -1222,7 +1222,7 @@ INT_PTR CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam lplvcd->clrTextBk = RGB(175, 94, 253); lplvcd->clrText = RGB(255, 255, 255); break; // use a more visual color in dark background } - SetWindowLong(hDlg, DWL_MSGRESULT, CDRF_NEWFONT); + SetWindowLongPtr(hDlg, DWL_MSGRESULT, CDRF_NEWFONT); } break; case CDDS_ITEMPOSTPAINT: diff --git a/src/drivers/win/taseditor/bookmarks.cpp b/src/drivers/win/taseditor/bookmarks.cpp index 663219b2..c56f346d 100644 --- a/src/drivers/win/taseditor/bookmarks.cpp +++ b/src/drivers/win/taseditor/bookmarks.cpp @@ -78,7 +78,7 @@ void BOOKMARKS::init() // prepare bookmarks listview ListView_SetExtendedListViewStyleEx(hwndBookmarksList, LVS_EX_DOUBLEBUFFER|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES, LVS_EX_DOUBLEBUFFER|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES); // subclass the listview - hwndBookmarksList_oldWndProc = (WNDPROC)SetWindowLong(hwndBookmarksList, GWL_WNDPROC, (LONG)BookmarksListWndProc); + hwndBookmarksList_oldWndProc = (WNDPROC)SetWindowLongPtr(hwndBookmarksList, GWLP_WNDPROC, (LONG_PTR)BookmarksListWndProc); // setup images for the listview hImgList = ImageList_Create(11, 13, ILC_COLOR8 | ILC_MASK, 1, 1); HBITMAP bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP0)); diff --git a/src/drivers/win/taseditor/branches.cpp b/src/drivers/win/taseditor/branches.cpp index 21b73149..75b9b59c 100644 --- a/src/drivers/win/taseditor/branches.cpp +++ b/src/drivers/win/taseditor/branches.cpp @@ -56,7 +56,7 @@ void BRANCHES::init() free(); // subclass BranchesBitmap - hwndBranchesBitmap_oldWndProc = (WNDPROC)SetWindowLong(bookmarks.hwndBranchesBitmap, GWL_WNDPROC, (LONG)BranchesBitmapWndProc); + hwndBranchesBitmap_oldWndProc = (WNDPROC)SetWindowLongPtr(bookmarks.hwndBranchesBitmap, GWLP_WNDPROC, (LONG_PTR)BranchesBitmapWndProc); // init arrays branchX.resize(TOTAL_BOOKMARKS+1); diff --git a/src/drivers/win/taseditor/history.cpp b/src/drivers/win/taseditor/history.cpp index 10ae24aa..c2e8b90f 100644 --- a/src/drivers/win/taseditor/history.cpp +++ b/src/drivers/win/taseditor/history.cpp @@ -116,7 +116,7 @@ void HISTORY::init() hwndHistoryList = GetDlgItem(taseditorWindow.hwndTASEditor, IDC_HISTORYLIST); ListView_SetExtendedListViewStyleEx(hwndHistoryList, LVS_EX_DOUBLEBUFFER|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES, LVS_EX_DOUBLEBUFFER|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES); // subclass the listview - hwndHistoryList_oldWndProc = (WNDPROC)SetWindowLong(hwndHistoryList, GWL_WNDPROC, (LONG)historyListWndProc); + hwndHistoryList_oldWndProc = (WNDPROC)SetWindowLongPtr(hwndHistoryList, GWLP_WNDPROC, (LONG_PTR)historyListWndProc); LVCOLUMN lvc; lvc.mask = LVCF_WIDTH | LVCF_FMT; lvc.cx = HISTORY_LIST_WIDTH; diff --git a/src/drivers/win/taseditor/piano_roll.cpp b/src/drivers/win/taseditor/piano_roll.cpp index ae3161d6..91261bee 100644 --- a/src/drivers/win/taseditor/piano_roll.cpp +++ b/src/drivers/win/taseditor/piano_roll.cpp @@ -141,9 +141,9 @@ void PIANO_ROLL::init() ListView_SetExtendedListViewStyleEx(hwndList, LVS_EX_DOUBLEBUFFER|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES, LVS_EX_DOUBLEBUFFER|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES); // subclass the header hwndHeader = ListView_GetHeader(hwndList); - hwndHeaderOldWndproc = (WNDPROC)SetWindowLong(hwndHeader, GWL_WNDPROC, (LONG)headerWndProc); + hwndHeaderOldWndproc = (WNDPROC)SetWindowLongPtr(hwndHeader, GWLP_WNDPROC, (LONG_PTR)headerWndProc); // subclass the whole listview - hwndListOldWndProc = (WNDPROC)SetWindowLong(hwndList, GWL_WNDPROC, (LONG)listWndProc); + hwndListOldWndProc = (WNDPROC)SetWindowLongPtr(hwndList, GWLP_WNDPROC, (LONG_PTR)listWndProc); // disable Visual Themes for header SetWindowTheme(hwndHeader, L"", L""); // setup images for the listview diff --git a/src/drivers/win/taseditor/playback.cpp b/src/drivers/win/taseditor/playback.cpp index 412a555e..b09e5fdf 100644 --- a/src/drivers/win/taseditor/playback.cpp +++ b/src/drivers/win/taseditor/playback.cpp @@ -65,7 +65,7 @@ void PLAYBACK::init() SendMessage(hwndPlaybackMarkerEditField, EM_SETLIMITTEXT, MAX_NOTE_LEN - 1, 0); SendMessage(hwndPlaybackMarkerEditField, WM_SETFONT, (WPARAM)pianoRoll.hMarkersEditFont, 0); // subclass the edit control - playbackMarkerEdit_oldWndproc = (WNDPROC)SetWindowLong(hwndPlaybackMarkerEditField, GWL_WNDPROC, (LONG)UpperMarkerEditWndProc); + playbackMarkerEdit_oldWndproc = (WNDPROC)SetWindowLongPtr(hwndPlaybackMarkerEditField, GWLP_WNDPROC, (LONG_PTR)UpperMarkerEditWndProc); reset(); } diff --git a/src/drivers/win/taseditor/selection.cpp b/src/drivers/win/taseditor/selection.cpp index 5d297a67..a3e6fd6e 100644 --- a/src/drivers/win/taseditor/selection.cpp +++ b/src/drivers/win/taseditor/selection.cpp @@ -57,7 +57,7 @@ void SELECTION::init() SendMessage(hwndSelectionMarkerEditField, EM_SETLIMITTEXT, MAX_NOTE_LEN - 1, 0); SendMessage(hwndSelectionMarkerEditField, WM_SETFONT, (WPARAM)pianoRoll.hMarkersEditFont, 0); // subclass the edit control - selectionMarkerEdit_oldWndproc = (WNDPROC)SetWindowLong(hwndSelectionMarkerEditField, GWL_WNDPROC, (LONG)LowerMarkerEditWndProc); + selectionMarkerEdit_oldWndproc = (WNDPROC)SetWindowLongPtr(hwndSelectionMarkerEditField, GWLP_WNDPROC, (LONG_PTR)LowerMarkerEditWndProc); reset(); } diff --git a/src/drivers/win/taseditor/taseditor_window.cpp b/src/drivers/win/taseditor/taseditor_window.cpp index 8e3134a7..fc1cae31 100644 --- a/src/drivers/win/taseditor/taseditor_window.cpp +++ b/src/drivers/win/taseditor/taseditor_window.cpp @@ -264,33 +264,33 @@ void TASEDITOR_WINDOW::init() updateTooltips(); toggleTooltips(); // subclass "Marker X" text fields - IDC_PLAYBACK_MARKER_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_PLAYBACK_MARKER), GWL_WNDPROC, (LONG)IDC_PLAYBACK_MARKER_WndProc); - IDC_SELECTION_MARKER_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_SELECTION_MARKER), GWL_WNDPROC, (LONG)IDC_SELECTION_MARKER_WndProc); + IDC_PLAYBACK_MARKER_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_PLAYBACK_MARKER), GWLP_WNDPROC, (LONG_PTR)IDC_PLAYBACK_MARKER_WndProc); + IDC_SELECTION_MARKER_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_SELECTION_MARKER), GWLP_WNDPROC, (LONG_PTR)IDC_SELECTION_MARKER_WndProc); // subclass all buttons - IDC_PROGRESS_BUTTON_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_PROGRESS_BUTTON), GWL_WNDPROC, (LONG)IDC_PROGRESS_BUTTON_WndProc); - IDC_BRANCHES_BUTTON_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_BRANCHES_BUTTON), GWL_WNDPROC, (LONG)IDC_BRANCHES_BUTTON_WndProc); - TASEDITOR_REWIND_FULL_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, TASEDITOR_REWIND_FULL), GWL_WNDPROC, (LONG)TASEDITOR_REWIND_FULL_WndProc); - TASEDITOR_REWIND_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, TASEDITOR_REWIND), GWL_WNDPROC, (LONG)TASEDITOR_REWIND_WndProc); - TASEDITOR_PLAYSTOP_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, TASEDITOR_PLAYSTOP), GWL_WNDPROC, (LONG)TASEDITOR_PLAYSTOP_WndProc); - TASEDITOR_FORWARD_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, TASEDITOR_FORWARD), GWL_WNDPROC, (LONG)TASEDITOR_FORWARD_WndProc); - TASEDITOR_FORWARD_FULL_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, TASEDITOR_FORWARD_FULL), GWL_WNDPROC, (LONG)TASEDITOR_FORWARD_FULL_WndProc); - CHECK_FOLLOW_CURSOR_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, CHECK_FOLLOW_CURSOR), GWL_WNDPROC, (LONG)CHECK_FOLLOW_CURSOR_WndProc); - CHECK_AUTORESTORE_PLAYBACK_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, CHECK_AUTORESTORE_PLAYBACK), GWL_WNDPROC, (LONG)CHECK_AUTORESTORE_PLAYBACK_WndProc); - IDC_RADIO_ALL_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_RADIO_ALL), GWL_WNDPROC, (LONG)IDC_RADIO_ALL_WndProc); - IDC_RADIO_1P_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_RADIO_1P), GWL_WNDPROC, (LONG)IDC_RADIO_1P_WndProc); - IDC_RADIO_2P_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_RADIO_2P), GWL_WNDPROC, (LONG)IDC_RADIO_2P_WndProc); - IDC_RADIO_3P_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_RADIO_3P), GWL_WNDPROC, (LONG)IDC_RADIO_3P_WndProc); - IDC_RADIO_4P_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_RADIO_4P), GWL_WNDPROC, (LONG)IDC_RADIO_4P_WndProc); - IDC_SUPERIMPOSE_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_SUPERIMPOSE), GWL_WNDPROC, (LONG)IDC_SUPERIMPOSE_WndProc); - IDC_USEPATTERN_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_USEPATTERN), GWL_WNDPROC, (LONG)IDC_USEPATTERN_WndProc); - TASEDITOR_PREV_MARKER_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, TASEDITOR_PREV_MARKER), GWL_WNDPROC, (LONG)TASEDITOR_PREV_MARKER_WndProc); - TASEDITOR_FIND_BEST_SIMILAR_MARKER_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, TASEDITOR_FIND_BEST_SIMILAR_MARKER), GWL_WNDPROC, (LONG)TASEDITOR_FIND_BEST_SIMILAR_MARKER_WndProc); - TASEDITOR_FIND_NEXT_SIMILAR_MARKER_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, TASEDITOR_FIND_NEXT_SIMILAR_MARKER), GWL_WNDPROC, (LONG)TASEDITOR_FIND_NEXT_SIMILAR_MARKER_WndProc); - TASEDITOR_NEXT_MARKER_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, TASEDITOR_NEXT_MARKER), GWL_WNDPROC, (LONG)TASEDITOR_NEXT_MARKER_WndProc); - CHECK_TURBO_SEEK_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, CHECK_TURBO_SEEK), GWL_WNDPROC, (LONG)CHECK_TURBO_SEEK_WndProc); - IDC_RECORDING_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_RECORDING), GWL_WNDPROC, (LONG)IDC_RECORDING_WndProc); - TASEDITOR_RUN_MANUAL_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, TASEDITOR_RUN_MANUAL), GWL_WNDPROC, (LONG)TASEDITOR_RUN_MANUAL_WndProc); - IDC_RUN_AUTO_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTASEditor, IDC_RUN_AUTO), GWL_WNDPROC, (LONG)IDC_RUN_AUTO_WndProc); + IDC_PROGRESS_BUTTON_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_PROGRESS_BUTTON), GWLP_WNDPROC, (LONG_PTR)IDC_PROGRESS_BUTTON_WndProc); + IDC_BRANCHES_BUTTON_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_BRANCHES_BUTTON), GWLP_WNDPROC, (LONG_PTR)IDC_BRANCHES_BUTTON_WndProc); + TASEDITOR_REWIND_FULL_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, TASEDITOR_REWIND_FULL), GWLP_WNDPROC, (LONG_PTR)TASEDITOR_REWIND_FULL_WndProc); + TASEDITOR_REWIND_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, TASEDITOR_REWIND), GWLP_WNDPROC, (LONG_PTR)TASEDITOR_REWIND_WndProc); + TASEDITOR_PLAYSTOP_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, TASEDITOR_PLAYSTOP), GWLP_WNDPROC, (LONG_PTR)TASEDITOR_PLAYSTOP_WndProc); + TASEDITOR_FORWARD_oldWndProc =(WNDPROC) SetWindowLongPtr(GetDlgItem(hwndTASEditor, TASEDITOR_FORWARD), GWLP_WNDPROC, (LONG_PTR)TASEDITOR_FORWARD_WndProc); + TASEDITOR_FORWARD_FULL_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, TASEDITOR_FORWARD_FULL), GWLP_WNDPROC, (LONG_PTR)TASEDITOR_FORWARD_FULL_WndProc); + CHECK_FOLLOW_CURSOR_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, CHECK_FOLLOW_CURSOR), GWLP_WNDPROC, (LONG_PTR)CHECK_FOLLOW_CURSOR_WndProc); + CHECK_AUTORESTORE_PLAYBACK_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, CHECK_AUTORESTORE_PLAYBACK), GWLP_WNDPROC, (LONG_PTR)CHECK_AUTORESTORE_PLAYBACK_WndProc); + IDC_RADIO_ALL_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_RADIO_ALL), GWLP_WNDPROC, (LONG_PTR)IDC_RADIO_ALL_WndProc); + IDC_RADIO_1P_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_RADIO_1P), GWLP_WNDPROC, (LONG_PTR)IDC_RADIO_1P_WndProc); + IDC_RADIO_2P_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_RADIO_2P), GWLP_WNDPROC, (LONG_PTR)IDC_RADIO_2P_WndProc); + IDC_RADIO_3P_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_RADIO_3P), GWLP_WNDPROC, (LONG_PTR)IDC_RADIO_3P_WndProc); + IDC_RADIO_4P_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_RADIO_4P), GWLP_WNDPROC, (LONG_PTR)IDC_RADIO_4P_WndProc); + IDC_SUPERIMPOSE_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_SUPERIMPOSE), GWLP_WNDPROC, (LONG_PTR)IDC_SUPERIMPOSE_WndProc); + IDC_USEPATTERN_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_USEPATTERN), GWLP_WNDPROC, (LONG_PTR)IDC_USEPATTERN_WndProc); + TASEDITOR_PREV_MARKER_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, TASEDITOR_PREV_MARKER), GWLP_WNDPROC, (LONG_PTR)TASEDITOR_PREV_MARKER_WndProc); + TASEDITOR_FIND_BEST_SIMILAR_MARKER_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, TASEDITOR_FIND_BEST_SIMILAR_MARKER), GWLP_WNDPROC, (LONG_PTR)TASEDITOR_FIND_BEST_SIMILAR_MARKER_WndProc); + TASEDITOR_FIND_NEXT_SIMILAR_MARKER_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, TASEDITOR_FIND_NEXT_SIMILAR_MARKER), GWLP_WNDPROC, (LONG_PTR)TASEDITOR_FIND_NEXT_SIMILAR_MARKER_WndProc); + TASEDITOR_NEXT_MARKER_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, TASEDITOR_NEXT_MARKER), GWLP_WNDPROC, (LONG_PTR)TASEDITOR_NEXT_MARKER_WndProc); + CHECK_TURBO_SEEK_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, CHECK_TURBO_SEEK), GWLP_WNDPROC, (LONG_PTR)CHECK_TURBO_SEEK_WndProc); + IDC_RECORDING_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_RECORDING), GWLP_WNDPROC, (LONG_PTR)IDC_RECORDING_WndProc); + TASEDITOR_RUN_MANUAL_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, TASEDITOR_RUN_MANUAL), GWLP_WNDPROC, (LONG_PTR)TASEDITOR_RUN_MANUAL_WndProc); + IDC_RUN_AUTO_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndTASEditor, IDC_RUN_AUTO), GWLP_WNDPROC, (LONG_PTR)IDC_RUN_AUTO_WndProc); // create "Recent" submenu hRecentProjectsMenu = CreateMenu(); updateRecentProjectsMenu(); @@ -833,7 +833,7 @@ INT_PTR CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP switch(((LPNMHDR)lParam)->code) { case NM_CUSTOMDRAW: - SetWindowLong(hWnd, DWL_MSGRESULT, pianoRoll.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); + SetWindowLongPtr(hWnd, DWL_MSGRESULT, pianoRoll.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); return TRUE; case LVN_GETDISPINFO: pianoRoll.getDispInfo((NMLVDISPINFO*)lParam); @@ -854,7 +854,7 @@ INT_PTR CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP switch(((LPNMHDR)lParam)->code) { case NM_CUSTOMDRAW: - SetWindowLong(hWnd, DWL_MSGRESULT, bookmarks.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); + SetWindowLongPtr(hWnd, DWL_MSGRESULT, bookmarks.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); return TRUE; case LVN_GETDISPINFO: bookmarks.getDispInfo((NMLVDISPINFO*)lParam); @@ -865,7 +865,7 @@ INT_PTR CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP switch(((LPNMHDR)lParam)->code) { case NM_CUSTOMDRAW: - SetWindowLong(hWnd, DWL_MSGRESULT, history.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); + SetWindowLongPtr(hWnd, DWL_MSGRESULT, history.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); return TRUE; case LVN_GETDISPINFO: history.getDispInfo((NMLVDISPINFO*)lParam); diff --git a/src/drivers/win/tracer.cpp b/src/drivers/win/tracer.cpp index 314d751a..e0162dfb 100644 --- a/src/drivers/win/tracer.cpp +++ b/src/drivers/win/tracer.cpp @@ -443,7 +443,7 @@ INT_PTR CALLBACK TracerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar EnableTracerMenuItems(); // subclass editfield - IDC_TRACER_LOG_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndDlg, IDC_TRACER_LOG), GWL_WNDPROC, (LONG)IDC_TRACER_LOG_WndProc); + IDC_TRACER_LOG_oldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TRACER_LOG), GWLP_WNDPROC, (LONG_PTR)IDC_TRACER_LOG_WndProc); break; } case WM_WINDOWPOSCHANGED: diff --git a/src/drivers/win/video.cpp b/src/drivers/win/video.cpp index 2230d9da..5e466e3b 100644 --- a/src/drivers/win/video.cpp +++ b/src/drivers/win/video.cpp @@ -1288,10 +1288,10 @@ INT_PTR CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP EnableWindow(GetDlgItem(hwndDlg, IDC_TVASPECT_Y), eoptions&EO_TVASPECT); EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC_SLASHTEXT), eoptions&EO_TVASPECT); - DefaultEditCtrlProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndDlg, IDC_WINSIZE_MUL_X), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_WINSIZE_MUL_Y), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_TVASPECT_X), GWL_WNDPROC, (LONG)FilterEditCtrlProc); - SetWindowLong(GetDlgItem(hwndDlg, IDC_TVASPECT_Y), GWL_WNDPROC, (LONG)FilterEditCtrlProc); + DefaultEditCtrlProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_WINSIZE_MUL_X), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_WINSIZE_MUL_Y), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TVASPECT_X), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TVASPECT_Y), GWLP_WNDPROC, (LONG_PTR)FilterEditCtrlProc); break; } diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index 0942dc16..8531fd6b 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -1037,7 +1037,7 @@ void HideFWindow(int h) SetWindowPos(hAppWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOREPOSITION | SWP_NOSIZE); } - SetWindowLong(hAppWnd, GWL_STYLE, desa | ( GetWindowLong(hAppWnd, GWL_STYLE) & WS_VISIBLE )); + SetWindowLongPtr(hAppWnd, GWL_STYLE, desa | ( GetWindowLong(hAppWnd, GWL_STYLE) & WS_VISIBLE )); SetWindowPos(hAppWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER); } @@ -3265,7 +3265,7 @@ POINT CalcSubWindowPos(HWND hDlg, POINT* conf) LRESULT APIENTRY FilterEditCtrlProc(HWND hwnd, UINT msg, WPARAM wP, LPARAM lP) { bool through = true; - LRESULT result = 0; + INT_PTR result = 0; switch (msg) { From 339ba7c923bf3bb9da548c63500d079c48955751 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Fri, 21 Jun 2019 15:47:52 -0400 Subject: [PATCH 3/6] SetWindowLongPtr needs to use LP defines, not L --- src/drivers/win/Win32InputBox.cpp | 4 ++-- src/drivers/win/ram_search.cpp | 2 +- src/drivers/win/ramwatch.cpp | 10 +++++----- src/drivers/win/taseditor/taseditor_window.cpp | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/drivers/win/Win32InputBox.cpp b/src/drivers/win/Win32InputBox.cpp index 34ebc496..3c4ce64d 100644 --- a/src/drivers/win/Win32InputBox.cpp +++ b/src/drivers/win/Win32InputBox.cpp @@ -312,14 +312,14 @@ void CWin32InputBox::InitDialog() // Message handler for about box. INT_PTR CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - CWin32InputBox *_this = (CWin32InputBox *) ::GetWindowLong(hDlg, GWL_USERDATA); + CWin32InputBox *_this = (CWin32InputBox *) ::GetWindowLongPtr(hDlg, GWLP_USERDATA); WIN32INPUTBOX_PARAM *param = _this ? _this->GetParam() : 0; switch (message) { case WM_INITDIALOG: { - ::SetWindowLongPtr(hDlg, GWL_USERDATA, lParam); + ::SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam); _this = (CWin32InputBox *) lParam; _this->_param->hDlg = hDlg; diff --git a/src/drivers/win/ram_search.cpp b/src/drivers/win/ram_search.cpp index 2921236f..77bf8f5a 100644 --- a/src/drivers/win/ram_search.cpp +++ b/src/drivers/win/ram_search.cpp @@ -1526,7 +1526,7 @@ INT_PTR CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara { case NM_CUSTOMDRAW: { - SetWindowLongPtr(hDlg, DWL_MSGRESULT, CustomDraw(lParam)); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, CustomDraw(lParam)); return TRUE; } diff --git a/src/drivers/win/ramwatch.cpp b/src/drivers/win/ramwatch.cpp index 897bb434..a29b92db 100644 --- a/src/drivers/win/ramwatch.cpp +++ b/src/drivers/win/ramwatch.cpp @@ -1180,7 +1180,7 @@ INT_PTR CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam // disable search by keyboard typing, // because it interferes with some of the accelerators // and it isn't very useful here anyway - SetWindowLongPtr(hDlg, DWL_MSGRESULT, ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST))); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST))); return 1; } case NM_SETFOCUS: @@ -1197,12 +1197,12 @@ INT_PTR CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam switch (nmcd->dwDrawStage) { case CDDS_PREPAINT: - SetWindowLongPtr(hDlg, DWL_MSGRESULT, CDRF_NOTIFYITEMDRAW); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, CDRF_NOTIFYITEMDRAW); break; case CDDS_ITEMPREPAINT: if (rswatches[nmcd->dwItemSpec].Type == 'S') // A separator looks very different from normal watches, it should be drawn in another space while I want to use the highlight bar and the focus frame from the system. - SetWindowLongPtr(hDlg, DWL_MSGRESULT, CDRF_NOTIFYPOSTPAINT); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, CDRF_NOTIFYPOSTPAINT); else { NMLVCUSTOMDRAW* lplvcd = (NMLVCUSTOMDRAW*)lParam; @@ -1210,7 +1210,7 @@ INT_PTR CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam { default: case 0: - SetWindowLongPtr(hDlg, DWL_MSGRESULT, CDRF_DODEFAULT); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, CDRF_DODEFAULT); return TRUE; case 1: lplvcd->clrTextBk = RGB(216, 203, 253); break; @@ -1222,7 +1222,7 @@ INT_PTR CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam lplvcd->clrTextBk = RGB(175, 94, 253); lplvcd->clrText = RGB(255, 255, 255); break; // use a more visual color in dark background } - SetWindowLongPtr(hDlg, DWL_MSGRESULT, CDRF_NEWFONT); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, CDRF_NEWFONT); } break; case CDDS_ITEMPOSTPAINT: diff --git a/src/drivers/win/taseditor/taseditor_window.cpp b/src/drivers/win/taseditor/taseditor_window.cpp index fc1cae31..6678641e 100644 --- a/src/drivers/win/taseditor/taseditor_window.cpp +++ b/src/drivers/win/taseditor/taseditor_window.cpp @@ -833,7 +833,7 @@ INT_PTR CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP switch(((LPNMHDR)lParam)->code) { case NM_CUSTOMDRAW: - SetWindowLongPtr(hWnd, DWL_MSGRESULT, pianoRoll.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, pianoRoll.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); return TRUE; case LVN_GETDISPINFO: pianoRoll.getDispInfo((NMLVDISPINFO*)lParam); @@ -854,7 +854,7 @@ INT_PTR CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP switch(((LPNMHDR)lParam)->code) { case NM_CUSTOMDRAW: - SetWindowLongPtr(hWnd, DWL_MSGRESULT, bookmarks.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, bookmarks.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); return TRUE; case LVN_GETDISPINFO: bookmarks.getDispInfo((NMLVDISPINFO*)lParam); @@ -865,7 +865,7 @@ INT_PTR CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP switch(((LPNMHDR)lParam)->code) { case NM_CUSTOMDRAW: - SetWindowLongPtr(hWnd, DWL_MSGRESULT, history.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, history.handleCustomDraw((NMLVCUSTOMDRAW*)lParam)); return TRUE; case LVN_GETDISPINFO: history.getDispInfo((NMLVDISPINFO*)lParam); From db175c358f9717ee54b1101ee2b17a138a8fa602 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Fri, 21 Jun 2019 15:51:44 -0400 Subject: [PATCH 4/6] cheat.cpp has one more DLGPROC BOOL return fix that I missed --- src/drivers/win/cheat.cpp | 4 ++-- src/drivers/win/cheat.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/win/cheat.cpp b/src/drivers/win/cheat.cpp index 5072bb3f..bdbf48cb 100644 --- a/src/drivers/win/cheat.cpp +++ b/src/drivers/win/cheat.cpp @@ -288,7 +288,7 @@ HWND InitializeCheatList(HWND hwnd) return hwndChtList; } -BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) @@ -1044,7 +1044,7 @@ void UpdateCheatsAdded() UpdateCheatListGroupBoxUI(); } -BOOL CALLBACK GGConvCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK GGConvCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { // int i; extern void GetUIGGInfo(HWND hwndDlg, uint32* a, uint8* v, int* c); diff --git a/src/drivers/win/cheat.h b/src/drivers/win/cheat.h index 28acc9e2..c83397a0 100644 --- a/src/drivers/win/cheat.h +++ b/src/drivers/win/cheat.h @@ -38,7 +38,7 @@ void SetupCheatFont(HWND hDlg); void DeleteCheatFont(); extern POINT CalcSubWindowPos(HWND hDlg, POINT* conf); -extern BOOL CALLBACK GGConvCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK GGConvCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); extern LRESULT APIENTRY FilterEditCtrlProc(HWND hDlg, UINT msg, WPARAM wP, LPARAM lP); extern WNDPROC DefaultEditCtrlProc; From 705f1c905c99035546d3ff39e96e7533ebb49bd3 Mon Sep 17 00:00:00 2001 From: g0me3 Date: Mon, 24 Jun 2019 15:52:06 +0300 Subject: [PATCH 5/6] KT-008 handling fix for FF Xn games. probably they are the same mapper with a set of different modes switching by specific bits (TODO, check the hardware: i have FFX games, but haven't any KT-008 games!) --- src/boards/mmc3.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/boards/mmc3.cpp b/src/boards/mmc3.cpp index 6a93ba92..e4f1a9e2 100644 --- a/src/boards/mmc3.cpp +++ b/src/boards/mmc3.cpp @@ -113,6 +113,9 @@ void MMC3RegReset(void) { DRegBuf[6] = 0; DRegBuf[7] = 1; +// KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support + kt_extra = 0; + FixMMC3PRG(0); FixMMC3CHR(0); } @@ -187,7 +190,14 @@ DECLFW(MMC3_IRQWrite) { DECLFW(KT008HackWrite) { // FCEU_printf("%04x:%04x\n",A,V); switch (A & 3) { - case 0: kt_extra = V; FixMMC3PRG(MMC3_cmd); break; + case 0: { + if (V == 0x27) // FF Xn hack! one more mapper in one + kt_extra = 0; + else + kt_extra = V; + FixMMC3PRG(MMC3_cmd); + break; + } case 1: break; // unk case 2: break; // unk case 3: break; // unk From 17e36e9882aef21a489147c56c74f935fa7c2772 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Thu, 27 Jun 2019 03:14:12 -0400 Subject: [PATCH 6/6] lua library table registration needs an extra stack clear (is overflowing) --- src/lua-engine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 424c9669..abb16779 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -6098,6 +6098,7 @@ int FCEU_LoadLuaCode(const char *filename, const char *arg) { luaL_register(L, "joypad", joypadlib); luaL_register(L, "zapper", zapperlib); luaL_register(L, "input", inputlib); + lua_settop(L, 0); // clean the stack, because each call to luaL_register leaves a table on top (eventually overflows) luaL_register(L, "savestate", savestatelib); luaL_register(L, "movie", movielib); luaL_register(L, "gui", guilib); @@ -6106,7 +6107,7 @@ int FCEU_LoadLuaCode(const char *filename, const char *arg) { luaL_register(L, "cdlog", cdloglib); luaL_register(L, "taseditor", taseditorlib); luaL_register(L, "bit", bit_funcs); // LuaBitOp library - lua_settop(L, 0); // clean the stack, because each call to luaL_register leaves a table on top + lua_settop(L, 0); // register a few utility functions outside of libraries (in the global namespace) lua_register(L, "print", print);