//===================================================================== //===================================================================== private void ActualiserKeysPressed(object sender, EventArgs e) { //----------------------------------------------- // Gere les raccourcis clavier if (GetForegroundWindow() != this.Handle && GetForegroundWindow() != CurrentInstance.Proc.MainWindowHandle) { return; } if (GetAsyncKeyState(0x70) != 0) // F1 { AjouterInstanceCmd(); } if (GetAsyncKeyState(0x71) != 0) // F2 { AjouterInstancePS(); } if (GetAsyncKeyState(0x72) != 0) // F3 { FermerInstance(CurrentInstance); } if (GetAsyncKeyState(0x11) != 0 && GetAsyncKeyState(0x41) != 0) // Ctrl + A { TreeListeOnglets.ExpandAll(); } if (GetAsyncKeyState(0x11) != 0 && GetAsyncKeyState(0x5A) != 0) // Ctrl + Z { TreeListeOnglets.CollapseAll(); } if (GetAsyncKeyState(0x7B) != 0) // F12 { AfficherInfos(); } //----------------------------------------------- }
private void ToolStripExpand_Click(object sender, EventArgs e) { //----------------------------------------------- TreeListeOnglets.ExpandAll(); //----------------------------------------------- }
private void StripDeplier_Click(object sender, EventArgs e) { //----------------------------------------------- TreeListeOnglets.ExpandAll(); //----------------------------------------------- }
//===================================================================== //===================================================================== // Initalisation private void Menu_Load(object sender, EventArgs e) { //----------------------------------------------- // Verifi que ça soit windows 10 // Seule la nouvelle console de windows 10 peut être modifiée comme tel try { var reg = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion"); string productName = (string)reg.GetValue("ProductName"); if (!productName.Contains("Windows 10")) { Message_FataleError("Compatible uniquement avec Windows 10 et plus."); } } catch { Message_FataleError("Impossible de vérifier la version de Windows."); } //----------------------------------------------- //----------------------------------------------- // Force la nouvelle console try { var cle = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(@"Console", true); cle.SetValue("ForceV2", 1); cle.Close(); } catch { Message_FataleError("Impossible d'accéder au registre pour activer la nouvelle console."); } //----------------------------------------------- //----------------------------------------------- // Verifi si admin if (new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator)) { this.Text += " (Administrateur)"; } //----------------------------------------------- //----------------------------------------------- // Créer les dossier de l'application if (!Directory.Exists(FOLDER_INSTALL)) { Directory.CreateDirectory(FOLDER_INSTALL); } if (!Directory.Exists(FOLDER_PROFILS)) { Directory.CreateDirectory(FOLDER_PROFILS); } //----------------------------------------------- //----------------------------------------------- // Charge les parametres preenregistrés IniConfig.SetFile(FILE_CONFIG); ChargerProfils(); ChargerRaccourci(); //Les shells ne peuvent pas depasser la taille de lecran principal this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); // Demarre deux fenetre par defaut AjouterInstancePS(); AjouterInstanceCmd(); TreeListeOnglets.ExpandAll(); //----------------------------------------------- }