473,396 Members | 2,151 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,396 software developers and data experts.

WaitCursor beyond my application

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;
Nov 16 '05 #1
2 2398
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]
Nov 16 '05 #2
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" <an*******@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.com...
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 this is the code in my windows form
-------------------------------------

Cursor oldCursor = Cursor.Current;
try
{
Cursor.Current = Cursors.WaitCursor;

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

DateTime dt = DateTime.Now.AddSeconds(10);
while(dt > DateTime.Now)
{
//do nothing
}

}
finally
{
Cursor.Current = Cursors.Default;
}

Nov 16 '05 #3

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

Similar topics

2
by: seash | last post by:
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...
2
by: KarenP | last post by:
In my Windows Forms application, while executing a process that takes some time, I am changing the cursor to the hourglass by setting Cursor.Current = Cursors.WaitCursor. This is working just...
10
by: Just Me | last post by:
Does Me.Cursor.Current=Cursors.WaitCursor set the current property of Me.Cursor to Cursors.WaitCursor And Me.Cursor.Current=Cursors.Default set the Me.Current property to something (default)...
1
by: veerleverbr | last post by:
Hi, In my VB.NET code, at a certain moment I set the cursor to the hourglass: Cursor = System.Windows.Forms.Cursors.WaitCursor Then a lot of things happen in my form, but also in other...
6
by: Lars | last post by:
Hi, I have created a simple custom PrintPreviewDialog consisting of a simple standard PrintPreviewControl (.NET 1.1) on a WindowsForm with a few buttons (for printing, zooming, etc.). It is...
2
by: Roberto Reale | last post by:
While developing a drag&drop enabled application I found out this "strange" behaviour: if I put a message box into the QueryContinueDrag event handler the message box is shown but the mouse cursor...
0
by: prathamesh.s.kulkarni | last post by:
I have a MDI Application. It has a simple menu. On clicking menu items, child forms open. Since, the loading of the form was taking quite sometime, I have separated the loading of data by using a...
0
by: =?Utf-8?B?a20=?= | last post by:
I've got a simple C# app built in VS2005. When I click a menu item a modal form opens and performs a lengthy operation in the Load event handler to populate a text control, so it takes a few...
1
by: =?Utf-8?B?TWFuaXNoIEJhZm5h?= | last post by:
Hi, I have tried hard but not able to show waitcursor in betwen different processes.I launch new application from current application by using system.diagnostics.proceesstartinfo.Till second...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.