HOWTO: Obtain A Handle To the Current Cursor (230495)
The information in this article applies to:
- Microsoft Windows 2000 Server
- Microsoft Windows 2000 Advanced Server
- Microsoft Windows 2000 Professional
- Microsoft Win32 Application Programming Interface (API)
- Microsoft Windows XP Home Edition
- Microsoft Windows XP Professional
- the operating system: Microsoft Windows XP 64-Bit Edition
This article was previously published under Q230495 SUMMARY
The GetCursor() API is limited in that it does not, by default, return a handle to the current cursor when that cursor is owned by another thread. This article demonstrates a way to retrieve the current cursor regardless of what thread owns it; for example, when you wish to include the image of the cursor in a screen capture. Since the cursor is hidden whenever you use GDI operations to read or write from the screen, you need to explicitly draw the cursor into a screen capture if you want it included. With the code in this article, you can obtain a handle to the current cursor and then use the DrawIcon() API to draw it into the screen capture at the appropriate coordinates.
Modification Type: | Minor | Last Reviewed: | 4/3/2006 |
---|
Keywords: | kbDSWGDI2003Swept kbGDI kbhowto kbIcon KB230495 |
---|
|