| | |
| | | |
| | | 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 |
| | |
| | | } 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 |
| | | |
| | |
| | | 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) |