PikeNote / taskbar-groups-pike-beta

Lightweight application that lets users create and pin groups to the Windows taskbar och desktop
MIT License
126 stars 9 forks source link

[Bug] Application crashes when editing a group that appeared blank (v2.2.0) #31

Open Darthagnon opened 1 year ago

Darthagnon commented 1 year ago
Crash Log (looooong) ``` See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at client.User_controls.ucProgramShortcut.ucProgramShortcut_SizeChanged(Object sender, EventArgs e) at System.Windows.Forms.Control.OnSizeChanged(EventArgs e) at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight) at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height) at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) at System.Windows.Forms.Control.ScaleControl(SizeF factor, BoundsSpecified specified) at System.Windows.Forms.ScrollableControl.ScaleControl(SizeF factor, BoundsSpecified specified) at System.Windows.Forms.Control.ScaleControl(SizeF includedFactor, SizeF excludedFactor, Control requestingControl) at System.Windows.Forms.ContainerControl.Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl) at System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean includedBounds, Boolean excludedBounds) at System.Windows.Forms.ContainerControl.PerformNeededAutoScaleOnLayout() at System.Windows.Forms.ContainerControl.OnLayoutResuming(Boolean performLayout) at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout) at client.User_controls.ucProgramShortcut.InitializeComponent() at client.User_controls.ucProgramShortcut..ctor() at client.Forms.frmGroup.LoadShortcut(ProgramShortcut psc, Int32 position) at client.Forms.frmGroup..ctor(frmClient client, Category category) at client.User_controls.ucCategoryPanel.cmdDelete_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 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.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.8.4110.0 built by: NET48REL1LAST_B CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll ---------------------------------------- Taskbar Groups Assembly Version: 0.2.2.0 Win32 Version: 0.2.2.0 CodeBase: file:///C:/Windows%20Tweaks_portable/TaskbarGroups/Taskbar.Groups.exe ---------------------------------------- System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.8.4110.0 built by: NET48REL1LAST_B CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System Assembly Version: 4.0.0.0 Win32 Version: 4.8.4110.0 built by: NET48REL1LAST_B CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.8.3761.0 built by: NET48REL1 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.8.4110.0 built by: NET48REL1LAST_B CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.8.3761.0 built by: NET48REL1 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.8.3761.0 built by: NET48REL1 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.8.3761.0 built by: NET48REL1 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- Microsoft.CSharp Assembly Version: 4.0.0.0 Win32 Version: 4.8.3761.0 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll ---------------------------------------- System.Net.Http Assembly Version: 4.0.0.0 Win32 Version: 4.8.3761.0 built by: NET48REL1 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Net.Http/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Net.Http.dll ---------------------------------------- Windows.Data Assembly Version: 255.255.255.255 Win32 Version: 10.0.10011.16384 CodeBase: file:///C:/Windows/system32/WinMetadata/Windows.Data.winmd ---------------------------------------- Windows.Foundation Assembly Version: 255.255.255.255 Win32 Version: 10.0.10011.16384 CodeBase: file:///C:/Windows/system32/WinMetadata/Windows.Foundation.winmd ---------------------------------------- Microsoft.WindowsAPICodePack.Shell Assembly Version: 1.1.4.0 Win32 Version: 0.2.2.0 CodeBase: file:///C:/Windows%20Tweaks_portable/TaskbarGroups/Taskbar.Groups.exe ---------------------------------------- Microsoft.WindowsAPICodePack Assembly Version: 1.1.4.0 Win32 Version: 0.2.2.0 CodeBase: file:///C:/Windows%20Tweaks_portable/TaskbarGroups/Taskbar.Groups.exe ---------------------------------------- System.Dynamic Assembly Version: 4.0.0.0 Win32 Version: 4.8.3761.0 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll ---------------------------------------- Anonymously Hosted DynamicMethods Assembly Assembly Version: 0.0.0.0 Win32 Version: 4.8.4110.0 built by: NET48REL1LAST_B CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll ---------------------------------------- ChinhDo.Transactions.FileManager Assembly Version: 1.5.0.1 Win32 Version: 0.2.2.0 CodeBase: file:///C:/Windows%20Tweaks_portable/TaskbarGroups/Taskbar.Groups.exe ---------------------------------------- System.Transactions Assembly Version: 4.0.0.0 Win32 Version: 4.8.3761.0 built by: NET48REL1 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll ---------------------------------------- netstandard Assembly Version: 2.0.0.0 Win32 Version: 4.8.3761.0 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/netstandard/v4.0_2.0.0.0__cc7b13ffcd2ddd51/netstandard.dll ---------------------------------------- Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.8.3761.0 built by: NET48REL1 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- Lnk Assembly Version: 1.3.2.0 Win32 Version: 0.2.2.0 CodeBase: file:///C:/Windows%20Tweaks_portable/TaskbarGroups/Taskbar.Groups.exe ---------------------------------------- System.Text.Encoding.CodePages Assembly Version: 7.0.0.0 Win32 Version: 0.2.2.0 CodeBase: file:///C:/Windows%20Tweaks_portable/TaskbarGroups/Taskbar.Groups.exe ---------------------------------------- ExtensionBlocks Assembly Version: 1.3.2.0 Win32 Version: 0.2.2.0 CodeBase: file:///C:/Windows%20Tweaks_portable/TaskbarGroups/Taskbar.Groups.exe ---------------------------------------- GuidMapping Assembly Version: 1.1.0.0 Win32 Version: 0.2.2.0 CodeBase: file:///C:/Windows%20Tweaks_portable/TaskbarGroups/Taskbar.Groups.exe ---------------------------------------- System.Runtime.CompilerServices.Unsafe Assembly Version: 6.0.0.0 Win32 Version: 0.2.2.0 CodeBase: file:///C:/Windows%20Tweaks_portable/TaskbarGroups/Taskbar.Groups.exe ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box. ```

