Here is a code from another post in StackOverFlow, which will change cursor in window caption:
protected override void WndProc(ref Message m) {
if (m.Msg == 0x20) { // Trap WM_SETCUROR
if ((m.LParam.ToInt32() & 0xffff) == 2) { // Trap HTCAPTION
Cursor.Current = Cursors.Hand;
m.Result = (IntPtr)1; // Processed
return;
}
}
base.WndProc(ref m);
}
Source: https://stackoverflow.com/a/6484627/4871566
But there are three additional problems I want to solve:
1- While moving the window (with holding down the left-mouse button) the cursor will change to its windows default again. Is there any way to change cursor to my chosen one while moving the form window?
2- When I load a child form as ShowDialog()
, the main form will be disable and user can not interact with it.I can change The cursor in child form's area, but when the cursor is outside the child form's area (window), it will be the system windows default. Is there any way to change the cursor here outside?
3- Is there any way to change cursor of Message Boxes Caption Bar?