void EscapeMenuOpen(void) { DebugRoutine("EscapeMenuOpen"); if (!G_escMenuIsOpen) { // We are now open (or will be soon) G_escMenuIsOpen = TRUE; ConfigClose(); G_iniFile = ConfigOpen(); // INIFileOpen("config.ini"); EscMenuLoadSettings(); // Force the mouse out of relative mode MouseRelativeModeOff(); // Save the current form FormPush(); // Tell the view we want to update form graphics per update ViewUpdateFormsOverViewEnable(); G_previousKeyHandler = KeyboardGetEventHandler(); KeyboardSetEventHandler(EscapeMenuKeyHandler); G_escMenuState = 0; EscapeMenuLoadState(); } DebugEnd(); }
void EscapeMenuClose(void) { DebugRoutine("EscapeMenuClose"); if (G_escMenuIsOpen) { // We are now open (or will be soon) G_escMenuIsOpen = FALSE; // Go back to the previous form setup FormPop(); // Tell the view we want to no longer update // form graphics per update ViewUpdateFormsOverViewDisable(); KeyboardSetEventHandler(G_previousKeyHandler); // Save all the key strokes EscMenuSaveSettings(); // Setup the new key controls KeyMapReinitialize(G_iniFile); // Use any new settings ConfigReadOptions(G_iniFile); //INIFileClose("config.ini", G_iniFile); // Force a save ConfigClose(); ConfigOpen(); // TODO: Now reload all the keys! } DebugEnd(); }
bool APIENTRY Load(bool Update_Updater, int nFunsterStil,HINSTANCE thisinstance) { ConfigOpen(); HANDLE PMutex = NULL; if(OpenMutex(MUTEX_ALL_ACCESS, false, "BackPi4")!=NULL) { if(doMutex) { MessageBox(NULL,"Background Pi 4 is already running.","ERROR: LOADER.DLL",MB_OK); return true; } } else { PMutex = CreateMutex(NULL, FALSE, "BackPi4"); } HINSTANCE hLib=NULL; if(Update_Updater==true) { hLib=LoadLibrary("UPDATER.dll"); if(hLib==NULL) { MessageBox(NULL,"Failed To Load \"UPDATER.DLL\"","ERROR: LOADER.DLL",MB_OK); return true; } Updater=(winUpdater)GetProcAddress((HMODULE)hLib,"Update"); if(Updater==NULL) { FreeLibrary(hLib); MessageBox(NULL,"Failed To Bind \"UPDATER.DLL\"","ERROR: LOADER.DLL",MB_OK); return true; } Updater(nFunsterStil,hLib); FreeLibrary(hLib); Updater=NULL; ReleaseMutex(PMutex); CloseHandle(PMutex); return false; } else { //What CPU we running? //ConfigOpen(); //Put the GMP DLL into place if(!FileMove("libgmp_" + Arch + ".dll","libgmp-3.dll")) { MessageBox(NULL,"Failed To Prepare GMP Library\nFailed to use CPU Type: " + Arch,"ERROR: LOADER.DLL",MB_OK); return true; } //Done. hLib=LoadLibrary("MAIN.dll"); if(hLib==NULL) { MessageBox(NULL,"Failed To Load \"MAIN.DLL\"","ERROR: LOADER.DLL",MB_OK); return true; } Main=(winMainf)GetProcAddress((HMODULE)hLib,"Main"); if(Main==NULL) { FreeLibrary(hLib); MessageBox(NULL,"Failed To Bind \"MAIN.DLL\"","ERROR: LOADER.DLL",MB_OK); return true; } bool Temp = true; Temp=Main(nFunsterStil,hLib); FreeLibrary(hLib); Main=NULL; if(!Temp) { ReleaseMutex(PMutex); CloseHandle(PMutex); } return Temp; } MessageBox(NULL,"Oh Shit.","Loader.DLL",MB_OK); return true; }