Now, any time I try editing that group, the application crashes. Might be the same issue as #18

Darthagnon commented 1 year ago

Here's my portable settings that cause the crash: TaskbarGroups.zip

Darthagnon commented 1 year ago

Just noticed, some text is also cut off: Taskbar Groups_OnWWPhrcNc

PikeNote commented 1 year ago

Windows version? Just want to make sure. I'll do further testing in the morning. It is currently not reproducible on my Windows 10 system. I have tried the following

  1. Taking the .exe and then turning on portability mode immediately and then trying to add extensions
  2. Taking the .exe, turning on portability, create a group, close the .exe, open it back up and create a new group

I have tried using my own groups and the group you provided as sample and it seems to not react badly in this environment at least.

ucProgramShortcut having that error of Object reference not set to an instance of an object. is very odd, considering everything should be initialized and defined.

If you'd like, you can try to attach the Visual Studios debugger to the running .exe and see if the invisible icons trigger any exceptions. You may have to go to Debug -> Windows -> Exception Settings and click "Common Language Runtime Exceptions" to make it a checkmark so it covers everything. Doing this will give you errors in certain sections such as var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resource) which is normal.

Darthagnon commented 1 year ago

Windows 10

(1709, 16299)

Tested, and it happens without fail every time, portable mode, non-portable mode, shortcuts dragged from Desktop, Start Menu, etc.

Should be noted that the HiDPI fork of the original master branch works perfectly.

Is there any other way of debugging that doesn't involve multiple installing gigabytes of Visual Studio? (else, I'll take a look and see if I've still got it installed anywhere)

PikeNote commented 1 year ago

Hmm- I'll have to see. I haven't thought of anything major that would affect it. Is it constant that it happens and is it only on portability mode? Just want to confirm those details.

The text cutting out issue seems to stem from the Hi-DPI. Even though the fix was merged in, seems like some issues still persist since extra elements were added to UI from the original branch. I'll have to re-examine and possibly fix some parts of it to fit with the current stuff.

PikeNote commented 1 year ago

Update: Found the bug. Seems like the Size_Changed gets called before the components gets initialized properly because of the Hi-DPI rescaling. Currently, I am re-examining the layout + the Hi-DPI patch. I am thinking of redoing some panels to allow better adjustments at higher DPIs. This will be fixed once I start making changes to the application to allow it to function better/easier to maintain in a Hi-DPI environment. This may take some time to properly be patched in.

PikeNote commented 1 year ago

Taskbar Groups.zip @Darthagnon Here is an updated application on the latest build. See if the issue is resolved.

Note: You may get a directory access error the first time launching it if the old background.exe is running. I changed the method of how the background.exe is killed, so it is a lot more gracefully and avoids the tray icon duplication bug.

Daemonias commented 1 year ago

Taskbar Groups.zip @Darthagnon Here is an updated application on the latest build. See if the issue is resolved.

Note: You may get a directory access error the first time launching it if the old background.exe is running. I changed the method of how the background.exe is killed, so it is a lot more gracefully and avoids the tray icon duplication bug.

I'm not the OP but I had the same issue and tried this updated Version on Windows 10 and the not portable mode. It still doesnt work.

image

Informationen über das Aufrufen von JIT-Debuggen anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

** Ausnahmetext ** System.MissingMethodException: Methode nicht gefunden: "Void ChinhDo.Transactions.IFileManager.DeleteDirectory(System.String)". bei client.Forms.frmGroup.cmdSave_Click(Object sender, EventArgs e) bei System.Windows.Forms.Control.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) bei System.Windows.Forms.Control.WndProc(Message& m) bei System.Windows.Forms.ButtonBase.WndProc(Message& m) bei System.Windows.Forms.Button.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

** Geladene Assemblys ** mscorlib Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4515.0 built by: NET48REL1LAST_C. CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll.

Taskbar Groups Assembly-Version: 0.2.2.1. Win32-Version: 0.2.2.1. CodeBase: file:///F:/Programme/TaskbarGroups/Taskbar%20Groups%203.exe.

System.Windows.Forms Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4550.0 built by: NET48REL1LAST_C. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.

System Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4536.0 built by: NET48REL1LAST_C. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll.

System.Drawing Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4390.0 built by: NET48REL1LAST_C. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.

