bool CAcceleratorManager::Default()
{
	/// this is NYI for some reason, so the "Reset All" button doesn't work

#if 0
	// still doesn't work:
    Reset();
    regDeleteValue("keyboard");
    regDeleteValue("keyboardCount");
    Connect((MainWnd *)theApp.m_pMainWnd);
    extern void winAccelAddCommands(CAcceleratorManager& mgr);
    Load();
    CreateDefaultTable();
    winAccelAddCommands(*this);
    UpdateWndTable();
    Write();
    UpdateMenu(theApp.menu);
    m_pWndConnected = NULL;
#endif

	return true;
}
예제 #2
0
BOOL VBA::InitInstance()
{
  SetRegistryKey(_T("VBA"));

  wndClass = AfxRegisterWndClass(0, LoadCursor(IDC_ARROW), (HBRUSH)GetStockObject(BLACK_BRUSH), LoadIcon(IDI_MAINICON));

  char winBuffer[2048];

  GetModuleFileName(NULL, winBuffer, 2048);
  char *p = strrchr(winBuffer, '\\');
  if(p)
    *p = 0;

  bool force = false;

  if (m_lpCmdLine[0])
  {
    if(__argc > 0) {
      if( 0 == strcmp( __argv[1], "--configpath" ) ) {
        if( __argc > 2 ) {
          strcpy( winBuffer, __argv[2] );
          force = true;
          if( __argc > 3 ) {
            filename = __argv[3];
          }
        }
      } else {
        filename = __argv[1];
      }
    }
  }

  regInit(winBuffer, force);

  loadSettings();

    if(!initDisplay()) {
    if(videoOption >= VIDEO_320x240) {
      regSetDwordValue("video", VIDEO_2X);
    }
    return FALSE;
  }

  
  if(!initInput())
    return FALSE;

  hAccel = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR));

  winAccelMgr.Connect((MainWnd *)m_pMainWnd);

  winAccelMgr.SetRegKey(HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance");

  extern void winAccelAddCommands(CAcceleratorManager&);

  winAccelAddCommands(winAccelMgr);

  winAccelMgr.CreateDefaultTable();

  winAccelMgr.Load();

  winAccelMgr.UpdateWndTable();

  winAccelMgr.UpdateMenu(menu);

  if( !filename.IsEmpty() ) {
    if(((MainWnd*)m_pMainWnd)->FileRun())
      emulating = true;
    else
      emulating = false;
  }

  return TRUE;
}