|
|
| version 1.3, 2003/11/12 15:35:17 | version 1.6, 2011/02/15 00:51:51 |
|---|---|
| Line 14 | Line 14 |
| #include "dialogs.h" | #include "dialogs.h" |
| static const char str_scropt[] = "Screen option"; | static const TCHAR str_scropt[] = _T("Screen option"); |
| static LRESULT CALLBACK Scropt1DlgProc(HWND hWnd, UINT msg, | static LRESULT CALLBACK Scropt1DlgProc(HWND hWnd, UINT msg, |
| WPARAM wp, LPARAM lp) { | WPARAM wp, LPARAM lp) { |
| char work[32]; | TCHAR work[32]; |
| WORD ret; | UINT16 ret; |
| BYTE b; | UINT8 b; |
| int renewal; | int renewal; |
| switch(msg) { | switch(msg) { |
| Line 40 static LRESULT CALLBACK Scropt1DlgProc(H | Line 40 static LRESULT CALLBACK Scropt1DlgProc(H |
| return(TRUE); | return(TRUE); |
| case WM_COMMAND: | case WM_COMMAND: |
| switch (LOWORD(wp)) { | switch(LOWORD(wp)) { |
| case IDC_LCD: | case IDC_LCD: |
| EnableWindow(GetDlgItem(hWnd, IDC_LCDX), | EnableWindow(GetDlgItem(hWnd, IDC_LCDX), |
| GetDlgItemCheck(hWnd, IDC_LCD)); | GetDlgItemCheck(hWnd, IDC_LCD)); |
| Line 51 static LRESULT CALLBACK Scropt1DlgProc(H | Line 51 static LRESULT CALLBACK Scropt1DlgProc(H |
| case WM_HSCROLL: | case WM_HSCROLL: |
| switch(GetDlgCtrlID((HWND)lp)) { | switch(GetDlgCtrlID((HWND)lp)) { |
| case IDC_SKIPLIGHT: | case IDC_SKIPLIGHT: |
| ret = (WORD)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, | ret = (UINT16)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, |
| TBM_GETPOS, 0, 0); | TBM_GETPOS, 0, 0); |
| wsprintf(work, str_d, ret); | wsprintf(work, str_d, ret); |
| SetDlgItemText(hWnd, IDC_LIGHTSTR, work); | SetDlgItemText(hWnd, IDC_LIGHTSTR, work); |
| Line 60 static LRESULT CALLBACK Scropt1DlgProc(H | Line 60 static LRESULT CALLBACK Scropt1DlgProc(H |
| break; | break; |
| case WM_NOTIFY: | case WM_NOTIFY: |
| if ((((NMHDR *)lp)->code) == PSN_APPLY) { | if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { |
| renewal = 0; | renewal = 0; |
| b = GetDlgItemCheck(hWnd, IDC_SKIPLINE); | b = GetDlgItemCheck(hWnd, IDC_SKIPLINE); |
| if (np2cfg.skipline != b) { | if (np2cfg.skipline != b) { |
| np2cfg.skipline = b; | np2cfg.skipline = b; |
| renewal = 1; | renewal = 1; |
| } | } |
| if ((ret = (WORD)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, | ret = (UINT16)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, |
| TBM_GETPOS, 0, 0)) > 255) { | TBM_GETPOS, 0, 0); |
| if (ret > 255) { | |
| ret = 255; | ret = 255; |
| } | } |
| if (np2cfg.skiplight != ret) { | if (np2cfg.skiplight != ret) { |
| Line 101 static const int gdcchip[4] = {IDC_GRCGN | Line 102 static const int gdcchip[4] = {IDC_GRCGN |
| static LRESULT CALLBACK Scropt2DlgProc(HWND hWnd, UINT msg, | static LRESULT CALLBACK Scropt2DlgProc(HWND hWnd, UINT msg, |
| WPARAM wp, LPARAM lp) { | WPARAM wp, LPARAM lp) { |
| BYTE b; | UINT8 b; |
| UINT update; | UINT update; |
| switch(msg) { | switch(msg) { |
| Line 117 static LRESULT CALLBACK Scropt2DlgProc(H | Line 118 static LRESULT CALLBACK Scropt2DlgProc(H |
| return(TRUE); | return(TRUE); |
| case WM_NOTIFY: | case WM_NOTIFY: |
| if ((((NMHDR *)lp)->code) == PSN_APPLY) { | if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { |
| update = 0; | update = 0; |
| b = GetDlgItemCheck(hWnd, IDC_GDC72020); | b = GetDlgItemCheck(hWnd, IDC_GDC72020); |
| if (np2cfg.uPD72020 != b) { | if (np2cfg.uPD72020 != b) { |
| Line 148 static LRESULT CALLBACK Scropt2DlgProc(H | Line 149 static LRESULT CALLBACK Scropt2DlgProc(H |
| static LRESULT CALLBACK Scropt3DlgProc(HWND hWnd, UINT msg, | static LRESULT CALLBACK Scropt3DlgProc(HWND hWnd, UINT msg, |
| WPARAM wp, LPARAM lp) { | WPARAM wp, LPARAM lp) { |
| char work[32]; | TCHAR work[32]; |
| BYTE value[6]; | UINT8 value[6]; |
| BYTE b; | UINT8 b; |
| UINT update; | UINT update; |
| switch(msg) { | switch(msg) { |
| Line 186 static LRESULT CALLBACK Scropt3DlgProc(H | Line 187 static LRESULT CALLBACK Scropt3DlgProc(H |
| case WM_HSCROLL: | case WM_HSCROLL: |
| switch(GetDlgCtrlID((HWND)lp)) { | switch(GetDlgCtrlID((HWND)lp)) { |
| case IDC_TRAMWAIT: | case IDC_TRAMWAIT: |
| b = (BYTE)SendDlgItemMessage(hWnd, IDC_TRAMWAIT, | b = (UINT8)SendDlgItemMessage(hWnd, IDC_TRAMWAIT, |
| TBM_GETPOS, 0, 0); | TBM_GETPOS, 0, 0); |
| wsprintf(work, str_u, b); | wsprintf(work, str_u, b); |
| SetDlgItemText(hWnd, IDC_TRAMSTR, work); | SetDlgItemText(hWnd, IDC_TRAMSTR, work); |
| break; | break; |
| case IDC_VRAMWAIT: | case IDC_VRAMWAIT: |
| b = (BYTE)SendDlgItemMessage(hWnd, IDC_VRAMWAIT, | b = (UINT8)SendDlgItemMessage(hWnd, IDC_VRAMWAIT, |
| TBM_GETPOS, 0, 0); | TBM_GETPOS, 0, 0); |
| wsprintf(work, str_u, b); | wsprintf(work, str_u, b); |
| SetDlgItemText(hWnd, IDC_VRAMSTR, work); | SetDlgItemText(hWnd, IDC_VRAMSTR, work); |
| break; | break; |
| case IDC_GRCGWAIT: | case IDC_GRCGWAIT: |
| b = (BYTE)SendDlgItemMessage(hWnd, IDC_GRCGWAIT, | b = (UINT8)SendDlgItemMessage(hWnd, IDC_GRCGWAIT, |
| TBM_GETPOS, 0, 0); | TBM_GETPOS, 0, 0); |
| wsprintf(work, str_u, b); | wsprintf(work, str_u, b); |
| SetDlgItemText(hWnd, IDC_GRCGSTR, work); | SetDlgItemText(hWnd, IDC_GRCGSTR, work); |
| break; | break; |
| case IDC_REALPAL: | case IDC_REALPAL: |
| b = (BYTE)SendDlgItemMessage(hWnd, IDC_REALPAL, | b = (UINT8)SendDlgItemMessage(hWnd, IDC_REALPAL, |
| TBM_GETPOS, 0, 0); | TBM_GETPOS, 0, 0); |
| wsprintf(work, str_d, (int)b - 32); | wsprintf(work, str_d, (int)b - 32); |
| SetDlgItemText(hWnd, IDC_REALPALSTR, work); | SetDlgItemText(hWnd, IDC_REALPALSTR, work); |
| Line 212 static LRESULT CALLBACK Scropt3DlgProc(H | Line 213 static LRESULT CALLBACK Scropt3DlgProc(H |
| break; | break; |
| case WM_NOTIFY: | case WM_NOTIFY: |
| if ((((NMHDR *)lp)->code) == PSN_APPLY) { | if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { |
| update = 0; | update = 0; |
| ZeroMemory(value, sizeof(value)); | ZeroMemory(value, sizeof(value)); |
| value[0] = (BYTE)SendDlgItemMessage(hWnd, IDC_TRAMWAIT, | value[0] = (BYTE)SendDlgItemMessage(hWnd, IDC_TRAMWAIT, |
| Line 257 void dialog_scropt(HWND hWnd) { | Line 258 void dialog_scropt(HWND hWnd) { |
| PROPSHEETHEADER psh; | PROPSHEETHEADER psh; |
| HPROPSHEETPAGE hpsp[3]; | HPROPSHEETPAGE hpsp[3]; |
| hinst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); | #if defined(_WIN64) |
| hinst = reinterpret_cast<HINSTANCE>(::GetWindowLongPtr(hWnd, GWLP_HINSTANCE)); | |
| #else | |
| hinst = reinterpret_cast<HINSTANCE>(::GetWindowLong(hWnd, GWL_HINSTANCE)); | |
| #endif | |
| ZeroMemory(&psp, sizeof(psp)); | ZeroMemory(&psp, sizeof(psp)); |
| psp.dwSize = sizeof(PROPSHEETPAGE); | psp.dwSize = sizeof(PROPSHEETPAGE); |