System.Core Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4590.0 built by: NET48REL1LAST_B. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll.

System.Xml Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4084.0 built by: NET48REL1. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll.

System.Configuration Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4190.0 built by: NET48REL1LAST_B. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll.

mscorlib.resources Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4084.0 built by: NET48REL1. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_de_b77a5c561934e089/mscorlib.resources.dll.

Microsoft.GeneratedCode Assembly-Version: 1.0.0.0. Win32-Version: 4.8.4084.0 built by: NET48REL1. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll.

Microsoft.CSharp Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4084.0. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll.

System.Dynamic Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4084.0. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll.

Anonymously Hosted DynamicMethods Assembly Assembly-Version: 0.0.0.0. Win32-Version: 4.8.4515.0 built by: NET48REL1LAST_C. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll.

Kaitai.Struct.Runtime Assembly-Version: 0.10.0.0. Win32-Version: 0.2.2.1. CodeBase: file:///F:/Programme/TaskbarGroups/Taskbar%20Groups%203.exe.

System.Net.Http Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4084.0 built by: NET48REL1. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Net.Http/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Net.Http.dll.

Windows.Data Assembly-Version: 255.255.255.255. Win32-Version: 10.0.10011.16384. CodeBase: file:///C:/WINDOWS/system32/WinMetadata/Windows.Data.winmd.

Windows.Foundation Assembly-Version: 255.255.255.255. Win32-Version: 10.0.10011.16384. CodeBase: file:///C:/WINDOWS/system32/WinMetadata/Windows.Foundation.winmd.

ChinhDo.Transactions.FileManager Assembly-Version: 1.4.0.36. Win32-Version: 1.4.0.36. CodeBase: file:///F:/Programme/TaskbarGroups/ChinhDo.Transactions.FileManager.DLL.

System.Transactions Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4084.0 built by: NET48REL1. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll.

netstandard Assembly-Version: 2.0.0.0. Win32-Version: 4.8.4084.0. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/netstandard/v4.0_2.0.0.0__cc7b13ffcd2ddd51/netstandard.dll.

System.Windows.Forms.resources Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4084.0 built by: NET48REL1. CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.

** JIT-Debuggen ** Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der Konfigurationsdatei der Anwendung oder des Computers (machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden. Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.

Zum Beispiel:

Wenn das JIT-Debuggen aktiviert ist, werden alle nicht behandelten Ausnahmen an den JIT-Debugger gesendet, der auf dem Computer registriert ist, und nicht in diesem Dialogfeld behandelt.

PikeNote commented 1 year ago

@Daemonias Assuming you came from the old taskbar groups, you need to delete the old .dll in the same directory. I embedded the new .dll files into the application itself. The old .dll is outdated and the application grabs that first before the one embedded into it.

Darthagnon commented 1 year ago

@PikeNote Tested new update you posted above, and it works fantastically. Bug seems to be gone, and I'm loving how fast it now is, and the "multiple small icons in a folder" thing.

Maybe a new bug, though: weird multiple scrollbars, concatenation even though there's only 3 shortcuts added, and the window a few px smaller than my full vertical (125% HiDPI 1920x1080) (there must be a better way to present this info, and all those checkbox options. A grid for the shortcuts, rather than a list, since that's how they'll be presented anyway?) explorer_kGJUv65O6M

And the icons seem misaligned to bottom left in the popup: explorer_NXCNdPv17G

PikeNote commented 1 year ago

That's honestly a good idea. Icons layed out in a grid pattern and the usual select to change working directory, etc. can include the name. My only concern is repositioning/reordering of items. Drag and drop is the most obvious solution, but I'll have to look into if it is possible.

I'll look into the new bug with the horizontal scroll bars. I thought that was fixed after I adjusted the size of a few items, but I guess not.

The icon misalignment may come from the fact that with the recent commit, I did resize the icons before I put them into the frame. But now that I think about it, that does not work nicely with the other parts of the code because it most likely would use the resized image. I'll look into a fix.

BanCrash commented 1 year ago

That's honestly a good idea. Icons layed out in a grid pattern and the usual select to change working directory, etc. can include the name. My only concern is repositioning/reordering of items. Drag and drop is the most obvious solution, but I'll have to look into if it is possible.

I'll look into the new bug with the horizontal scroll bars. I thought that was fixed after I adjusted the size of a few items, but I guess not.

The icon misalignment may come from the fact that with the recent commit, I did resize the icons before I put them into the frame. But now that I think about it, that does not work nicely with the other parts of the code because it most likely would use the resized image. I'll look into a fix.

About the mislaignment, in my PR that should be fixed I think. At least I didn't see it after few tests.

PikeNote commented 1 year ago

Taskbar Groups.zip @Darthagnon Latest build from the repo. See if this fixes the issues you've encountered. Open up a secondary issue for the suggestion of grid pattern layout just to keep it organized.

Darthagnon commented 1 year ago

Taskbar Groups.zip @Darthagnon Latest build from the repo. See if this fixes the issues you've encountered. Open up a secondary issue for the suggestion of grid pattern layout just to keep it organized.

Taskbar_Groups_C2rctyrcVN