void COptionPluginPage::ShowAboutButton ( int id ) { CModifiedComboBox * ComboBox = NULL; for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++) { if ((int)(cb_iter->second->GetMenu()) != id) { continue; } ComboBox = cb_iter->second; break; } if (ComboBox == NULL) { return; } int index = ComboBox->GetCurSel(); if (index == CB_ERR) { return; } const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index); if (PluginPtr == NULL) { return; } const CPluginList::PLUGIN * Plugin = *PluginPtr; if (Plugin == NULL) { return; } //Load the plugin UINT LastErrorMode = SetErrorMode( SEM_FAILCRITICALERRORS ); HMODULE hLib = LoadLibrary(Plugin->FullPath); SetErrorMode(LastErrorMode); if (hLib == NULL) { return; } //Get DLL about void (__cdecl *DllAbout) ( HWND hWnd ); DllAbout = (void (__cdecl *)(HWND))GetProcAddress( hLib, "DllAbout" ); //call the function from the dll if (DllAbout != NULL) DllAbout(m_hWnd); FreeLibrary(hLib); }
BOOL CALLBACK DeleteItemProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_ACTIVATE: CheckDlgButton(hwndDlg, IDC_SYNC, SyncSpeed); CheckDlgButton(hwndDlg, IDC_REVERSE_STEREO, ReverseStereo); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: // if (!GetDlgItemText(hwndDlg, ID_ITEMNAME, // szItemName, 80)) // *szItemName=0; // Fall through. case IDCANCEL: EndDialog(hwndDlg, wParam); DestroyWindow(hWnd); hWnd = NULL; return TRUE; case IDC_ABOUT: DllAbout(hWnd); break; } break; case WM_NOTIFY: switch(LOWORD(wParam)) { case IDC_SYNC: if( SyncSpeed != ( SendDlgItemMessage( hwndDlg, IDC_SYNC, BM_GETCHECK, 0, 0) == BST_CHECKED)) { HANDLE hMutex = CreateMutex(NULL,FALSE,NULL); WaitForSingleObject (hMutex, INFINITE); SyncSpeed = ( SendDlgItemMessage( hwndDlg, IDC_SYNC, BM_GETCHECK, 0, 0) == BST_CHECKED); ResetSoundAtRuntime(); ReleaseMutex(hMutex); // REGISTRY_WriteDWORD( "AutoFullScreen", emuoptions.auto_full_screen); } break; case IDC_REVERSE_STEREO: if( ReverseStereo != ( SendDlgItemMessage( hwndDlg, IDC_REVERSE_STEREO, BM_GETCHECK, 0, 0) == BST_CHECKED)) { HANDLE hMutex = CreateMutex(NULL,FALSE,NULL); WaitForSingleObject (hMutex, INFINITE); ReverseStereo = ( SendDlgItemMessage( hwndDlg, IDC_REVERSE_STEREO, BM_GETCHECK, 0, 0) == BST_CHECKED); ReleaseMutex(hMutex); // REGISTRY_WriteDWORD( "AutoFullScreen", emuoptions.auto_full_screen); } break; } break; } return FALSE; }