int SFactdCreate() { if (bShotsFactory) { return 1; } bShotsFactory = 1; bOldPause = bRunPause; bRunPause = 1; audio.blank(); hSFactdlg = FBACreateDialog(IDD_CAPTURE, hScrnWnd, (DLGPROC)SShotDialogProc); if (hSFactdlg == NULL) { return 1; } dialogAdd(IDD_CAPTURE, hSFactdlg); wndInMid(hSFactdlg, hScrnWnd); ShowWindow(hSFactdlg, SW_NORMAL); SFactdUpdate(); return 0; }
static INT_PTR CALLBACK prefMiscDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { case WM_INITDIALOG: wndInMid(hDlg, hScrnWnd); SetFocus(hDlg); hMiscDlg = hDlg; // init controls miscOptionInit(); miscSliderInit(); miscComboboxInit(); return TRUE; case WM_COMMAND: { int Id = LOWORD(wParam); int Notify = HIWORD(wParam); if ((Id == IDOK && Notify == BN_CLICKED) || (Id == IDCANCEL && Notify == BN_CLICKED)) { SendMessage(hDlg, WM_CLOSE, 0, 0); return 0; } if ((HWND)lParam == GetDlgItem(hDlg, IDC_PREF_AUDIOOUTPUT)) { if (Notify == CBN_SELCHANGE) { } } } break; case WM_HSCROLL: switch (LOWORD(wParam)) { case TB_BOTTOM: case TB_ENDTRACK: case TB_LINEDOWN: case TB_LINEUP: case TB_PAGEDOWN: case TB_PAGEUP: case TB_THUMBPOSITION: case TB_THUMBTRACK: case TB_TOP: { TCHAR szText[16]; int priority = SendDlgItemMessage(hDlg, IDC_PREF_THREADPRIORITY, TBM_GETPOS, 0, 0); _sntprintf(szText, sizearray(szText), _T("%d"), priority); SetDlgItemText(hDlg, IDC_PREF_THREADPRIORITY_TEXT, szText); break; } } break; case WM_NOTIFY: { switch (((NMHDR *)lParam)->code) { case PSN_APPLY: prefMiscExit(); break; } } break; case WM_CLOSE: prefMiscExit(); EndDialog(hDlg, 0); hMiscDlg = NULL; break; } return 0; }
static INT_PTR CALLBACK prefAudioDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { case WM_INITDIALOG: wndInMid(hDlg, hScrnWnd); SetFocus(hDlg); hAudioDlg = hDlg; // init controls audioOutputInit(); audioDeviceInit(); audioSampleInit(); audioOptionInit(); audioFrameInit(); return TRUE; case WM_COMMAND: { int Id = LOWORD(wParam); int Notify = HIWORD(wParam); if ((Id == IDOK && Notify == BN_CLICKED) || (Id == IDCANCEL && Notify == BN_CLICKED)) { SendMessage(hDlg, WM_CLOSE, 0, 0); return 0; } if ((HWND)lParam == GetDlgItem(hDlg, IDC_PREF_AUDIOOUTPUT)) { if (Notify == CBN_SELCHANGE) { audioOutputChange(); } } } break; case WM_HSCROLL: switch (LOWORD(wParam)) { case TB_BOTTOM: case TB_ENDTRACK: case TB_LINEDOWN: case TB_LINEUP: case TB_PAGEDOWN: case TB_PAGEUP: case TB_THUMBPOSITION: case TB_THUMBTRACK: case TB_TOP: { TCHAR szText[MAX_PATH]; int frame = SendDlgItemMessage(hDlg, IDC_PREF_AUDFRAME, TBM_GETPOS, 0, 0); _sntprintf(szText, sizearray(szText), FBALoadStringEx(IDS_NUMDLG_FRAME), frame, int(1000.0 * (frame - 1.0) / 60)); SetDlgItemText(hDlg, IDC_PREF_AUDFRAME_TEXT, szText); break; } } break; case WM_NOTIFY: { switch (((NMHDR *)lParam)->code) { case PSN_APPLY: prefAudioExit(); break; } } break; case WM_CLOSE: prefAudioExit(); EndDialog(hDlg, 0); hAudioDlg = NULL; break; } return 0; }
static INT_PTR CALLBACK prefVideoDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { case WM_INITDIALOG: wndInMid(hDlg, hScrnWnd); SetFocus(hDlg); hVideoDlg = hDlg; // init controls videoModeInit(); dispApapterInit(); fullResInit(); videoOptionInit(); return TRUE; case WM_COMMAND: { int Id = LOWORD(wParam); int Notify = HIWORD(wParam); if ((Id == IDOK && Notify == BN_CLICKED) || (Id == IDCANCEL && Notify == BN_CLICKED)) { SendMessage(hDlg, WM_CLOSE, 0, 0); return 0; } else if (Id == IDC_PREF_SETPROJECTION && Notify == BN_CLICKED) { screenAngleDialog(hDlg); return 0; } else if (Id == IDC_PREF_SETCOLOR && Notify == BN_CLICKED) { colorAdjustDialog(hDlg); return 0; } else if (Id == IDC_PREF_CUSTOMMONITORASPECT && Notify == BN_CLICKED) { aspectSetDialog(hDlg); return 0; } else if (Id == IDC_PREF_AUTOMONITORASPECT && Notify == BN_CLICKED) { BOOL checked = (BST_CHECKED == IsDlgButtonChecked(hDlg, Id)); EnableWindow(GetDlgItem(hDlg, IDC_PREF_CUSTOMMONITORASPECT), !checked); return 0; } else if (Id == IDC_PREF_3DPROJECTION && Notify == BN_CLICKED) { BOOL checked = (BST_CHECKED == IsDlgButtonChecked(hDlg, Id)); EnableWindow(GetDlgItem(hDlg, IDC_PREF_SETPROJECTION), checked); return 0; } else if (Id == IDC_PREF_COLOR_ADJUST && Notify == BN_CLICKED) { BOOL checked = (BST_CHECKED == IsDlgButtonChecked(hDlg, Id)); EnableWindow(GetDlgItem(hDlg, IDC_PREF_SETCOLOR), checked); return 0; } if (Notify == CBN_SELCHANGE) { if ((HWND)lParam == GetDlgItem(hDlg, IDC_PREF_VIDEOMODE)) { int mode = SendDlgItemMessage(hDlg, IDC_PREF_VIDEOMODE, CB_GETCURSEL, 0, 0); enableVideoOptions(mode); } else if ((HWND)lParam == GetDlgItem(hDlg, IDC_PREF_DISPADAPTER)) { // reinit fullscreen resolution if adapter changed nVidAdapter = SendDlgItemMessage(hDlg, IDC_PREF_DISPADAPTER, CB_GETCURSEL, 0, 0); fullResInit(); } } } break; case WM_NOTIFY: { switch (((NMHDR *)lParam)->code) { case PSN_APPLY: prefVideoExit(); break; } } break; case WM_CLOSE: prefVideoExit(); EndDialog(hDlg, 0); hVideoDlg = NULL; break; } return 0; }
static INT_PTR CALLBACK IPSDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { case WM_INITDIALOG: { hIpsDlg = hDlg; hIpsList = GetDlgItem(hIpsDlg, IDC_IPSTREE1); hWhiteBGBrush = CreateSolidBrush(RGB(0xFF,0xFF,0xFF)); hDefPreview = LoadBitmap(hAppInst, MAKEINTRESOURCE(BMP_PREVIEW)); DWORD dwStyle = (DWORD) GetWindowLongPtr(hIpsList, GWL_STYLE); dwStyle |= TVS_CHECKBOXES; SetWindowLongPtr(hIpsList, GWL_STYLE, (LONG_PTR) dwStyle); patchSettingInit(); initPatchPreviewPos(); wndInMid(hDlg, hScrnWnd); SetFocus(hDlg); // Enable Esc=close break; } case WM_COMMAND: { int wID = LOWORD(wParam); int Notify = HIWORD(wParam); if (Notify == BN_CLICKED) { switch (wID) { case IDOK: { ipsOkay(); break; } case IDCANCEL: { SendMessage(hDlg, WM_CLOSE, 0, 0); return 0; } case IDC_IPSCLEAR: { clearPatches(); break; } case IDC_IPS_ENFORCE: { bEnforceDep = !bEnforceDep; break; } } } if (wID == IDC_IPS_LANG && Notify == CBN_SELCHANGE) { nPatchLang = SendDlgItemMessage(hIpsDlg, IDC_IPS_LANG, CB_GETCURSEL, 0, 0); TreeView_DeleteAllItems(hIpsList); // rebuild ips list rebuildIpsList(); return 0; } break; } case WM_NOTIFY: { NMHDR* pNmHdr = (NMHDR*)lParam; if (LOWORD(wParam) == IDC_IPSTREE1 && pNmHdr->code == TVN_SELCHANGED) { refreshPatch(); return 1; } if (LOWORD(wParam) == IDC_IPSTREE1 && pNmHdr->code == NM_DBLCLK) { // disable double-click node-expand SetWindowLongPtr(hIpsDlg, DWLP_MSGRESULT, 1); return 1; } if (LOWORD(wParam) == IDC_IPSTREE1 && pNmHdr->code == NM_CLICK) { POINT cursorPos; GetCursorPos(&cursorPos); ScreenToClient(hIpsList, &cursorPos); TVHITTESTINFO thi; thi.pt = cursorPos; TreeView_HitTest(hIpsList, &thi); if (thi.flags == TVHT_ONITEMSTATEICON) { TreeView_SelectItem(hIpsList, thi.hItem); // check state and get patch index int id = checkPatchState(thi.hItem); // apply patch relations applyRelations(id); } return 1; } SetWindowLongPtr(hIpsDlg, DWLP_MSGRESULT, CDRF_DODEFAULT); return 1; } case WM_CTLCOLORSTATIC: if ((HWND)lParam == GetDlgItem(hIpsDlg, IDC_TEXTCOMMENT)) { return (BOOL)hWhiteBGBrush; } break; case WM_CLOSE: patchSettingExit(); break; } return 0; }