I stuck in the problem using the custom cursor as it is
coming in black and white color rahter than the original
color.
As windows forms does not supprot color and animated
cursors.
I saw one question regarding the same problem as mine but
I got confused how to Invoke the LoadCursorFromFile()
in .cs file directly !!
Cursor cursor = new Cursor ( new IntPtr (LoadCursorFromFile
("Ear.cur" )));
this.Cursor = cursor
Could anybody help me on this matter !!
Looking forward for help !!
Thanks in advance
Govil
This is a known issue of Cursor class. You may call LoadCursorFromFile via
PInvoke to load it directly. This is a sample code:
using System.Runtime.InteropServices;
[DllImport("user32.dll", EntryPoint="LoadCursorFromFile")]
public static extern int LoadCursorFromFile(String FileName);
private void button1_Click(object sender, System.EventArgs e)
{
Cursor cursor=new Cursor(new IntPtr(LoadCursorFromFile(@"Ear.cur")));
this.Cursor=cursor;
}
For more information about hoe to call a API via PInvoke please see:
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocatio
nServices.asp
Hope it helps.
Best regards,
Lion Shi [MSFT]
MCSE, MCSD
Microsoft Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.
--------------------
Content-Class: urn:content-classes:message
From: "govil" <govi...@vsnl.net>
Sender: "govil" <govi...@vsnl.net>
Subject: Custom Cursor Black and white color only????
Date: Tue, 10 Dec 2002 18:53:48 -0800
Lines: 24
Message-ID: <034c01c2a0c0$873249a0$d7f82ecf@TK2MSFTNGXA14>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcKgwIcy6Rg8ExVuQOiRHn7+cTuVBA==
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
Path: cpmsftngxa06!cpmsftngxa10!cpmsftngxa09
Xref: cpmsftngxa06 microsoft.public.dotnet.languages.csharp:115563
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp