RE: hide cursor for kiosk application (powerpoint)
- From: v-lliu@xxxxxxxxxxxxxxxxxxxx (Linda Liu [MSFT])
- Date: Mon, 28 May 2007 02:24:27 GMT
Hi M,
Thank you for your reply.
After doing more research, I found out a workaround for this issue, that is
to change the system cursor to a 'transparent' cursor when the application
is run and restore the previous system cursor when the application is
terminated. To set the system cursor, we could use the SetSystemCursor
Win32 function.
The following is a sample.
using System.Runtime.InteropServices;
public partial class Form1 : Form
{
[DllImport("user32.dll")]
static extern bool SetSystemCursor(IntPtr hcur, int id);
[DllImport("user32.dll")]
static extern IntPtr LoadCursorFromFile(string lpFileName);
[DllImport("user32.dll")]
static extern IntPtr GetCursor();
[DllImport("user32.dll")]
static extern IntPtr CopyImage(IntPtr hImage,int uType,int
cxDesired,int cyDesired,int fuFlags);
int OCR_NORMAL = 32512;
int IMAGE_CURSOR = 2;
int LR_COPYDELETEORG = 0x0008;
void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
// restore the system cursor
SetSystemCursor(defaultCur, OCR_NORMAL);
}
private void Form1_Load(object sender, EventArgs e)
{
// get the handle of the current cursor
defaultCur = GetCursor();
// copy the default cursor to restore the system cursor when
the application exits
defaultCur = CopyImage(defaultCur, IMAGE_CURSOR, 0, 0,
LR_COPYDELETEORG);
// load a new transparent cursor
IntPtr hcur = LoadCursorFromFile(Application.StartupPath +
@"\transparent.cur");
// set the system cursor to the new transparent cursor
SetSystemCursor(hcur, OCR_NORMAL);
}
}
I searched the Internet and found a free cursor editor called RealWorld
Cursor Editor. You may use it to create a transparent cursor. You can
download it from the below link:
http://www.freedownloadscenter.com/Shell_and_Desktop/Cursor_Editing_Tools/Re
alWorld_Cursor_Editor.html
Hope this helps.
Sincerely,
Linda Liu
Microsoft Online Community Support
.
- Follow-Ups:
- RE: hide cursor for kiosk application (powerpoint)
- From: lockness
- RE: hide cursor for kiosk application (powerpoint)
- References:
- RE: hide cursor for kiosk application (powerpoint)
- From: Linda Liu [MSFT]
- RE: hide cursor for kiosk application (powerpoint)
- From: lockness
- RE: hide cursor for kiosk application (powerpoint)
- From: Linda Liu [MSFT]
- RE: hide cursor for kiosk application (powerpoint)
- From: lockness
- RE: hide cursor for kiosk application (powerpoint)
- From: Linda Liu [MSFT]
- RE: hide cursor for kiosk application (powerpoint)
- From: Linda Liu [MSFT]
- RE: hide cursor for kiosk application (powerpoint)
- Prev by Date: RE: How can I copy to the clipboard the contents of cells in a Dat
- Next by Date: RE: Expired certificates in the clickonce manifest.
- Previous by thread: RE: hide cursor for kiosk application (powerpoint)
- Next by thread: RE: hide cursor for kiosk application (powerpoint)
- Index(es):
Relevant Pages
|
Loading