From a9b99add3e1baa7fc49049247b8bf071e70a6005 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 03 九月 2024 15:13:57 +0800 Subject: [PATCH] 1 --- TEWin/FrmWin.cs | 26 ++++++++++++++++++++------ 1 files changed, 20 insertions(+), 6 deletions(-) diff --git a/TEWin/FrmWin.cs b/TEWin/FrmWin.cs index a3a45d2..fff7089 100644 --- a/TEWin/FrmWin.cs +++ b/TEWin/FrmWin.cs @@ -121,7 +121,7 @@ void FrmWin_FormClosing(object sender, FormClosingEventArgs e) { - ExecCmd(new List<string> { "taskkill /f /t /im OSGBLab.exe" }); + ExecCmd(new List<string> { "taskkill /f /t /im OSGBLab.exe" }); LogOut.Info("鍏抽棴绋嬪簭."); } #endregion @@ -317,13 +317,27 @@ } while (true); } + [DllImport("user32.dll", EntryPoint = "SetClassLongPtr", SetLastError = true)] + static extern IntPtr SetClassLongPtr64(IntPtr hWnd, int nIndex, IntPtr dwNewLong); + + [DllImport("user32.dll", EntryPoint = "SetClassLong", SetLastError = true)] + static extern int SetClassLong32(IntPtr hWnd, int nIndex, int dwNewLong); + + [DllImport("user32.dll")] + static extern IntPtr LoadIcon(IntPtr hInstance, IntPtr iconName); + + [DllImport("user32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); + public void DealOsgbLab(IntPtr hWnd) { - SetWindowText(hWnd, "OSGB鏁版嵁澶勭悊宸ュ叿"); + //ShowWindow(hWnd, 0); // 5 + SetWindowText(hWnd, ConfigurationManager.AppSettings["osgbLabTitle"]); Icon icon = new Icon(Path.Combine(mainUrl, @"Resources\favicon.ico")); - SetClassLongPtr(hWnd, GCLP_HICON + ICON_SMALL, icon.Handle); - SetClassLongPtr(hWnd, GCLP_HICON + ICON_BIG, icon.Handle); + SetClassLongPtr(hWnd, GCLP_HICON, icon.Handle); + //SetClassLongPtr(hWnd, GCLP_HICON + ICON_BIG, icon.Handle); } #endregion @@ -641,8 +655,8 @@ private void InvokeOsgbLab() { ExecCmd(new List<string> { "taskkill /f /t /im OSGBLab.exe" }); - osgbProc = RunExe(GetAbsolutePath("osgblabPath"), null, false); - DealOsgbLab(osgbProc); + Process p = RunExe(GetAbsolutePath("osgblabPath"), null, false); + DealOsgbLab(p); } private void DisplayByAttribute(int type, String name) -- Gitblit v1.9.3