Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Test the code and you will see how the task bar appears.
I have recorded a video file to see what is going wrong:
https://www.youtube.com/watch?v=1dZJZjpq99Y[^]

Code:
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            FormBorderStyle = FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
        }

        private const int WM_SETREDRAW = 0x000B;

        private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            Message msgSuspendUpdate = Message.Create(this.Handle, WM_SETREDRAW, IntPtr.Zero,
                    IntPtr.Zero);

            NativeWindow window = NativeWindow.FromHandle(this.Handle);
            window.DefWndProc(ref msgSuspendUpdate);


            IntPtr wparam = new IntPtr(1);
            Message msgResumeUpdate = Message.Create(this.Handle, WM_SETREDRAW, wparam,
                IntPtr.Zero);

            NativeWindow window2 = NativeWindow.FromHandle(this.Handle);
            window2.DefWndProc(ref msgResumeUpdate);
        }
    }
}
Posted
Updated 12-Mar-15 7:47am
v7
Comments
Sergey Alexandrovich Kryukov 12-Mar-15 12:02pm    
At first glance, you are trying to make things more complex than you have to.
First hint for you: activation and focusing are different things. A form is not "focused" at all; it if has some control, only a control is focused. This is keyboard focus, nothing else. There is only one focused control at at time on the whole desktop.
—SA
Ziya1995 12-Mar-15 12:19pm    
Can you fix the problem?
I would be happy.
Ziya1995 12-Mar-15 13:21pm    
Take a look, now the code is simple and i also uploaded a video file:
https://www.youtube.com/watch?v=1dZJZjpq99Y
Forget the code from another thread, follow only this thread.
Richard MacCutchan 12-Mar-15 12:28pm    
Instead of opening this question, you should have edited the original. Multiple questions on the same issue are impossible to follow.
Ziya1995 12-Mar-15 12:35pm    
That was different question, that is why i asked in another thread, i hope it makes no serious problems.

So, can you solve this problem?
I can record a video to show what is going wrong.
It is a bit complicated.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900