473,323 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Application in focus

How do I make my application back to focus during it is processing I switch
to other application and back ?

During my application processing, I open another application, eg. notepad.
Then I select my application, my application screen is in white.
Sep 5 '06 #1
4 3196
This isn't a focus issue, this is a matter of you doing all the
processing on the main UI thread.

Perform your processing on another thread, and leave the UI thread to
process messages, and you should have no problem switching back.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Alan T" <al*************@yahoo.com.auwrote in message
news:uf**************@TK2MSFTNGP02.phx.gbl...
How do I make my application back to focus during it is processing I
switch to other application and back ?

During my application processing, I open another application, eg. notepad.
Then I select my application, my application screen is in white.

Sep 5 '06 #2
Alan,

You have in my idea more possibilities to that as
the method
http://msdn2.microsoft.com/en-us/lib...rol.focus.aspx

or the properties
TopLevel and TopMost be aware that those can be annoying so when you use
them you can set them to true and direct than to false.

I hope this helps,

Cor
"Alan T" <al*************@yahoo.com.auschreef in bericht
news:uf**************@TK2MSFTNGP02.phx.gbl...
How do I make my application back to focus during it is processing I
switch to other application and back ?

During my application processing, I open another application, eg. notepad.
Then I select my application, my application screen is in white.

Sep 5 '06 #3
What I want to do is I want to let the process finish first before the user
can select the main form.
During the process the cursor is in "wait" type.
I just want to make the main form appear normal except cannot select the
controls on the form.If the main form appears in white, the user may think
the system is hang.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:%2****************@TK2MSFTNGP05.phx.gbl...
This isn't a focus issue, this is a matter of you doing all the
processing on the main UI thread.

Perform your processing on another thread, and leave the UI thread to
process messages, and you should have no problem switching back.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Alan T" <al*************@yahoo.com.auwrote in message
news:uf**************@TK2MSFTNGP02.phx.gbl...
>How do I make my application back to focus during it is processing I
switch to other application and back ?

During my application processing, I open another application, eg.
notepad. Then I select my application, my application screen is in white.


Sep 6 '06 #4
Hi,

This is what I did to solve my problem:

Main Form:
private void tsMnRebuild_Click(object sender, EventArgs e)

{

Thread KeywordThread = new Thread(new ThreadStart(this.ExecuteRebuild));

KeywordThread.Start();

}

private void ExecuteRebuild()

{

.........

.........

}

I have a conern:

Is there any possibility to make the main form crash if something happen to
the thread ?

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OP**************@TK2MSFTNGP04.phx.gbl...
Alan,

You have in my idea more possibilities to that as
the method
http://msdn2.microsoft.com/en-us/lib...rol.focus.aspx

or the properties
TopLevel and TopMost be aware that those can be annoying so when you use
them you can set them to true and direct than to false.

I hope this helps,

Cor
"Alan T" <al*************@yahoo.com.auschreef in bericht
news:uf**************@TK2MSFTNGP02.phx.gbl...
>How do I make my application back to focus during it is processing I
switch to other application and back ?

During my application processing, I open another application, eg.
notepad. Then I select my application, my application screen is in white.


Oct 11 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: titouille | last post by:
Hi everybody ! first, sorry for my poor english, I'm french mothertongue ;) technologies : -------------- Python 2.3 Twisted Matrix 1.2.0 wxPython 2.5.1
6
by: KS | last post by:
I have made a WebForm with log ON/OFF off users. There is a label that shows the total count off users logged on stored in Application("UserCount") It works fine if the users logs out WITH THE...
2
by: Urs Vogel | last post by:
Hi Is there a way to find out which application currently has the focus? I want to display a notification in a screen corner and give the focus back to the application which just had it, or can...
2
by: Gil | last post by:
can you set focus to the current access application through vba? lets say i tell access to open another application and that new application gains the focus and causes access to loose the focus....
0
by: euthymos | last post by:
Dear developers, I'm developing an application which uses MSWord Interop interface. When my application launches MSWord, my application itself loses the focus (even if MSWord is not visible). ...
4
by: Octavius Khan | last post by:
I have an application that runs in the system tray and I use global hotkeys to perform functions. When certain hotkeys are pressed, my system tray application may display a message box and...
1
by: cvairetti | last post by:
Hi, I just write an application in C# that show an interface with five button, each button starts an external application that it comes in front of the main C# application with focus on. When the...
3
by: Kbalz | last post by:
Hello - I've tried to search this, but the word Focus in searching always returns lots of control focusing. I would like my C# Win App to minimize, and focus a program that is already running,...
2
by: petinboy | last post by:
Hi All! I am developing an accessibility keyboard application with Visual Studio 2005 Professional Edition and with C#. The application is a keyboard with buttons that interacts with any...
4
by: =?ISO-8859-15?Q?Albe_V=B0?= | last post by:
In my Application, I need to make a certain graphical refresh, interrogating SqlServer, only if Application has focus (i.e. the title bar is blue). Interrogating .Focused property of various...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.