473,788 Members | 2,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checking cursor type

ACS
I have a C# application where I've grabbed a control's cursor handle
using the WINAPI function GetCursor(). This returned an IntPtr and I
want to check what type of cursor this is (arrow, sizing, hourglass,
etc.)

I've tried the following:
- Comparing the IntPtr to C#'s predefined cursor types (i.e.
Cursors.Arrow.C opyHandle())
- Comparing the IntPtr to another IntPtr obtained using the WINAPI
function LoadCursor

With different variations but none seem to work. Does anyone have any
ideas?
Jun 27 '08 #1
2 5683
ACS
After doing a bit of research, it seems one option might be to capture
the bitmap image of the cursor and compare it against the bitmap image
of a standard cursor. Unfortunately I don't see a way of doing this
having just the cursor's handle...

On Apr 15, 12:05 am, ACS <volt9...@gmail .comwrote:
I have a C# application where I've grabbed a control's cursor handle
using the WINAPI function GetCursor(). This returned an IntPtr and I
want to check what type of cursor this is (arrow, sizing, hourglass,
etc.)

I've tried the following:
- Comparing the IntPtr to C#'s predefined cursor types (i.e.
Cursors.Arrow.C opyHandle())
- Comparing the IntPtr to another IntPtr obtained using the WINAPI
function LoadCursor

With different variations but none seem to work. Does anyone have any
ideas?
Jun 27 '08 #2
ACS
Ok well it seems what I was attempting to do was futile since I found
a much easier way of doing it.

Basically what I'm doing is this: I'm detecting if a cursor changes to
a particular type in a particular control; in this case the split/
resize cursor in the ListView. This cursor appears when there is a 0-
width column in a ListView and you hover the mouse directly to the
right of it. This cursor has a double vertical bar and appears in
place of the default resize cursor, which has only a single vertical
bar (when merely resizing a column without another hidden column.)

The problem is, the "default" resizer (single vertical bar) is NOT the
same as Cursors.VSplit since the ListView control apparently has some
custom cursors embedded in it.
So my new question is this: Is there any way to extract or access
these custom cursors so I can tell what Cursor.Current is set to?

On Apr 15, 12:24 am, ACS <volt9...@gmail .comwrote:
After doing a bit of research, it seems one option might be to capture
the bitmap image of the cursor and compare it against the bitmap image
of a standard cursor. Unfortunately I don't see a way of doing this
having just the cursor's handle...

On Apr 15, 12:05 am, ACS <volt9...@gmail .comwrote:
I have a C# application where I've grabbed a control's cursor handle
using the WINAPI function GetCursor(). This returned an IntPtr and I
want to check what type of cursor this is (arrow, sizing, hourglass,
etc.)
I've tried the following:
- Comparing the IntPtr to C#'s predefined cursor types (i.e.
Cursors.Arrow.C opyHandle())
- Comparing the IntPtr to another IntPtr obtained using the WINAPI
function LoadCursor
With different variations but none seem to work. Does anyone have any
ideas?
Jun 27 '08 #3

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

Similar topics

3
17311
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting seems to be ignored completely, even when I try with window.setTimeout. So my two questions are: (1) Most important: Is there anything I can do so that I don't have to wait for the next mouse event before the cursor gets repainted. (2) Why...
10
17374
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) stored in Me.Cursor. Or is Cursors.Default some process wide cursor shape? What is a correct statement?
2
6304
by: John Salerno | last post by:
Is there a way to check if a SQLite connection and cursor object are still open? I took a look at the docs and the DB API but didn't see anything like this. Thanks.
0
11792
debasisdas
by: debasisdas | last post by:
SAMPLE CODE USING RECORD =========================== declare cursor c1 is select * from dept; type drec is record (a dept.deptno%type, b dept.dname%type, c dept.loc%type); type ttype is table of drec index by binary_integer; dr drec;
0
18041
debasisdas
by: debasisdas | last post by:
RESTRICTIONS ON CURSOR VARIABLES ================================= Currently, cursor variables are subject to the following restrictions: Cannot declare cursor variables in a package spec. CREATE PACKAGE emp_stuff AS TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE; emp_cv EmpCurTyp; -- not allowed END emp_stuff;
0
4676
debasisdas
by: debasisdas | last post by:
This thread contains some useful tips/samples regarding some advance concepts in cursors. FEW MORE EXAMPLES =================== declare er emp%rowtype; cursor c1 is select * from emp; begin open c1;
0
4815
debasisdas
by: debasisdas | last post by:
SAMPLE CODE TO SHOW USE OF REFCURSOR ======================================= EXAMPLE #1 ---------------------- declare --declare the fer cursor. type my_ref_cur_typ is ref cursor; --declare a variable of rec cursor type. my_ref_cur my_ref_cur_typ;
0
8043
debasisdas
by: debasisdas | last post by:
Cursor Variable Returning %ROWTYPE ----------------------------------------------------------- DECLARE TYPE TmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE; tmp_cv TmpCurTyp;TYPE EmpCurTyp IS REF CURSOR RETURN tmp_cv%ROWTYPE; emp_cv EmpCurTyp; BEGIN NULL;
7
1836
by: nospam | last post by:
Hello I need to go through each line of a CSV file, and extract some fields using a regex. Then, I need to check each retrieved field, and if it looks like "", turn this into NULL so that it's correct SQL. I tried a few things, but still can't it working: ======== #Second field might be empty -"" #"Col1",""
0
9498
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,...
1
10113
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
8995
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...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5402
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...
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.