WaitCursor beyond my application

G

Guest

H
i had set WaitCursor for some processing in my application, This works fine for my Windowsform, but i want to extend this wait cursor to all other programs i.e only waitcursor(hourglass) should appear on my screen irrespective of Mouse position on any application on the screen

when i move mouse cursor(hour glass) from out of my application it is changing to default cursor(with hour glass), i think it is normal. but i want the hourglass to stay on till the processing in my application finishes, that means i should not be able to click on any thing on my screen

this is because when i click on any other applications during processing(hourglass) in my application , my application is crashin
this is the code in my windows for
------------------------------------

Cursor oldCursor = Cursor.Current
tr

Cursor.Current = Cursors.WaitCursor;

...............SOME PROCESSING............

DateTime dt = DateTime.Now.AddSeconds(10);
while(dt > DateTime.Now)

//do nothing
}


finally
{
Cursor.Current = Cursors.Default;
 
M

Morten Wennevik

Hi seash,

May I ask why you want this functionality? It appears to me that you want
your application to effectively take control of Windows when it wants to,
and I highly doubt you will be able to do that. You should instead figure
out why your program chrashes and fix it.

Happy coding!
Morten Wennevik [C# MVP]
 
G

Gary Milton

Hi Seash,

Simply setting the mousepointer to an hourglass will not prevent input into
an application. You would need to 'lock' all the other windows on the
desktop and also somehow prevent any other processes from starting - not
particulrly user friendly considering that Windows is supposed to be a
multi-tasking environment.

What sort of processing are you doing that you want to prevent the user from
using the rest of the system? It suggest that a better option would be to
root out the cause of your problem rather than trying to use a workaround
which is going to be extremely user unfriendly.

Gary

seash said:
Hi
i had set WaitCursor for some processing in my application, This works
fine for my Windowsform, but i want to extend this wait cursor to all other
programs i.e only waitcursor(hourglass) should appear on my screen
irrespective of Mouse position on any application on the screen.
when i move mouse cursor(hour glass) from out of my application it is
changing to default cursor(with hour glass), i think it is normal. but i
want the hourglass to stay on till the processing in my application
finishes, that means i should not be able to click on any thing on my
screen.
this is because when i click on any other applications during
processing(hourglass) in my application , my application is crashing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top