先用VS2010 or VS2008 提供Spy++找到这个窗口句柄
例如找到为0x00070906
然后调用如下代码
可以放在wpf的启动函数中.
namespace WpfApplication5
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern bool IsWindowEnabled(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(String sClassName, String sAppName);
[DllImport("user32.dll")]
public static extern bool EnableWindow(IntPtr hwnd, bool bEnable);
private void Application_Startup(object sender, StartupEventArgs e)
{
IntPtr ParenthWnd = new IntPtr(0x00070906);
EnableWindow(ParenthWnd, true);
}
}
}