I load my custom cursor with the constructor call
System.Windows.Forms.Cursor mycursor=new
System.Windows.Forms(GetType(),"MyCursor.Cur");
and the appropriate command line
csc -target:winexe -res:MyCursor.Cur,MyNamespace.MyCursor.Cur *.cs
This works well. But if I want to have a static cursor, I cannot use
GetType(). Fortunately there is another constructor that does without
GetType():
System.Windows.Forms.Cursor mycursor=new
System.Windows.Forms("MyCursor.Cur");
and the same command line. This also works well. But the problem is, in the
latter case, when I move the application out of original directory, the app
crashes. In the former case the resource is correctly linked in and I can
run the program from any directory.
How can I embed a static cursor in my application and run it from anywhere?
(The program size reveals that in the latter case the cursor IS embedded in
the app, but is not used, apperently)