void MainWnd::OnOptionsVideoFullscreen() { theApp.winCheckFullscreen(); GUID *pGUID = NULL; int size = theApp.display->selectFullScreenMode(&pGUID); if(size != -1) { int width = (size >> 12) & 4095; int height = (size & 4095); int colorDepth = (size >> 24); if(width != theApp.fsWidth || height != theApp.fsHeight || colorDepth != theApp.fsColorDepth || pGUID != theApp.pVideoDriverGUID || theApp.videoOption != VIDEO_OTHER) { theApp.fsForceChange = true; theApp.fsWidth = width; theApp.fsHeight = height; theApp.fsColorDepth = colorDepth; theApp.pVideoDriverGUID = pGUID; if(pGUID) { theApp.videoDriverGUID = *pGUID; regSetDwordValue("defaultVideoDriver", FALSE); regSetBinaryValue("videoDriverGUID", (char *)pGUID, sizeof(GUID)); } else { regSetDwordValue("defaultVideoDriver", TRUE); } theApp.updateVideoSize(ID_OPTIONS_VIDEO_FULLSCREEN); theApp.m_pMainWnd->PostMessage(VBA_CONFIRM_MODE); } }
bool CAcceleratorManager::Write() { CDWordArray AccelsDatasArray; CDWordArray CmdDatasArray; int iCount = 0; CCmdAccelOb*pCmdAccel; CAccelsOb* pAccel; DWORD dwAccelData; WORD wKey; POSITION pos = m_mapAccelTable.GetStartPosition(); while (pos != NULL) { m_mapAccelTable.GetNextAssoc(pos, wKey, pCmdAccel); CmdDatasArray.RemoveAll(); POSITION pos = pCmdAccel->m_Accels.GetHeadPosition(); while (pos != NULL) { pAccel = pCmdAccel->m_Accels.GetNext(pos); // if (!pAccel->m_bLocked) { dwAccelData = pAccel->GetData(); CmdDatasArray.Add(dwAccelData); // } } if (CmdDatasArray.GetSize() > 0) { CmdDatasArray.InsertAt(0, MAKELONG(pCmdAccel->m_wIDCommand, CmdDatasArray.GetSize())); AccelsDatasArray.Append(CmdDatasArray); iCount++; } } // AccelsDatasArray.InsertAt(0, MAKELONG(65535, iCount)); int count = AccelsDatasArray.GetSize(); DWORD *data = (DWORD *)malloc(count * sizeof(DWORD)); ASSERT(data != NULL); for (int index = 0; index < count; index++) data[index] = AccelsDatasArray[index]; regSetBinaryValue("keyboard", (char *)data, count*sizeof(DWORD)); AccelsDatasArray.RemoveAll(); CmdDatasArray.RemoveAll(); free(data); return true; }