evemondevteam / evemon

A lightweight, easy-to-use standalone Windows application designed to assist you in keeping track of your EVE Online character progression.
185 stars 171 forks source link

Excessive Hide/Show of window #84

Open wvdvegt opened 6 years ago

wvdvegt commented 6 years ago

Hi

When running evemon on a tablet (in tablet mode so with a fullscreen start menu, evemon hides and shows it's mainwindow a large number of times leading (whenever a character tile is added/updated it seems).

This leads to evemon disappearing and the windows menu to show (which looks quite annoying).

wvdvegt commented 6 years ago

It can be fixed by swapping code for this.SuspendDrawing() and this.ResumeDrawing() in LayoutTabPages of MainWindow.cs. SuspendDrawing is more for Controls and not for Forms.

        [DllImport("user32.dll")]
        public static extern bool LockWindowUpdate(IntPtr hWndLock);

        private void LayoutTabPages() {        
                LockWindowUpdate(Handle);

                try {
                        // code
                } finally {
                        // code
                        LockWindowUpdate(IntPtr.Zero);
                }
        }

Does a much better (quieter) job.