private static void Main(string[] args) { HNStruct.OemType = DeployConfig.getOemType(); HuionLog.listenGlobalCrashLog(); ResourceCulture.init(); TimerSession.startListenUserOperation(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); bool flag = false; try { flag = Utils.isAppRunning(); } catch { Utils.runAsAdmin(true); return; } if (new Mutex(true, "OnlyRun").WaitOne(0, false)) { Application.Run((Form) new HuionTalbet()); } else { if (Utils.isStartup(args) || HuionDriverDLL.PostMessage(HuionDriverDLL.FindWindow((string)null, Fixer4Main.FormTitle()), 1054, IntPtr.Zero, IntPtr.Zero) != 0) { return; } Utils.runAsAdmin(true); } }
public void readConfig() { string configFilePath = Application.StartupPath + "\\res\\config_user.xml"; if (SettingsUtil.isPerAppSettingsEnabled && SettingsUtil.perAppSettingsDefault.HasValue && SettingsUtil.perAppSettingsDefault.Value.enabled) { configFilePath = Path.GetFullPath(Path.Combine(SettingsUtil.perAppSettingsProfileDir, SettingsUtil.perAppSettingsDefault.Value.profile)); } HNStruct.devTypeString = Marshal.PtrToStringAuto( HuionDriverDLL.hnp_get_tablet_image((HnConst.HNTabletType)HNStruct.globalInfo.tabletInfo.devType)); HNStruct.tabletTextInfo = HNStruct.globalInfo.bOpenedTablet ? ResourceCulture.GetString("FormHuionTablet_lbOpenTabletText") : ResourceCulture.GetString("FormHuionTablet_lbCloseTabletText"); if (!HNStruct.globalInfo.bOpenedTablet) { return; } IntPtr coTaskMemAuto = Marshal.StringToCoTaskMemAuto(configFilePath); Marshal.AllocHGlobal(Marshal.SizeOf(typeof(HNStruct.HNConfigXML))); IntPtr num = HuionDriverDLL.hnx_read_config(ref HNStruct.globalInfo.tabletInfo, coTaskMemAuto); config = (HNStruct.HNConfigXML)Marshal.PtrToStructure(num, typeof(HNStruct.HNConfigXML)); this.SetLayoutTablet(num); Marshal.FreeHGlobal(coTaskMemAuto); HuionDriverDLL.hnx_free_PHNConfig(num); this.SetLayoutPen(); this.SetConfig(config); }
public void readDisConnectConfig() { TimerSession.stopAutoConnection(); HNStruct.tabletTextInfo = HNStruct.globalInfo.bOpenedTablet ? ResourceCulture.GetString("FormHuionTablet_lbOpenTabletText") : ResourceCulture.GetString("FormHuionTablet_lbCloseTabletText"); }
public static void defaultConfigClick(object sender, EventArgs e) { if (MessageBox.Show(ResourceCulture.GetString("FormInfo_RemindMessageText"), ResourceCulture.GetString("FormInfo_remindText"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { try { IntPtr coTaskMemAuto = Marshal.StringToCoTaskMemAuto(Application.StartupPath + "\\res\\config_default.xml"); Marshal.AllocHGlobal(Marshal.SizeOf(typeof(HNStruct.HNConfigXML))); IntPtr num1 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(HNStruct.HNTabletInfo))); Marshal.StructureToPtr((object)HNStruct.globalInfo.tabletInfo, num1, false); IntPtr num2 = HuionDriverDLL.hnx_read_config(ref HNStruct.globalInfo.tabletInfo, coTaskMemAuto); TabletConfigUtils.config = (HNStruct.HNConfigXML)Marshal.PtrToStructure(num2, typeof(HNStruct.HNConfigXML)); new TabletConfigUtils().SetConfig(TabletConfigUtils.config); Marshal.FreeHGlobal(coTaskMemAuto); Marshal.FreeHGlobal(num1); HuionDriverDLL.hnx_free_PHNConfig(num2); } catch (Exception ex) { HuionLog.saveLog("默认配置", ex.Message); } } }
public static void exportConfigClick(object sender, EventArgs e) { Directory.CreateDirectory(SettingsUtil.perAppSettingsProfileDir); SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.InitialDirectory = Path.GetFullPath(SettingsUtil.perAppSettingsProfileDir); saveFileDialog.Filter = ResourceCulture.GetString("FormInfo_TextFile") + "|*.xml"; saveFileDialog.FilterIndex = 2; saveFileDialog.RestoreDirectory = true; if (saveFileDialog.ShowDialog() != DialogResult.OK) { return; } string fileName = saveFileDialog.FileName; string s = Application.StartupPath + "\\res\\config_user.xml"; IntPtr coTaskMemAuto1 = Marshal.StringToCoTaskMemAuto(fileName); IntPtr coTaskMemAuto2 = Marshal.StringToCoTaskMemAuto(s); IntPtr num1 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(HNStruct.HNConfigXML))); Marshal.StructureToPtr((object)TabletConfigUtils.config, num1, true); IntPtr num2 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(HNStruct.HNTabletInfo))); Marshal.StructureToPtr((object)HNStruct.globalInfo.tabletInfo, num2, true); int num3 = (int)HuionDriverDLL.hnx_save_config(num1, num2, coTaskMemAuto2, coTaskMemAuto1); HuionDriverDLL.hnd_notify_config_changed(); Marshal.FreeHGlobal(coTaskMemAuto1); Marshal.FreeHGlobal(coTaskMemAuto2); Marshal.FreeHGlobal(num2); Marshal.FreeHGlobal(num1); saveFileDialog.Dispose(); }
private void LinkLabel1_Click(object sender, EventArgs e) { string str1 = "\\Release\\"; string currentDirectory = Environment.CurrentDirectory; Console.WriteLine(currentDirectory); string str2 = "updateFormApp.exe"; Console.WriteLine(currentDirectory + str1); int num1 = IsProcrssRunning("updateFormApp"); localConnectStatus(); try { if (num1 != 0) { int num2 = (int)MessageBox.Show(ResourceCulture.GetString("Cannot_openAgain"), ResourceCulture.GetString("FormInfo_remindText"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { procrssStart(currentDirectory + str1 + str2, (string)null); } } catch (Exception ex) { } }
private void FormSettingAbout_Load(object sender, EventArgs e) { this.linkLabel1.Visible = false; this.labelCurrentVersion.Text = "v14.7.4"; this.btnCheckVersion.AutoEllipsis = true; this.btnCheckVersion.Text = ResourceCulture.GetString("Check_Update"); }
public FormCommonSettings() { this.InitializeComponent(); this.checkAutorun.Enabled = Utils.isAdmin(); this.checkAutorun.Checked = !Utils.isWin10 ? SettingsUtil.isAutorun() : SettingsUtil.isCommonStartup; this.checkAutorun.Text = ResourceCulture.GetString("SettingsAutorun"); }
public static void importConfigClick(object sender, EventArgs e) { if (MessageBox.Show(ResourceCulture.GetString("FormInfo_RemindImportMessageText"), ResourceCulture.GetString("FormInfo_remindText"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { Directory.CreateDirectory(SettingsUtil.perAppSettingsProfileDir); OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = Path.GetFullPath(SettingsUtil.perAppSettingsProfileDir); openFileDialog.Filter = ResourceCulture.GetString("FormInfo_TextFile") + "|*.xml"; openFileDialog.RestoreDirectory = true; openFileDialog.FilterIndex = 1; HNStruct.HNConfigXML hnConfigXml = new HNStruct.HNConfigXML(); if (openFileDialog.ShowDialog() != DialogResult.OK) { return; } IntPtr coTaskMemAuto = Marshal.StringToCoTaskMemAuto(Path.GetFullPath(openFileDialog.FileName)); StringBuilder stringBuilder = new StringBuilder(Path.GetFullPath(openFileDialog.FileName)); Marshal.AllocHGlobal(Marshal.SizeOf(typeof(HNStruct.HNConfigXML))); IntPtr num = HuionDriverDLL.hnx_read_config(ref HNStruct.globalInfo.tabletInfo, coTaskMemAuto); TabletConfigUtils.config = hnConfigXml; TabletConfigUtils.config = (HNStruct.HNConfigXML)Marshal.PtrToStructure(num, typeof(HNStruct.HNConfigXML)); new TabletConfigUtils().SetConfig(TabletConfigUtils.config); Marshal.FreeHGlobal(coTaskMemAuto); Marshal.FreeHGlobal(num); openFileDialog.Dispose(); } }
public void onCheckCompleted(object t) { this.btnCheckVersion.Visible = false; try { if (BaseForm.IsUpdate) { this.linkLabel1.Text = ResourceCulture.GetString("Find_NewVersion"); LinkArea linkArea = new LinkArea(0, this.linkLabel1.Text.Length); this.linkLabel1.LinkBehavior = LinkBehavior.NeverUnderline; this.linkLabel1.LinkColor = HuionConst.HuionBlue4; this.linkLabel1.LinkArea = linkArea; this.linkLabel1.Click += new EventHandler(this.LinkLabel1_Click); } else { this.linkLabel1.Text = ResourceCulture.GetString("Already_Updated"); } } catch { int num = (int)MessageBox.Show(ResourceCulture.GetString("Net_Busy"), ResourceCulture.GetString("FormInfo_remindText"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }
public static string getStatusText(bool enable) { if (!enable) { return(ResourceCulture.GetString("FormHuionTablet_lbCloseTabletText")); } return(ResourceCulture.GetString("FormHuionTablet_lbOpenTabletText")); }
public static void downloadFail() { FormUpdateMessage formUpdateMessage = new FormUpdateMessage(); formUpdateMessage.label1.Text = ResourceCulture.GetString("failDownload"); formUpdateMessage.button1.Text = ResourceCulture.GetString("downloadAgain"); formUpdateMessage.button1.Click += new EventHandler(buttonClick2); formUpdateMessage.Show(); }
public static void downloadScessce() { FormUpdateMessage formUpdateMessage = new FormUpdateMessage(); formUpdateMessage.label1.Text = ResourceCulture.GetString("waitForUpdate"); formUpdateMessage.button1.Text = ResourceCulture.GetString("installNow"); formUpdateMessage.button1.Click += new EventHandler(buttonClick1); formUpdateMessage.Show(); }
public static void HotkeyConflict() { HuionMessageBox huionMessageBox = new HuionMessageBox(); huionMessageBox.HintText = ResourceCulture.GetString("SettingsHotkeyRegistered"); huionMessageBox.btnOK.Click += new EventHandler(HotkeyConflictOKClick); huionMessageBox.btnOK.Text = ResourceCulture.GetString("ChangeNow"); huionMessageBox.Show(); }
public static DialogResult defaultConfig() { buttonForm buttonForm = new buttonForm(); buttonForm.label1.Text = ResourceCulture.GetString("FormInfo_remindText"); buttonForm.label2.Text = ResourceCulture.GetString("FormInfo_RemindMessageText"); buttonForm.button1.Text = ResourceCulture.GetString("FormEkey_btOKText"); buttonForm.button2.Text = ResourceCulture.GetString("FormEkey_btCannelText"); return(buttonForm.ShowDialog()); }
public FormShortcut(IntPtr mainFormHandle) { this.InitializeComponent(); this.mMainFormHandle = mainFormHandle; this.pbOpenMainForm.Image = (Image)ImageHelper.getDllImage("warnning.png"); this.pbOpenMainForm.Visible = false; ViewUtils.CreateTip((Control)this.pbOpenMainForm, ResourceCulture.GetString("SettingsHotkeyRegistered")); this.labelOpenMainForm.Text = ResourceCulture.GetString("SettingsOpenDriverUI"); this.btnReset.Text = ResourceCulture.GetString("SettingsResetHotkey"); }
private void setViewText8Locale() { this.labelSetPress.Text = ResourceCulture.GetString("FormTabletPen_lbSetPressSensiveText"); this.buttonTest.Text = ResourceCulture.GetString("FormTabletPen_btStartPressTestText"); this.buttonClear.Text = ResourceCulture.GetString("FormTabletPen_btClearPressTestText"); this.checkInk.Text = ResourceCulture.GetString("FormTabletPen_btnWindowsInk"); this.checkTab.Text = ResourceCulture.GetString("FormTabletPen_btnWindowsTab"); this.label2.Text = ResourceCulture.GetString("PressureTest"); this.checkBoxMouseMode.Text = ResourceCulture.GetString("TextMouseMode"); this.checkBgame.Text = ResourceCulture.GetString("BGametext"); }
private void btnCheckVersion_Click(object sender, EventArgs e) { new Thread(new ThreadStart(BaseForm.myThread)).Start(); LinkArea linkArea = new LinkArea(0, 0); this.linkLabel1.Text = ResourceCulture.GetString("Checking_Update"); this.linkLabel1.Visible = true; this.linkLabel1.LinkArea = linkArea; this.btnCheckVersion.Visible = false; HuionDelayRun.delayRun(new Runnable(this.onCheck), 2000, (object)null); }
private void clearBufferForms() { foreach (Form mForm in this.mForms) { mForm.Close(); mForm.Dispose(); } this.mForms.Clear(); ResourceCulture.disposeResource(); }
public static string FormTitle() { switch (HNStruct.OemType) { case OEMType.HUION: return(ResourceCulture.GetString("FormHuionTablet_Text")); case OEMType.GAOMON: return(ResourceCulture.GetString("Title4Gaomon")); default: return("TabletDriver"); } }
private void buttonBrowse_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = ResourceCulture.GetString("ExecutableFile") + "|*.exe"; openFileDialog.RestoreDirectory = true; openFileDialog.FilterIndex = 1; if (openFileDialog.ShowDialog() != DialogResult.OK) { return; } this.labelPath.Text = openFileDialog.FileName; openFileDialog.Dispose(); }
public FormSettings() { this.InitializeComponent(); this.ControlBox = true; this.ShowSettingsIcon = false; this.MinimizeBox = false; this.AutoScroll = true; this.Icon = ImageHelper.getDllIcon("32.ico", HNStruct.OemType); this.Text = ResourceCulture.GetString("SettingsTitle"); this.btnCommon.Text = ResourceCulture.GetString("SetttingsCommon"); this.btnShortcuts.Text = ResourceCulture.GetString("SettingsHotkey"); this.btnAbout.Text = ResourceCulture.GetString("soft_update"); this.btnBrightness.Text = "亮度设置"; MiddleModule.eventPost += new Post(this.MiddleModule_eventSend); }
private void setViewTextLocale() { this.buttonWhileDisplay.Text = ResourceCulture.GetString("FormWorkArea_btFullScreenAreaText"); this.buttonWhileBoard.Text = ResourceCulture.GetString("FormWorkArea_fullAreaText"); this.buttonScreenRatio.Text = ResourceCulture.GetString("FormWorkArea_ScreenRatioText"); this.buttonCalibration.Text = ResourceCulture.GetString("FormWoekArea_btCalibrateText"); this.labelSelectScreen.Text = ResourceCulture.GetString("FormWorkArea_lbSelectScreenText"); this.labelTop.Text = ResourceCulture.GetString("FormWoekArea_lbTopText"); this.labelBottom.Text = ResourceCulture.GetString("FormWoekArea_lbBottomText"); this.labelLeft.Text = ResourceCulture.GetString("FormWoekArea_lbLeftText"); this.labelRight.Text = ResourceCulture.GetString("FormWoekArea_lbRightText"); this.groupBoxRotate.Text = ResourceCulture.GetString("FormWoekArea_gbRotateText"); this.groupBoxCustomArea.Text = ResourceCulture.GetString("FormWorkArea_CustomAreaText"); this.btnIdentify.Text = ResourceCulture.GetString("Identify"); }
private static bool localConnectStatus() { int dwFlag = 0; try { return(InternetGetConnectedState(ref dwFlag, 0) && ((dwFlag & 1) != 0 || (dwFlag & 2) != 0 || (dwFlag & 3) != 0)); } catch (Exception ex) { int num = (int)MessageBox.Show(ResourceCulture.GetString("Net_Busy"), ResourceCulture.GetString("FormInfo_remindText"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk); HuionLog.saveLog(nameof(localConnectStatus), ex.Message); return(false); } }
private void setViewText8Locale() { this.panelHotKey.Text = ResourceCulture.GetString("FormHuionTablet_lbHotKeyText"); this.panelTabletPen.Text = ResourceCulture.GetString("FormHuionTablet_lbTabletPenText"); this.panelWorkArea.Text = ResourceCulture.GetString("FormHuionTablet_lbWorkAreaText"); this.panelInfo.Text = ResourceCulture.GetString("FormHuionTablet_lbInfoText"); this.btnOK.Text = ResourceCulture.GetString("FormHuionTablet_btOKText"); this.btnClose.Text = ResourceCulture.GetString("closeForm"); this.btnApplay.Text = ResourceCulture.GetString("FormHuionTablet_btAppText"); this.Text = Fixer4Main.FormTitle(); HNStruct.tabletTextInfo = Fixer4Main.getStatusText(false); this.labelTabletState.Enabled = false; this.labelTabletState.Text = HNStruct.tabletTextInfo; this.tsmiExit.Text = ResourceCulture.GetString("FormHuionTablet_exit"); this.tsmiSettings.Text = ResourceCulture.GetString("SettingsTitle"); this.notifyIcon1.Text = ResourceCulture.GetString("FormHuionTabletNotifyIconText"); this.btnAdmin.Text = ResourceCulture.GetString("applyAdmin"); }
private void buttonTest_Click(object sender, EventArgs e) { this.bTest = !this.bTest; this.buttonTest.Text = this.bTest ? ResourceCulture.GetString("FormTabletPen_btCanncelPressTestText") : ResourceCulture.GetString("FormTabletPen_btStartPressTestText"); this.drawLineHelper.IsDrawLine = this.bTest; if (this.bTest) { this.drawLineHelper.startDrawLine((Form)this); } else { this.drawLineHelper.stopDrawLine(); } this.touchPressBar1.Value = 0; this.touchPressBar1.Visible = this.bTest; }
private void panelWindow_SizeChanged(object sender, EventArgs e) { try { if (!IsUpdate || this.openNum >= 1 || !SettingsUtil.isUpdateReminderEnabled) { return; } Console.WriteLine(this.openNum.ToString()); ++this.openNum; this.notifyIcon1.ShowBalloonTip(3, ResourceCulture.GetString("Update_Remind"), ResourceCulture.GetString("Update_RemindVersion"), ToolTipIcon.Info); IsReminder = true; } catch (Exception ex) { HuionLog.saveLog("更新提示", ex.Message); } }
private void setViewText8Locale() { if (this.mOemType == OEMType.GAOMON) { this.labelCompany.Text = ResourceCulture.GetString("CompanyName4Gaomon"); } else if (this.mOemType == OEMType.HUION) { this.labelCompany.Text = ResourceCulture.GetString("FormInfo_lbCommpanyText"); } else { this.labelCompany.Text = "Company Name"; } this.labelVersion.Text = ResourceCulture.GetString("FormInfo_lbVersionText") + "v14.7.4"; this.labelRight.Text = ResourceCulture.GetString("FormInfo_lbReservedText") + "2011-2018"; this.buttonExport.Text = ResourceCulture.GetString("FormInfo_btEmportText"); this.buttonRefreshProfiles.Text = "Refresh Profiles"; this.buttonImport.Text = ResourceCulture.GetString("FormInfo_btImportText"); this.buttonDefault.Text = ResourceCulture.GetString("FormInfo_btDefaultText"); }
private void setViewText8Locale() { this.radioMouseLeft.Text = ResourceCulture.GetString("FormEkey_rdMouseLeftText"); this.radioMouseRight.Text = ResourceCulture.GetString("FormEkey_rdMouseRightText"); this.radioMouseMid.Text = ResourceCulture.GetString("FormEkey_rdMouseMidText"); this.radioMouseWheelForward.Text = ResourceCulture.GetString("FormEkey_rdMouseWheelForwardText"); this.radioMouseWheelBackWard.Text = ResourceCulture.GetString("FormEkey_rdMouseWheelBackwardText"); this.radioSwitchScreen.Text = ResourceCulture.GetString("FormEkey_rdSwitchScreenText"); this.radioSwithBrush.Text = ResourceCulture.GetString("FormEkey_rdSwitchBrushText"); this.buttonClearStr.Text = ResourceCulture.GetString("FormEkey_btJoinClearText"); this.buttonBrowse.Text = ResourceCulture.GetString("FormEkey_btBrowseText"); this.buttonOk.Text = ResourceCulture.GetString("FormEkey_btOKText"); this.buttonCancel.Text = ResourceCulture.GetString("FormEkey_btCannelText"); this.labelMaxStr.Text = ResourceCulture.GetString("FormEkey_lbMaxStrText"); this.labelProgressPath.Text = ResourceCulture.GetString("FormEkey_lbProgressPathText"); this.Text = ResourceCulture.GetString("FormEKey_Text"); this.checkBoxFunKb.Text = ResourceCulture.GetString("FormEkey_ckFunKbText"); this.checkBoxFunMouse.Text = ResourceCulture.GetString("FormEkey_ckFunMouseText"); this.checkBoxFunRun.Text = ResourceCulture.GetString("FormEkey_ckFunRunText"); this.checkBoxFunSwitch.Text = ResourceCulture.GetString("FormEkey_ckFunSwitchText"); }
private void SetComboxDisplay() { if (this.displayNum == 1) { TabletConfigUtils.config.curScreenIndex = 0U; } if (this.displayNum != 1 && (int)TabletConfigUtils.config.curScreenIndex > this.displayNum) { TabletConfigUtils.config.curScreenIndex = (uint)this.displayNum; } this.comboBoxSelectScreen.Items.Clear(); for (int index = 0; index < this.displayNum; ++index) { int num1 = this.monitorInfos[index].Monitor.Right - this.monitorInfos[index].Monitor.Left; int num2 = this.monitorInfos[index].Monitor.Bottom - this.monitorInfos[index].Monitor.Top; if (this.monitorInfos[index].Flags == 1U) { this.comboBoxSelectScreen.Items.Add( (object)(ResourceCulture.GetString("FormWorkArea_DisplayText") + (object)(index + 1) + " : " + ResourceCulture.GetString("FormWorkArea_WidthText") + (object)num1 + ", " + ResourceCulture.GetString("FormWorkArea_HeightText") + (object)num2 + ResourceCulture.GetString("FormWorkArea_MainDisPlay"))); } else { this.comboBoxSelectScreen.Items.Add( (object)(ResourceCulture.GetString("FormWorkArea_DisplayText") + (object)(index + 1) + " : " + ResourceCulture.GetString("FormWorkArea_WidthText") + (object)num1 + ", " + ResourceCulture.GetString("FormWorkArea_HeightText") + (object)num2)); } } if (this.displayNum > 1) { this.comboBoxSelectScreen.Items.Add((object)ResourceCulture.GetString("FormWorkArea_AllScreenText")); } this.huionWorkAreaPictrueView1.Screenshot = ScreenHelper.getScreenImage((int)TabletConfigUtils.config.curScreenIndex, this.monitorInfos); this.comboBoxSelectScreen.SelectedIndex = (int)TabletConfigUtils.config.curScreenIndex; }