473,225 Members | 1,369 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,225 software developers and data experts.

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.CopyHandle())
- 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 5632
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.CopyHandle())
- 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.CopyHandle())
- 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
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...
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)...
2
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
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...
0
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. ...
0
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...
0
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...
0
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...
7
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.