æ¢ã«èµ·åãã¦ããããã»ã¹ãå¤é¨ããã¢ã¯ãã£ãã«ããã«ã¯
以ä¸ã®ã¯ã©ã¹ãç¨ãã¾ãã
Microsoft.VisualBasic.Interaction
ãã®ã¯ã©ã¹ã®ä»¥ä¸ã®ã¡ã½ãããå©ç¨ãã¦ãããã»ã¹ãã¢ã¯ãã£ãã«ãã¾ãã
AppActivate(int id)
ãã®ä»ã«ããwinapiã使ç¨ãã¦ã¢ã¯ãã£ãã«ããããæ¹ã
ããã¿ããã§ãããä»åã¯ããã§ãµã³ãã«ãã¤ãã£ã¦ã¿ã¾ããã
以ä¸ãµã³ãã«ã§ãã
using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using Microsoft.VisualBasic; namespace Gsf.Samples.CSharp { class EntryPoint { ////// ã¢ã¯ãã£ãã«ããããã»ã¹å /// const string APP_NAME = "AFX"; ////// ã¢ããªã±ã¼ã·ã§ã³ã¡ã¤ã³ã¨ã³ããªãã¤ã³ãã¡ã½ããã§ãã /// ////// ç¹å®ã®ã¢ããªã±ã¼ã·ã§ã³ãã¢ã¯ãã£ãã«ãã¾ãã /// /// åææ¡ä»¶ã¨ãã¦ã /// ã»ã¢ã¯ãã£ãã«ããããã»ã¹ãäºãèµ·åãã¦ããå¿ è¦ãããã¾ãã /// ã»APP_NAMEã«ã¢ã¯ãã£ãã«ããããã»ã¹åãã»ãããã¦ããã¦ãã ããã /// ãåå¨ãã¾ãã /// static void Main(){ foreach(Process aProcess in Process.GetProcessesByName(APP_NAME)){ // // ããã»ã¹ãã¢ã¯ãã£ãã«ãã // Interaction.AppActivate(aProcess.Id); } } } }
èµ·åãã¦å®è¡ãã¦ã¿ãã¨ã該å½ããããã»ã¹ãã¢ã¯ãã£ãã«ãªãåé¢ã«åºã¦ãã¾ãã