我需要configuration一个Windows XP Embedded系统,以消除默认回复模式的MessageBoxes。
我知道EnableDefaultReplyfunction,但我需要更多地select哪些消息框消除或select默认答复在某些标准(例如:窗口的名称)。
我现在最大的问题是:
你有什么经验可以分享这个问题吗?
我写了一个C#应用程序回.net 2.0天,所以应该工作,因为embedded式可以得到3.0
这是从初学者那里得到的丑陋的代码,但是你可以写一些使用在这里find的api调用的东西,并且大部分时间都在睡觉,除非它看到一个需要杀死的窗口。 否则,您可能需要许可基本上执行相同操作的应用程序。 :)另外,如果你不能把.net放在那里,这些都是标准的窗口调用,所以店里的任何一个c ++程序员都可以在大约2个小时内把它放在一起。
using System; using System.Collections; using System.Threading; using System.Runtime.InteropServices; // Dllimport namespace osconfig { /// <summary> /// Summary description for WindowHiding. /// </summary> public class WindowHiding { ArrayList windowNames; private const int sleepTime = 100; // For findind the windows dialogs that popup when devices are detected [DllImport ("user32.dll")] public static extern int ShowWindow (IntPtr hWnd, int nCmdShow); [DllImport("User32.dll", CharSet=CharSet.Auto)] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); //private const int SW_SHOW = 5; private const int SW_HIDE = 0; private const short WM_COPYDATA = 74; public WindowHiding(ArrayList wNames) { this.windowNames = wNames; } // Spin a thread that hunts down and hides windows public void hideWindows() { // Run until we are told to stop while (true) { IntPtr foundHardwareWindowHandle; int result; // Look for each of the window names. foreach (string wName in this.windowNames) { try { foundHardwareWindowHandle = FindWindow(null, wName); if (foundHardwareWindowHandle.ToInt32() > 0) { // Found it. Hide it. result = ShowWindow(foundHardwareWindowHandle, SW_HIDE); } } catch { // Do nothing... } } // Go to sleep Thread.Sleep(sleepTime); } } }
}
这不是对你的问题的直接回答,而是对可能的解决方法的build议。
当我使用Windows XP Embedded机器时,我总是安装Ultra VNC进行远程访问。 这意味着我可以在不locking本地运营商的情况下控制一台机器。 这也意味着我可以连接看看发生了什么。 当客户或现场服务工程师遇到问题时,这非常有用。
另一件我喜欢UVNC的事情是,如果主机端启用了encryptionfunction,则可以肯定的是,没有人会偶然发生不安全的连接。