我有一个控制台应用程序, 它是构建为Windows应用程序,以作为后台进程运行(我称之为
当我运行其他应用程序时,我会向
我想要避免
你能帮助我如何避免
App 1
)。当我运行其他应用程序时,我会向
App 1
发送消息,然后它会处理该消息。我想要避免
App 1
自动退出,直到我按下热键。你能帮助我如何避免
App 1
自动退出吗?非常感谢!App 1
)。App 1
发送消息,然后它会处理该消息。App 1
自动退出,直到我按下热键。App 1
自动退出吗?非常感谢![DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, int vk);
来源: http://msdn.microsoft.com/en-us/library/ms646309(v=vs.85).aspx
这篇文章讲述了如何使用Windows API函数来创建、显示和隐藏窗口。它包括了一些基本的概念,例如消息循环和回调函数,以及一些实用的示例代码。如果你正在学习Windows编程或想要改进你的技能,这篇文章将会对你有所帮助。 static void Main(string[] args)
{
// do something here...
string answer = Console.ReadLine();
while (answer != "Exit")
{
answer = Console.ReadLine();
}
}