From 3b758a68867137c8ad0c1a8c55ecd8bf5b9e3502 Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:07:06 -0600 Subject: [PATCH 01/13] Trying a thing to clear this error --- Win32/scenedit/dlogtool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Win32/scenedit/dlogtool.cpp b/Win32/scenedit/dlogtool.cpp index 38ca69ac..90634360 100644 --- a/Win32/scenedit/dlogtool.cpp +++ b/Win32/scenedit/dlogtool.cpp @@ -506,8 +506,8 @@ BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM store_edit_parent[l] = dlgs[free_slot]; store_edit_parent_num[l] = store_dlog_num; store_edit_item[l] = i; - old_edit_proc[l] = (FARPROC) GetWindowLong(edit_box[l],GWL_WNDPROC); - SetWindowLong(edit_box[l],GWL_WNDPROC,(LONG) edit_proc); + old_edit_proc[l] = (FARPROC) GetWindowLongPtr(edit_box[l],GWL_WNDPROC); + SetWindowLongPtr(edit_box[l],GWL_WNDPROC,(LONG_PTR) edit_proc); if (focus_set == FALSE) { SetFocus(edit_box[l]); From 1963b56163582ae36eee495805553d9873908419 Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:10:22 -0600 Subject: [PATCH 02/13] change to GWLP --- Win32/scenedit/dlogtool.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Win32/scenedit/dlogtool.cpp b/Win32/scenedit/dlogtool.cpp index 90634360..91e1e406 100644 --- a/Win32/scenedit/dlogtool.cpp +++ b/Win32/scenedit/dlogtool.cpp @@ -148,7 +148,7 @@ short button_ul_y[15] = {0,0,132,23,46, 69,46,69,36,36, 36,23,92,92,0}; short button_width[15] = {23,63,102,16,63, 63,63,63,6,14, 14,63,63,63,30}; short button_height[15] = {23,23,23,13,23, 23,23,23,6,10,10,23,40,40,30}; -BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wparam, LPARAM lparam); +LRESULT CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wparam, LPARAM lparam); long CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); FARPROC d_proc; @@ -301,7 +301,7 @@ short cd_create_dialog(short dlog_num,HWND parent) return 0; } -BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { short i,j,k,l,free_slot = -1,free_item = -1,type,flag; char item_str[256]; @@ -506,8 +506,8 @@ BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM store_edit_parent[l] = dlgs[free_slot]; store_edit_parent_num[l] = store_dlog_num; store_edit_item[l] = i; - old_edit_proc[l] = (FARPROC) GetWindowLongPtr(edit_box[l],GWL_WNDPROC); - SetWindowLongPtr(edit_box[l],GWL_WNDPROC,(LONG_PTR) edit_proc); + old_edit_proc[l] = (FARPROC) GetWindowLongPtr(edit_box[l],GWLP_WNDPROC); + SetWindowLongPtr(edit_box[l],GWLP_WNDPROC,(LONG_PTR) edit_proc); if (focus_set == FALSE) { SetFocus(edit_box[l]); From fbf03b952e3dcc15c8e09452f959eece10915f7b Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:13:56 -0600 Subject: [PATCH 03/13] Fix WndProc --- Win32/scenedit/blscened.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Win32/scenedit/blscened.cpp b/Win32/scenedit/blscened.cpp index c89b008c..ec2bff73 100644 --- a/Win32/scenedit/blscened.cpp +++ b/Win32/scenedit/blscened.cpp @@ -125,7 +125,7 @@ Boolean block_erase = FALSE; RECT windRect; -long CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); Boolean handle_menu (short, HMENU); int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR, int nCmdShow) @@ -253,7 +253,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR, int nCmd return msg.wParam; } -long CALLBACK WndProc (HWND hwnd, UINT message,WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK WndProc (HWND hwnd, UINT message,WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; //RECT s_rect = {0,0,30,30},d_rect = {0,0,30,30},d2 = {0,0,420,216},s2 = {0,0,420,216}; From d22b3ea1e7a70aa46c1e0457a6379bace519ddc2 Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:18:42 -0600 Subject: [PATCH 04/13] update fresh_edit_proc --- Win32/scenedit/dlogtool.cpp | 2 +- Win32/scenedit/dlogtool.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Win32/scenedit/dlogtool.cpp b/Win32/scenedit/dlogtool.cpp index 91e1e406..61bc5d21 100644 --- a/Win32/scenedit/dlogtool.cpp +++ b/Win32/scenedit/dlogtool.cpp @@ -182,7 +182,7 @@ void cd_init_dialogs() edit_proc = (FARPROC) fresh_edit_proc; } -long CALLBACK fresh_edit_proc(HWND hwnd, UINT message, UINT wParam, LONG lParam) +LRESULT CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { short i,cur_box = -1,cur_item_num,item_for_focus = -1,first_edit_box = -1; diff --git a/Win32/scenedit/dlogtool.h b/Win32/scenedit/dlogtool.h index 97fc861d..3c2a2dba 100644 --- a/Win32/scenedit/dlogtool.h +++ b/Win32/scenedit/dlogtool.h @@ -44,7 +44,9 @@ void center_window(HWND window); RECT get_item_rect(HWND hDlg, short item_num); void frame_dlog_rect(HWND hDlg, RECT rect, short val); void draw_dialog_graphic(HWND hDlg, RECT rect, short which_g, Boolean do_frame,short win_or_gworld) ; -void showcursor(Boolean a); +void showcursor(Boolean a); + +LRESULT CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); void cd_get_text_edit_str(short dlog_num, char *str); void cdsin(short dlog_num, short item_num, short num); From 5f51721fcd8044fc79d85f9b507dad4c2f79aab3 Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:20:50 -0600 Subject: [PATCH 05/13] remove old declaration from cpp file --- Win32/scenedit/dlogtool.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Win32/scenedit/dlogtool.cpp b/Win32/scenedit/dlogtool.cpp index 61bc5d21..5dd98e2d 100644 --- a/Win32/scenedit/dlogtool.cpp +++ b/Win32/scenedit/dlogtool.cpp @@ -149,7 +149,6 @@ short button_width[15] = {23,63,102,16,63, 63,63,63,6,14, 14,63,63,63,30}; short button_height[15] = {23,23,23,13,23, 23,23,23,6,10,10,23,40,40,30}; LRESULT CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wparam, LPARAM lparam); -long CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); FARPROC d_proc; From 1f566694ef4d0c142d68c0cb970014bcc11593ce Mon Sep 17 00:00:00 2001 From: Sylae Jiendra Corell Date: Fri, 1 Aug 2014 11:25:04 -0600 Subject: [PATCH 06/13] Move declaration out of the header file --- Win32/scenedit/dlogtool.cpp | 1 + Win32/scenedit/dlogtool.h | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Win32/scenedit/dlogtool.cpp b/Win32/scenedit/dlogtool.cpp index 5dd98e2d..75bb1ffa 100644 --- a/Win32/scenedit/dlogtool.cpp +++ b/Win32/scenedit/dlogtool.cpp @@ -149,6 +149,7 @@ short button_width[15] = {23,63,102,16,63, 63,63,63,6,14, 14,63,63,63,30}; short button_height[15] = {23,23,23,13,23, 23,23,23,6,10,10,23,40,40,30}; LRESULT CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wparam, LPARAM lparam); +LRESULT CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); FARPROC d_proc; diff --git a/Win32/scenedit/dlogtool.h b/Win32/scenedit/dlogtool.h index 3c2a2dba..2ae72306 100644 --- a/Win32/scenedit/dlogtool.h +++ b/Win32/scenedit/dlogtool.h @@ -19,7 +19,7 @@ short cd_process_syskeystroke(HWND window,WPARAM wparam, LPARAM lparam,short *it short cd_process_keystroke(HWND window,WPARAM wparam, LPARAM lparam,short *item); void cd_attach_key(short dlog_num,short item_num,char key); -void cd_set_pict(short dlog_num, short item_num, short pict_num, short custom_pic_type); +void cd_set_pict(short dlog_num, short item_num, short pict_num, short custom_pic_type); void cd_activate_item(short dlog_num, short item_num, short status); void cd_get_item_text(short dlog_num, short item_num, char *str); void cd_set_item_text(short dlog_num, short item_num, char const *str); @@ -44,14 +44,12 @@ void center_window(HWND window); RECT get_item_rect(HWND hDlg, short item_num); void frame_dlog_rect(HWND hDlg, RECT rect, short val); void draw_dialog_graphic(HWND hDlg, RECT rect, short which_g, Boolean do_frame,short win_or_gworld) ; -void showcursor(Boolean a); - -LRESULT CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); +void showcursor(Boolean a); void cd_get_text_edit_str(short dlog_num, char *str); void cdsin(short dlog_num, short item_num, short num); void csit(short dlog_num, short item_num, char const *str); -void csp(short dlog_num, short item_num, short pict_num, short custom_pic_type); +void csp(short dlog_num, short item_num, short pict_num, short custom_pic_type); void ModalDialog(); RECT calc_rect(short i, short j); From 4330f63aad7df70ce4852fd9e7f7f7beb71224a3 Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:27:34 -0600 Subject: [PATCH 07/13] Chared now: Change the WndProc return type --- Win32/charedit/bladpced.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Win32/charedit/bladpced.cpp b/Win32/charedit/bladpced.cpp index da2eabb6..d25d4924 100644 --- a/Win32/charedit/bladpced.cpp +++ b/Win32/charedit/bladpced.cpp @@ -137,7 +137,7 @@ char file_path_name[256]; Boolean block_erase = FALSE; -long CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); Boolean handle_menu (short, HMENU); int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR, int nCmdShow) @@ -239,7 +239,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR, int nCm return msg.wParam; } -long CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { HDC hdc; PAINTSTRUCT ps; From 3602a6748c30406186740c85caef7ef0234d6dec Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:31:35 -0600 Subject: [PATCH 08/13] GWLP for the CharEd --- Win32/charedit/dlogtool.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Win32/charedit/dlogtool.cpp b/Win32/charedit/dlogtool.cpp index 72f07838..5e54e824 100644 --- a/Win32/charedit/dlogtool.cpp +++ b/Win32/charedit/dlogtool.cpp @@ -185,7 +185,7 @@ void cd_init_dialogs() edit_proc = fresh_edit_proc; } -long CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { @@ -475,8 +475,8 @@ BOOL CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM, LPARAM) std::max(22,item_rect[free_item].bottom - item_rect[free_item].top), dlgs[free_slot],(HMENU) 150,store_hInstance,NULL); store_edit_parent = dlgs[free_slot]; - old_edit_proc = (WNDPROC) GetWindowLong(edit_box,GWL_WNDPROC); - SetWindowLong(edit_box,GWL_WNDPROC,(LONG) edit_proc); + old_edit_proc = (WNDPROC) GetWindowLongPtr(edit_box,GWLP_WNDPROC); + SetWindowLongPtr(edit_box,GWLP_WNDPROC,(LRESULT) edit_proc); break; } win_height = std::max(win_height, item_rect[free_item].bottom + 35); From f9cf0ec5d00a1f68ccbc1721db398827dfda02e3 Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:51:04 -0600 Subject: [PATCH 09/13] YAY TRIDASH --- Win32/charedit/dlogtool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Win32/charedit/dlogtool.cpp b/Win32/charedit/dlogtool.cpp index 5e54e824..0e484925 100644 --- a/Win32/charedit/dlogtool.cpp +++ b/Win32/charedit/dlogtool.cpp @@ -157,7 +157,7 @@ short button_ul_y[15] = {0,0,132,23,46, 69,46,69,36,36, 36,23,92,92,0}; short button_width[15] = {23,63,102,16,63, 63,63,63,6,14, 14,63,63,63,30}; short button_height[15] = {23,23,23,13,23, 23,23,23,6,10,10,23,40,40,30}; -BOOL CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); DLGPROC d_proc; From 25109681038580d7a3c5a7380ad7d50451ffe999 Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:51:59 -0600 Subject: [PATCH 10/13] forgot to change the other bit too --- Win32/charedit/dlogtool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Win32/charedit/dlogtool.cpp b/Win32/charedit/dlogtool.cpp index 0e484925..f1d8f252 100644 --- a/Win32/charedit/dlogtool.cpp +++ b/Win32/charedit/dlogtool.cpp @@ -284,7 +284,7 @@ short cd_create_dialog(short dlog_num,HWND parent) return 0; } -BOOL CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM, LPARAM) +INT_PTR CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM, LPARAM) { short i,j,k,free_slot = -1,free_item = -1; int type,flag; From 3a014c4feea7a8c57c9a6e1781650d7245738e58 Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:57:39 -0600 Subject: [PATCH 11/13] make the definition use *PARAMs --- Win32/charedit/bladpced.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Win32/charedit/bladpced.cpp b/Win32/charedit/bladpced.cpp index d25d4924..d86d921d 100644 --- a/Win32/charedit/bladpced.cpp +++ b/Win32/charedit/bladpced.cpp @@ -27,7 +27,7 @@ void cursor_stay(); Boolean verify_restore_quit(short mode); void max_window(HWND window); void update_item_menu(short mode); -void check_cd_event(HWND hwnd,UINT message,UINT wparam,LONG lparam); +void check_cd_event(HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam); scen_item_data_type scen_item_list; short item_menus_lock=1; From d7c4451ec8c3d7631321d70c0ac0e4144c1b06c3 Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 11:59:23 -0600 Subject: [PATCH 12/13] more LPARAMs and WPARAMs --- Win32/charedit/dlogtool.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Win32/charedit/dlogtool.h b/Win32/charedit/dlogtool.h index 1e73e689..ec3800ae 100644 --- a/Win32/charedit/dlogtool.h +++ b/Win32/charedit/dlogtool.h @@ -10,9 +10,9 @@ void cd_set_edit_focus(); void cd_init_dialogs(); short cd_create_dialog(short dlog_num,HWND parent) ; short cd_kill_dialog(short dlog_num,short parent_message); -short cd_process_click(HWND window,POINT the_point, UINT wparam, LONG lparam,short *item); -short cd_process_syskeystroke(HWND window,UINT wparam, LONG lparam,short *item); -short cd_process_keystroke(HWND window,UINT wparam, LONG lparam,short *item); +short cd_process_click(HWND window,POINT the_point, WPARAM wparam, LPARAM lparam,short *item); +short cd_process_syskeystroke(HWND window,WPARAM wparam, LPARAM lparam,short *item); +short cd_process_keystroke(HWND window,UINT wparam, LPARAM lparam,short *item); void cd_init_button(short dlog_num,short item_num, short button_num, short status); void cd_attach_key(short dlog_num,short item_num,char key); void cd_set_pict(short dlog_num, short item_num, short pict_num); @@ -44,7 +44,7 @@ void showcursor(Boolean a); void cd_get_text_edit_str(short dlog_num, char *str); void cd_set_text_edit_str(short dlog_num, char *str); -void cdsin(short dlog_num, short item_num, short num); +void cdsin(short dlog_num, short item_num, short num); void csit(short dlog_num, short item_num, char *str); void csp(short dlog_num, short item_num, short pict_num); void ModalDialog(); From b4757eb2eb2499e09f35defc134d88567b8ef16b Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Fri, 1 Aug 2014 12:00:28 -0600 Subject: [PATCH 13/13] Missed one :( --- Win32/charedit/dlogtool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Win32/charedit/dlogtool.h b/Win32/charedit/dlogtool.h index ec3800ae..abc8f962 100644 --- a/Win32/charedit/dlogtool.h +++ b/Win32/charedit/dlogtool.h @@ -12,7 +12,7 @@ short cd_create_dialog(short dlog_num,HWND parent) ; short cd_kill_dialog(short dlog_num,short parent_message); short cd_process_click(HWND window,POINT the_point, WPARAM wparam, LPARAM lparam,short *item); short cd_process_syskeystroke(HWND window,WPARAM wparam, LPARAM lparam,short *item); -short cd_process_keystroke(HWND window,UINT wparam, LPARAM lparam,short *item); +short cd_process_keystroke(HWND window,WPARAM wparam, LPARAM lparam,short *item); void cd_init_button(short dlog_num,short item_num, short button_num, short status); void cd_attach_key(short dlog_num,short item_num,char key); void cd_set_pict(short dlog_num, short item_num, short pict_num);