I use custom cursors for dragdrop-operations. In remote desktop sessions only if remote machine runs Win8
the session completely freezes, if the cursor exceeds a certain size.
It works fine, if you work on physical Win8 machine or e.g. Xen Console. Also works fine on RDP with other target operating systems (Win7, Server 2008R2...)
I tried to break down the problem to the most simple case.
In the example below Cursors of 32x32 and 64x64 work fine, 200x200 just dont display anything, 500x500 will freeze everything
I debugged and logged everything, hang occurs _after_ code is completed and cursor is returned.
Can anyone give me some advice in which direction to go, as I'm quite clueless meanwhile. Is there another state-of-the-art way meanwhile to manipulate mouse cursors in winforms applications (i use .net 3.5)?
private void button_Click(object sender, EventArgs e)
int iCursorSizeFromButton = int.Parse((string)(sender as Button).Tag);
Bitmap bnew = new Bitmap(iCursorSizeFromButton, iCursorSizeFromButton);
using (Graphics g = Graphics.FromImage(bnew))
using (Brush b = new SolidBrush(Color.FromArgb(127, Color.LightBlue)))
g.FillRectangle(b, new Rectangle(0, 0, bnew.Width, bnew.Height)); g.DrawEllipse(Pens.Black, new Rectangle(bnew.Width / 2 - 2, bnew.Height / 2 - 2, 4, 4)); }
IntPtr Hicon = bnew.GetHicon();
Cursor c = new Cursor(Hicon);
this.Cursor = c;