L
L
LiptonOlolo2016-06-15 13:09:52
C++ / C#
LiptonOlolo, 2016-06-15 13:09:52

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());
            }
        }

But, for example, when I move the cursor over "Close" in the program (Well, the red cross), the cursor becomes normal, how can I fix this and leave the one that I have?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zelimkhan Beltoev, 2016-06-15
@LiptonOlolo

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 question

Ask a Question

731 491 924 answers to any question