473,804 Members | 3,278 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determining the current global cursor

Is there any way in C#/.NET to determine what the current global cursor is
being displayed? The .Net method Cursor.Current only applies to the running
application. I want to access the cursor even when my program is not in
control. I've done some reading and the best I've come across is the Windows
API call GetCursorInfo. This returns a struct that has some useful info such
as cursor position, but I don't see any way to determine from the
information what type of cursor is currently being displayed. One of the
struct's members is the handle to the current cursor, but I haven't been
able to find what the handle actually points to. Any tips would be
appreciated.
Nov 17 '05 #1
1 3682
Paul,

You can call the GetIconInfo function through the P/Invoke layer,
passing the cursor handle as a parameter to get the information about it.

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

"Paul Steele" <pa*********@ac adiau.ca> wrote in message
news:uH******** ******@TK2MSFTN GP14.phx.gbl...
Is there any way in C#/.NET to determine what the current global cursor is
being displayed? The .Net method Cursor.Current only applies to the
running application. I want to access the cursor even when my program is
not in control. I've done some reading and the best I've come across is
the Windows API call GetCursorInfo. This returns a struct that has some
useful info such as cursor position, but I don't see any way to determine
from the information what type of cursor is currently being displayed. One
of the struct's members is the handle to the current cursor, but I haven't
been able to find what the handle actually points to. Any tips would be
appreciated.

Nov 17 '05 #2

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

Similar topics

4
7413
by: Hugh Cowan | last post by:
Hello, I am currently running PHP 4.3.2 on Windows NT 4.0. Is there anyway (I am sure there is but I just can't find it) that you can determine the path of the current script that is running? I have created a command line script that processes some files and I would like to be able to drop the script in a given directory and then run it from there.
8
6604
by: Dan | last post by:
When a user clicks on a link in my menu, I want the background color of the link that comes up in the hover to remain on the destination page. My menu looks like this: <div id="adminmenu"> <a class="mainlink mainlink1" href="">Events</a><br> <a class="mainlink mainlink2" href="">Home Page Teaser</a><br> <a class="mainlink mainlink3" href="">Testimonials</a><br> <a class="mainlink mainlink4" href="">Repertoire</a><br>
2
7565
by: Ryan | last post by:
Access97 I hope someone out there can help. This is driving me crazy. Basically, I am trying to recreate VBA's built in navigation feature (The one that allows you to move first, next, previous, and last and also tells you that you are on Record # or . The navigation part was easy. My problem is determing the what record I am on and the total number of records. I put the following code into the my subforms on Current event:
4
9432
by: =?Utf-8?B?Sm9hY2hpbQ==?= | last post by:
Am I not supposed to be able to set the current cursor by assigning Cursor.Current? this.Cursor in the main dialog works, but not Cursor.Current other components. I am using a third party tool called SandDock to get Visual Studio 2005 look and feel. Could that library cause it not to work?
1
1645
by: Chris Shepherd | last post by:
According to the docs, setting Cursor.Current will change the cursor being displayed, and block mouse events: "Setting the Current property changes the cursor currently displayed, and the application stops listening for mouse events. For example, you might set the Current property to Cursors.WaitCursor before you start filling a TreeView, DataGrid, or ListBox control with a large amount of data. After the loop is completed, set this...
2
1609
by: Florian Lindner | last post by:
Hello, I have a little problem with the global statement. def executeSQL(sql, *args): try: import pdb; pdb.set_trace() cursor = db.cursor() # db is <type 'NoneType'>. except: print "Problem contacting MySQL database. Please contact root."
3
11514
by: barronmo | last post by:
I'm getting an error msg I don't understand, "global name EMR_globals is not defined", and could use some help. I've separated the application I'm building into several modules. One of the modules holds variables I need to pass from one module to another and is called 'EMR_globals'. Several other modules hold functions or user menus and then 'EMR_main' controls the initial user interaction. I'm using MySQL to hold the data. The...
9
30992
by: Frank Swarbrick | last post by:
New to SQL here... We have a CURSOR declared thusly: EXEC SQL DECLARE ALL-ADJSTMTS-CSR CURSOR FOR SELECT ACCT.ACCOUNT_ID , ACCT.APPL_ID , ACCT.BRANCH_NUMBER , ACCT.CATEGORY_CODE
1
6787
by: vituko | last post by:
plpgsql (postgresql 8.3 but I can upgrade) I can open a cursor with a dynamic query (table / column variable) : -open cursor for execute '...' ; But if I want do updates... - execute 'update ...' where current of cursor ?? Mmm I don't find the way. Another approach :
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10578
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10332
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9152
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5522
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.