Fix: Gorev cubugu tüy simgesi giderildi, AppUserModelID ve Win32 WM_SETICON tam entegrasyonu
BIN
app.ico
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 353 KiB |
|
|
@ -43,8 +43,8 @@ Source: "{#SourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
|
||||||
Source: "app.ico"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "app.ico"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\app.ico"
|
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\app.ico"; AppUserModelID: "LDSoftware.LDUninstaller"
|
||||||
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\app.ico"
|
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\app.ico"; AppUserModelID: "LDSoftware.LDUninstaller"
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,14 @@ namespace LDUninstaller.Launcher
|
||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
|
[DllImport("shell32.dll", SetLastError = true)]
|
||||||
|
private static extern int SetCurrentProcessExplicitAppUserModelID([MarshalAs(UnmanagedType.LPWStr)] string AppID);
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
try { SetCurrentProcessExplicitAppUserModelID("LDSoftware.LDUninstaller"); } catch { }
|
||||||
|
|
||||||
ApplicationConfiguration.Initialize();
|
ApplicationConfiguration.Initialize();
|
||||||
|
|
||||||
// 1. Architecture check
|
// 1. Architecture check
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 353 KiB |
|
|
@ -1,13 +1,24 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace LDUninstaller.UI
|
namespace LDUninstaller.UI
|
||||||
{
|
{
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
|
[DllImport("shell32.dll", SetLastError = true)]
|
||||||
|
private static extern int SetCurrentProcessExplicitAppUserModelID([MarshalAs(UnmanagedType.LPWStr)] string AppID);
|
||||||
|
|
||||||
protected override void OnStartup(StartupEventArgs e)
|
protected override void OnStartup(StartupEventArgs e)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Unify taskbar grouping with shortcuts and ensure correct icon binding
|
||||||
|
SetCurrentProcessExplicitAppUserModelID("LDSoftware.LDUninstaller");
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
|
|
||||||
string logPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "trace.log");
|
string logPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "trace.log");
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,11 @@
|
||||||
Title="Toplu Kaldırma Sihirbazı - LD Uninstaller"
|
Title="Toplu Kaldırma Sihirbazı - LD Uninstaller"
|
||||||
Height="620" Width="850"
|
Height="620" Width="850"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
|
ShowInTaskbar="False"
|
||||||
Background="{StaticResource BrushBgDark}"
|
Background="{StaticResource BrushBgDark}"
|
||||||
Foreground="{StaticResource BrushTextPrimary}"
|
Foreground="{StaticResource BrushTextPrimary}"
|
||||||
FontFamily="Segoe UI"
|
FontFamily="Segoe UI"
|
||||||
Icon="pack://application:,,,/Resources/app.ico"
|
Icon="pack://application:,,,/LDUninstaller.UI;component/Resources/app.ico"
|
||||||
BorderBrush="{StaticResource BrushBorder}"
|
BorderBrush="{StaticResource BrushBorder}"
|
||||||
BorderThickness="1">
|
BorderThickness="1">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,11 @@
|
||||||
Title="Kalıntı Temizleme Motoru - LD Uninstaller"
|
Title="Kalıntı Temizleme Motoru - LD Uninstaller"
|
||||||
Height="580" Width="920"
|
Height="580" Width="920"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
|
ShowInTaskbar="False"
|
||||||
Background="{StaticResource BrushBgDark}"
|
Background="{StaticResource BrushBgDark}"
|
||||||
Foreground="{StaticResource BrushTextPrimary}"
|
Foreground="{StaticResource BrushTextPrimary}"
|
||||||
FontFamily="Segoe UI"
|
FontFamily="Segoe UI"
|
||||||
Icon="pack://application:,,,/Resources/app.ico"
|
Icon="pack://application:,,,/LDUninstaller.UI;component/Resources/app.ico"
|
||||||
BorderBrush="{StaticResource BrushBorder}"
|
BorderBrush="{StaticResource BrushBorder}"
|
||||||
BorderThickness="1">
|
BorderThickness="1">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
Background="{StaticResource BrushBgDark}"
|
Background="{StaticResource BrushBgDark}"
|
||||||
Foreground="{StaticResource BrushTextPrimary}"
|
Foreground="{StaticResource BrushTextPrimary}"
|
||||||
FontFamily="Segoe UI"
|
FontFamily="Segoe UI"
|
||||||
Icon="pack://application:,,,/Resources/app.ico"
|
Icon="pack://application:,,,/LDUninstaller.UI;component/Resources/app.ico"
|
||||||
BorderBrush="{StaticResource BrushBorder}"
|
BorderBrush="{StaticResource BrushBorder}"
|
||||||
BorderThickness="1">
|
BorderThickness="1">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,13 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Interop;
|
||||||
using LDUninstaller.Core.Bulk;
|
using LDUninstaller.Core.Bulk;
|
||||||
using LDUninstaller.Core.Discovery;
|
using LDUninstaller.Core.Discovery;
|
||||||
using LDUninstaller.Core.InfoAdders;
|
using LDUninstaller.Core.InfoAdders;
|
||||||
|
|
@ -52,9 +54,67 @@ namespace LDUninstaller.UI
|
||||||
|
|
||||||
miniTreeMap.OnItemSelected += SelectAppFromTreemap;
|
miniTreeMap.OnItemSelected += SelectAppFromTreemap;
|
||||||
fullTreeMap.OnItemSelected += SelectAppFromTreemap;
|
fullTreeMap.OnItemSelected += SelectAppFromTreemap;
|
||||||
TraceLog("2. MainWindow ctor finished");
|
TraceLog($"2. MainWindow ctor finished, Icon={this.Icon}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnSourceInitialized(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnSourceInitialized(e);
|
||||||
|
SetNativeWindowIcon();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetNativeWindowIcon()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var helper = new WindowInteropHelper(this);
|
||||||
|
IntPtr hwnd = helper.Handle;
|
||||||
|
if (hwnd == IntPtr.Zero) return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var uri = new Uri("pack://application:,,,/LDUninstaller.UI;component/Resources/app.ico", UriKind.Absolute);
|
||||||
|
this.Icon = System.Windows.Media.Imaging.BitmapFrame.Create(uri);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
string icoPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "app.ico");
|
||||||
|
IntPtr hIconBig = IntPtr.Zero;
|
||||||
|
IntPtr hIconSmall = IntPtr.Zero;
|
||||||
|
|
||||||
|
if (File.Exists(icoPath))
|
||||||
|
{
|
||||||
|
hIconBig = LoadImage(IntPtr.Zero, icoPath, 1, 32, 32, 0x00000010);
|
||||||
|
hIconSmall = LoadImage(IntPtr.Zero, icoPath, 1, 16, 16, 0x00000010);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hIconBig == IntPtr.Zero || hIconSmall == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
string exe = Process.GetCurrentProcess().MainModule?.FileName ?? "";
|
||||||
|
ExtractIconEx(exe, 0, out IntPtr hL, out IntPtr hS, 1);
|
||||||
|
if (hIconBig == IntPtr.Zero) hIconBig = hL;
|
||||||
|
if (hIconSmall == IntPtr.Zero) hIconSmall = hS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hIconBig != IntPtr.Zero)
|
||||||
|
SendMessage(hwnd, 0x0080, (IntPtr)1, hIconBig);
|
||||||
|
|
||||||
|
if (hIconSmall != IntPtr.Zero)
|
||||||
|
SendMessage(hwnd, 0x0080, (IntPtr)0, hIconSmall);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||||
|
private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
||||||
|
|
||||||
|
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||||
|
private static extern IntPtr LoadImage(IntPtr hinst, string lpszName, uint uType, int cxDesired, int cyDesired, uint fuLoad);
|
||||||
|
|
||||||
|
[DllImport("shell32.dll", CharSet = CharSet.Auto)]
|
||||||
|
private static extern int ExtractIconEx(string lpszFile, int nIconIndex, out IntPtr phiconLarge, out IntPtr phiconSmall, int nIcons);
|
||||||
|
|
||||||
|
|
||||||
private static void TraceLog(string msg)
|
private static void TraceLog(string msg)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 353 KiB |
BIN
test_bmp.ico
Normal file
|
After Width: | Height: | Size: 353 KiB |