Answer the question
In order to leave comments, you need to log in
How to set Cursor for everything?
Good afternoon.
There is a method that sets the cursor for the form:
[DllImport("User32.dll", SetLastError = true)]
static extern IntPtr LoadCursorFromFile(String str);
void SetCursor(string FileName)
{
IntPtr hCursor = LoadCursorFromFile(FileName);
if (!IntPtr.Zero.Equals(hCursor))
{
Cursor = new Cursor(hCursor);
}
else
{
MessageBox.Show("Ошибка загрузки курсора \n" + Marshal.GetLastWin32Error());
}
}
Answer the question
In order to leave comments, you need to log in
To change the cursor throughout the OS (the cross area is no longer inside your application), you will need to go into the registry when you start the application and remember to restore the cursor when you close it.
A simple example of the above: stackoverflow.com/a/15016529
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question