Abdelrhman-AK / WinPaletter

Advanced Windows Appearance Editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

:x: [Error] Can't apply theme

MuscularPuky opened this issue · comments

❌ Error report

Describe the error

  • When I try to apply theme, WinPlaetter crashes

How to reproduce the error

    1. open theme file I saved before update
    1. it prompt 2 JSON errors
    1. try to apply but it crashes

WinPaletter Log

//General information
//...........................................................
   Report.Date = "2024년 2월 27일 화요일 오전 1:52:34";
   OS = "Windows 11, 10.0.26058.1000, 64-bit";
   WinPaletter.Version = "1.0.8.6, 베타, Build: Release";
   WinPaletter.Language = "한국어(대한민국)";
   WinPaletter.Debugging = false;

//Error details
//...........................................................
   Exception.message = "Cannot access a disposed object.
Object name: 'Icon'.";
   Exception.type = "System.ObjectDisposedException";
   Exception.stack.trace =
   {
      at System.Drawing.Icon.get_Handle()
      at System.Windows.Forms.Form.UpdateWindowIcon(Boolean redrawFrame)
      at System.Windows.Forms.Form.set_Icon(Icon value)
      at WinPaletter.Dialogs.ThemeLog.ThemeLog_Load(Object sender, EventArgs e)
      at System.Windows.Forms.Form.OnLoad(EventArgs e)
      at System.Windows.Forms.Form.OnCreateControl()
      at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
      at System.Windows.Forms.Control.CreateControl()
      at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
      at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
      at System.Windows.Forms.Form.OnVisibleChanged(EventArgs e)
      at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
      at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
      at System.Windows.Forms.Control.Show()
      at WinPaletter.Tabs.TabsContainer.AddFormIntoTab(Form form)
      at WinPaletter.Dialogs.ThemeLog.Apply_Theme(Manager TM, Boolean AdditionalStoreTips, Boolean dontInvoke)
      at WinPaletter.Home.apply_btn_Click(Object sender, EventArgs e)
      at System.Windows.Forms.Control.OnClick(EventArgs e)
      at System.Windows.Forms.Button.OnClick(EventArgs e)
      at WinPaletter.UI.WP.Button.OnClick(EventArgs e)
      at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
      at WinPaletter.UI.WP.Button.OnMouseUp(MouseEventArgs e)
      at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
      at System.Windows.Forms.Control.WndProc(Message& m)
      at System.Windows.Forms.ButtonBase.WndProc(Message& m)
      at System.Windows.Forms.Button.WndProc(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
      at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   };
   Exception.target.void_function = "System.Drawing.get_Handle()";
   Exception.assembly = "System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
   Exception.assembly.file = "C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Drawing\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Drawing.dll";
   Exception.HRESULT = -2146232798;

Screenshots/Screen records

  • Don't add screenshot to exception error dialog if you already wrote WinPaletter Log.
  • If possible, add screenshots/Screen records of the wrong behaviour to help explain your problem.

Additional context

  • After save the theme on 1.0.8.6, the JSON errors gone. Maybe only theme file saved on ~1.0.8.4 cause this? I don't know

+I'm testing more deflects, like wi-fi connected/disconnected, etc. I'll tell you as enhancement when I'm done :)

I'll try to reproduce this and fix this. It is mainly not from theme JSON file, it is from adding form into tabs.

it prompt 2 JSON errors

It is a known issue that you can safely ignore. It results from the massively changed Windows Terminal structure in WinPaletter class. I made these changes to make implementing new Windows Terminal features easier, and make this class better in readability for any developer will open this class.

+I'm testing more deflects, like wi-fi connected/disconnected, etc. I'll tell you as enhancement when I'm done :)

I'll be waiting for these new ideas :)
Once their event IDs are known, implementing these new sounds deflections will be easy.

I have just implemented Wi-Fi sounds

Connection: *[System[(EventID = 8000)]]
Disconnection: *[System[(EventID = 8003)]]

Both will be available in the next update

Oh you're quick!
Actually I'm comparing 8000, 8001, 11000, 11001 and found out these IDs are like lifecyle. not only these there is also about 30 events but would be too much.
I summerized events roughly but some events seem to actually not work:
4003 Wi-Fi error and auto recoverin.txt

It would be better 11001 than 8000/8001 I think because virtual adaptor also uses that event

I have used event viewer to watch the events:

11001: Wireless network association succeeded.

It is triggered correctly when there is a connection.

So, what ID will be used for disconnection instead of 8003 (As you said that 8003 may be used by virtual adaptor)?

There is 11004 triggered too by disconnection, but it is relevant to WLAN security.

11004: Wireless security stopped.

I write some event lifecycle in this roughly: 8000 - 11000 - 11001 - 10010 - 10005 - 8001 - 11004 - 8003

I have tested these IDs, 11001 plays the sound first then a delay happens before connection is triggered and before taskbar icon change. And this behavior is identical to 8001.

I am going to use 11001 for Wi-Fi connection, 8003 for Wi-Fi disconnection.

Tell me if I should use these IDs and release the new update or not.

👍 How about triggering failed to connect (8002) too?

Great! I'll add it, and push the new update either today or tomorrow.

And please tell me whether the main issue (exception error) has been resolved in the new update or not. I have been unable to reproduce it myself, despite attempting code fixes based on the provided details.

Tell me if the issue is fixed or not.