tjackenpacken / taskbar-groups

Lightweight utility for organizing the taskbar through groups
MIT License
2.43k stars 202 forks source link

Unhandeld Exeption + maybe a solution? #118

Open 8JO8 opened 3 years ago

8JO8 commented 3 years ago

When I click on the Group in the Taskbar, an unhandeld exeption pops up: grafik

Some parts of the message are in German, because my Windows is German, I wrote a translation where it is needed, marked like a comment in the code, for example //something... These things are not part of the error message

Specs: Win10x64 20H2, Version 10.0.19042 Build 19042 I have 3 monitors, I think it has something to do with it. The error also pops up in the previous version 0.1.4

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

** Ausnahmetext ** System.ArgumentOutOfRangeException: Der Index lag außerhalb des Bereichs. Er darf nicht negativ und kleiner als die Sammlung sein.

//The index was out of range. It must not be negative and smaller than the collection.

Parametername: index

//Parameter name: index //In the following sentences, "bei" means at

bei System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) bei client.frmMain.SetLocation() in C:\Users\jacks\Desktop\Taskbar dev\main\main\Forms\frmMain.cs:Zeile 100. //Row 100 bei client.frmMain.frmMain_Load(Object sender, EventArgs e) in C:\Users\jacks\Desktop\Taskbar dev\main\main\Forms\frmMain.cs:Zeile 77. //Row 77 bei System.Windows.Forms.Form.OnLoad(EventArgs e) bei System.Windows.Forms.Form.OnCreateControl() bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) bei System.Windows.Forms.Control.CreateControl() bei System.Windows.Forms.Control.WmShowWindow(Message& m) bei System.Windows.Forms.Control.WndProc(Message& m) bei System.Windows.Forms.ScrollableControl.WndProc(Message& m) bei System.Windows.Forms.Form.WmShowWindow(Message& m) bei System.Windows.Forms.Form.WndProc(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

** Geladene Assemblys ** //loaded assemblys

mscorlib Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4341.0 built by: NET48REL1LAST_C. CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll.

TaskbarGroups Assembly-Version: 0.2.0.0. Win32-Version: 0.2.0.0. CodeBase: file:///D:/Lib/Downloads/TaskbarGroups/TaskbarGroups.exe.

System.Drawing 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.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.

System Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4300.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.Windows.Forms Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4341.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.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.

System.Core Assembly-Version: 4.0.0.0. Win32-Version: 4.8.4341.0 built by: NET48REL1LAST_C. 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.

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.

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.

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.

//Some stuff about JIT-Debugging, I am too lazy too translate it and I bet you dont need it. //If you need it, message me

8JO8 commented 3 years ago

I looked at your code and you are looking for the screen and everything, I dont think you need this. Maybe take a look at that:

private void openfrmMain()
        {
            Point position = Control.MousePosition;
            //Some Room for calculations, maybe position.Y = 5 or some cool stuff
            //position.X = ??;
            //position.Y = ??;

            using (var frm = new frmMain(position))
            {
                frm.StartPosition = FormStartPosition.Manual;
                frm.Left = position.X;
                frm.Top = position.Y;

                frm.ShowDialog();
            }
        }

Then, in frmMain you add a class variable: private Point _point;

In the constructor, you write to it (you need to give the form "Point point"): _point = point;

And then you add the Event Locationchanged:

        private void frmMain_LocationChanged(object sender, EventArgs e)
        {
            this.Location = _point;
        }
PikeNote commented 3 years ago

If it does involve a multi-monitor setup, #114 has a build of a fix in a pull request currently. That may fix your issue and if possible, can you test it? Thanks!

I will definitely take a look at the solution and if needed, implement it into the code.

8JO8 commented 3 years ago

My antivirus is flagging it and removing it instantly. I will disable it later and look at it, I have to go now.

Thank you for your response!