Solved

How can i restore my application from taskbar in c#?

Posted on 2010-11-14
10
518 Views
Last Modified: 2012-05-10
How can i restore my application from taskbar in c#?
0
Comment
Question by:juliodiz
10 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 34133217
Under what conditions?

Maybe something like?

            if (this.WindowState == FormWindowState.Minimized)
            {
                this.WindowState = FormWindowState.Normal;
            }
0
 
LVL 8

Expert Comment

by:Subrat (C++ windows/Linux)
ID: 34133380
There is one property, ShowInTaskBar.....
If you want to show your UI in taskbar, you can make it true else false.
0
 

Author Comment

by:juliodiz
ID: 34133392
I try


        if (this.WindowState == FormWindowState.Minimized)
            {
                this.WindowState = FormWindowState.Normal;
            }

But didnt work.

Because when have a problem if the application is minimized i need to restore to the user see the problem.
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 34133471
If the application is not the foreground window then you also need to use the SetforegroundWindow() API to bring it to the front.
0
 

Author Comment

by:juliodiz
ID: 34133475
So

        if (this.WindowState == FormWindowState.Minimized)
            {
                this.WindowState = FormWindowState.Normal;
                SetforegroundWindow();
            }

?


0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 300 total points
ID: 34133669
You have to import it:

        [System.Runtime.InteropServices.DllImport("user32.dll")]
        private static extern int SetForegroundWindow (IntPtr hwnd);

        ...
            if (this.WindowState == FormWindowState.Minimized)
            {
                this.WindowState = FormWindowState.Normal;
                SetForegroundWindow(this.Handle);
            }
0
 

Author Comment

by:juliodiz
ID: 34133979
Didnt work  , not restore from the task bar

he stays in the taskbar minimized.
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 34133989
Does the taskbar by chance blink?

If not, give us more details about the setup and the conditions under which you need the app to restore.
0
 

Author Comment

by:juliodiz
ID: 34134002
I have a form Logado, and i need when have a problem the operator see the problem, but if the program is minimzed the operator will not see the problem.

So i need to restore the form from the taskbar
0
 
LVL 19

Assisted Solution

by:Shahan Ayyub
Shahan Ayyub earned 200 total points
ID: 34141082
Why not you use this(Form1_Resize) event:

private void Form1_Resize(System.Object sender, System.EventArgs e)
{
	if (this.WindowState == FormWindowState.Minimized)
        {
		this.WindowState = FormWindowState.Normal;
	}
}

Open in new window


So whenever the window will be minimized it will be restore.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now