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

Getting Cursor Information & the Hot Spot?

I apologize for cross posting, but I don't know the best place to post this.

This link is a pretty good overview of the various System Cursor routines.
http://www.rocklyte.com/pandora/manu...es/screen.html

I am trying to capture the system cursor & superimpose it on a screen shot
bit map. The problem I am encountering is custom cursors. Custom cursors
have hot spots that are often "off". SetCustomCursor() lets you define the
hot spot, but I don't know how to get it once an application has set it....

Is there a way to determine the "Hot Spot" of a custom cursor? Or maybe
there is a better way to do this in VB.Net?

This code works great when I am dealing with a standard cursor, it doesn't
work right when an application is using a custom cursor:
Thanks in advance for any help!

-----

Private Declare Function GetCursorInfo Lib "User32.dll" (ByRef pCI As
CursorInfo) As Integer

Private Declare Function GetCursorPos Lib "User32.dll" (ByVal lpPoint As
PointAPI) As Integer

Private Declare Function DrawIconEx Lib "User32.dll" (ByVal hDC As Integer,
_

ByVal xLeft As Integer, ByVal yTop As Integer, ByVal hIcon As
Integer, _

ByVal cxWidth As Integer, ByVal cyWidth As Integer, ByVal
istepIfAniCur As Integer, _

ByVal hbrFlickerFreeDraw As Integer, ByVal diFlags As Integer) As
Integer

------

Private Const CURSOR_SHOWING As Long = &H1

Private Const DI_NORMAL As Long = &H3

------

Dim CurInf As CursorInfo

Dim CurPos As PointAPI

CurInf.cbSize = Len(CurInf)

Call GetCursorInfo(CurInf)

If (CurInf.flags And CURSOR_SHOWING) Then

Call DrawIconEx(hMDC, CurInf.ptScreenPos.X, CurInf.ptScreenPos.Y,
CurInf.hCursor, 0, 0, 0, False, DI_NORMAL)

End If

-----
Nov 21 '05 #1
0 2276

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

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
3
by: robert | last post by:
Mr. Kyte's article doesn't use cursors, while Mr. Feuerstein's book examples do. my recollection of conventional wisdom is to avoid using cursors. is this difference merely a question of style,...
1
by: David Battams | last post by:
Ok, this is possibly the dumbest question ever asked on a MS.Net forum, but I cannot for the life of me work out how to enable the set hotspot button to set a cursor hotspot in .Net 2002 or 2003....
1
by: ravi | last post by:
I have created the following interest to calculate the interest for the following currency pairs. I have tried to combine them in macros using conditions but the next query that is run in the macro...
1
by: John J. Hughes II | last post by:
Using the Visual C#.Net editor I have created a cursor.cur file as a resource. I would like to be able to set the hotspot. The problem is the "Set Hotspot Tool" is deselected. Anyone have a clue...
1
by: antipode | last post by:
That's about it. If I make a cursor of any size and color depth, the button to set the hot spot stays disabled. I'm at my wit's end, and yet I know it's got to be something stupid I'm missing.
4
by: **Developer** | last post by:
I have a Listbox application. I allow users to drag items from one spot in the listbox to another spot. I also allow them to drag to, say, WordPad In the DoDragDrop I use DragDropEffects.Copy so...
3
by: GISDude | last post by:
Hi all. I am trying to create a little script(I think) that will basically use a search cursor. I am a GIS(geographic information systems) Analyst and in our software(ESRI ARCGIS 9.1) ESRI has...
2
by: juan.gautier | last post by:
Hi, I try to construct a SQL code for a view to select a specific data from a table, this query take the value of the filter from a text box in a visual basic 6.0 form. my problem is when i...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.