// // Copyright (c) PlaceholderCompany. All rights reserved. // using System; using System.Globalization; using System.Runtime.InteropServices; using System.Threading; using System.Windows.Forms; using DevExpress.LookAndFeel; using DevExpress.UserSkins; using GeoSigmaDrawLib; namespace PcgDrawR { /// /// The program. /// internal static class Program { private enum PROCESS_DPI_AWARENESS { PROCESS_DPI_UNAWARE = 0, PROCESS_SYSTEM_DPI_AWARE = 1, PROCESS_PER_MONITOR_DPI_AWARE = 2, } [DllImport("SHCore.dll")] private static extern bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness); /// /// The main entry point for the application. /// /// 启动参数 “/ZC”-块状显示散点 [STAThread] public static void Main(string[] args) { //DrawerData drawer = new DrawerData(); //drawer.OpenFile("c:\\temp\\k2.kev"); //IntPtr hBmp = drawer.GetBitmapHandle(2173, 1631, 0); //System.Drawing.Bitmap image = System.Drawing.Image.FromHbitmap(hBmp); ////image.MakeTransparent(Color.White); //image.Save("c:\\temp\\aaa.bmp"); //image.Dispose(); //drawer.DeleteHbmp(hBmp); // 设置当前线程的文化为简体中文 //Thread.CurrentThread.CurrentCulture = new CultureInfo("zh-CN"); //Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN"); // 6.2 对应 win8、win server 2012, SetProcessDpiAwareness 至少要 win8 才有 if (Environment.OSVersion.Version.Major >= 6.2) { SetProcessDpiAwareness(PROCESS_DPI_AWARENESS.PROCESS_SYSTEM_DPI_AWARE); } try { FileTypeRegister.RegistFileType(".kev", "金东方勘探开发分析平台"); FileTypeRegister.RegistFileType(".dfd", "金东方勘探开发分析平台"); } catch (Exception ex) { if (ex is UnauthorizedAccessException) { // 用户未必有管理员权限,如果无法和文件后缀建关联,这个会反复弹窗,用户体验体验很差 // MessageBox.Show("未使用管理员权限启动,无法注册文件打开方式的关联!"); } } //WindowsFormsSettings.ForceDirectXPaint(); // DevExpress.UserSkins.BonusSkins.Register(); // DevExpress.Skins.SkinManager.EnableFormSkins(); DevExpress.Skins.SkinManager.EnableMdiFormSkins(); // DevExpress.Utils.Taskbar.Core.TaskbarAssistantCore.Initialize(); DevExpress.XtraEditors.WindowsFormsSettings.FontBehavior = DevExpress.XtraEditors.WindowsFormsFontBehavior.UseWindowsFont; // WindowsFormsSettings.ThickBorderWidth = false; // DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(SkinSvgPalette.Bezier.OfficeColorful); SetupStyle(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FormMain(args)); // Application.Run(new FormTestLic()); } private static void SetupStyle() { //SetCulture("zh-Hans"); BonusSkins.Register(); DevExpress.Skins.SkinManager.EnableFormSkins(); DevExpress.Skins.SkinManager.EnableMdiFormSkins(); //UserLookAndFeel.Default.SetSkinStyle(SkinSvgPalette.Bezier.Default); UserLookAndFeel.Default.SetSkinStyle(SkinStyle.VisualStudio2013Light); } } }