SVN-Revision: r778
This commit is contained in:
wyf
2025-06-24 02:24:52 +00:00
parent 60a6ef05eb
commit 75496ffede
+7 -36
View File
@@ -17,17 +17,23 @@ using System.Reflection;
using System.IO; using System.IO;
using Lskj.Control.BrowserSetting; using Lskj.Control.BrowserSetting;
using Microsoft.Win32; using Microsoft.Win32;
using System.Runtime.InteropServices;
namespace Lskj.Main namespace Lskj.Main
{ {
static class Program static class Program
{ {
[DllImport("user32.dll")]
private static extern bool SetProcessDpiAwarenessContext(IntPtr dpiContext);
private static readonly IntPtr DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = new IntPtr(-4);
/// <summary> /// <summary>
/// 应用程序的主入口点。 /// 应用程序的主入口点。
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main(string[] args) static void Main(string[] args)
{ {
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
CefRuntime.Load();//cef浏览器模块设置加载 CefRuntime.Load();//cef浏览器模块设置加载
var mainArgs = new CefMainArgs(args); var mainArgs = new CefMainArgs(args);
var app = new DemoCefApp(); var app = new DemoCefApp();
@@ -184,39 +190,4 @@ namespace Lskj.Main
RegistryKey subKey = regKey.OpenSubKey("AA_LS_Erp V2.0"); RegistryKey subKey = regKey.OpenSubKey("AA_LS_Erp V2.0");
subKey = subKey.OpenSubKey("File", true); subKey = subKey.OpenSubKey("File", true);
result = subKey.GetValue("CefMultithreading", "0") + "" == "1" || subKey.GetValue("CefMultithreading", "0") + "" == "True" ? true : false; result = subKey.GetValue("CefMultithreading", "0") + "" == "1" ||
return result;
}
catch (Exception ex)
{
}
return false;
}
//public static Form GetForm()
//{
// Form X = new CEFdemo.Form1();
// return X;
//}
public class Messager : IMessageFilter
{
public bool PreFilterMessage(ref Message m)
{
//如果检测到有鼠标或则键盘的消息,则使计数为0.....
if (m.Msg == 0x0200 || m.Msg == 0x0201 || m.Msg == 0x0204 || m.Msg == 0x0207)
{
Manager.isAwaitTime = 0;
}
if (m.Msg == 0x0100 && m.WParam != new IntPtr(0x0000001b) && Lskj.Model.ERPInfo.Instance.IsExecute)
{
return true;
}
return false;
}
}
}
}