Click here to Skip to main content
15,891,372 members
Home / Discussions / C#
   

C#

 
GeneralRe: Select treenode automatically Pin
kmb8918-Sep-09 22:50
kmb8918-Sep-09 22:50 
GeneralRe: Select treenode automatically Pin
Christian Graus18-Sep-09 22:56
protectorChristian Graus18-Sep-09 22:56 
GeneralRe: Select treenode automatically Pin
Christian Graus18-Sep-09 23:08
protectorChristian Graus18-Sep-09 23:08 
GeneralRe: Select treenode automatically Pin
kmb8918-Sep-09 23:31
kmb8918-Sep-09 23:31 
GeneralRe: Select treenode automatically Pin
Malcolm Smart19-Sep-09 2:31
Malcolm Smart19-Sep-09 2:31 
GeneralRe: Select treenode automatically Pin
PIEBALDconsult19-Sep-09 8:50
mvePIEBALDconsult19-Sep-09 8:50 
QuestionHow to set focus on a control in MVVM pattern. Pin
AmitSumit18-Sep-09 19:59
AmitSumit18-Sep-09 19:59 
AnswerRe: How to set focus on a control in MVVM pattern. Pin
Christian Graus18-Sep-09 20:13
protectorChristian Graus18-Sep-09 20:13 
AnswerRe: How to set focus on a control in MVVM pattern. Pin
Ravi Mori18-Sep-09 20:45
Ravi Mori18-Sep-09 20:45 
QuestionConverting Business Object to Data Transfer Object Pin
Saiyed Alam18-Sep-09 19:04
Saiyed Alam18-Sep-09 19:04 
AnswerRe: Converting Business Object to Data Transfer Object Pin
Christian Graus18-Sep-09 19:11
protectorChristian Graus18-Sep-09 19:11 
GeneralRe: Converting Business Object to Data Transfer Object Pin
Saiyed Alam18-Sep-09 20:52
Saiyed Alam18-Sep-09 20:52 
GeneralRe: Converting Business Object to Data Transfer Object Pin
Christian Graus18-Sep-09 22:24
protectorChristian Graus18-Sep-09 22:24 
AnswerRe: Converting Business Object to Data Transfer Object Pin
Tobias825-Nov-09 22:33
Tobias825-Nov-09 22:33 
Questionc# music resource Pin
discreetz18-Sep-09 18:56
discreetz18-Sep-09 18:56 
AnswerRe: c# music resource Pin
Christian Graus18-Sep-09 19:13
protectorChristian Graus18-Sep-09 19:13 
AnswerRe: c# music resource Pin
ck21618-Sep-09 23:57
ck21618-Sep-09 23:57 
GeneralRe: c# music resource Pin
discreetz19-Sep-09 6:12
discreetz19-Sep-09 6:12 
AnswerRe: c# music resource Pin
Ravi Bhavnani19-Sep-09 8:09
professionalRavi Bhavnani19-Sep-09 8:09 
Questionmshtml Event Object Model Pin
Jacobb Michael18-Sep-09 18:47
Jacobb Michael18-Sep-09 18:47 
AnswerRe: mshtml Event Object Model Pin
Ravi Mori18-Sep-09 20:40
Ravi Mori18-Sep-09 20:40 
Questionpassing reference types by reference Pin
lhyblue18-Sep-09 18:40
lhyblue18-Sep-09 18:40 
AnswerRe: passing reference types by reference Pin
Christian Graus18-Sep-09 19:14
protectorChristian Graus18-Sep-09 19:14 
GeneralRe: passing reference types by reference Pin
Luc Pattyn19-Sep-09 3:01
sitebuilderLuc Pattyn19-Sep-09 3:01 
QuestionCursor apply registry changes [modified] Pin
rick055618-Sep-09 16:15
rick055618-Sep-09 16:15 
I am working on a screen capture project that uses a global mouse hook. It works great.
currently when the user holds the right mouse button down for a time the cursor changes to a hand.
see below

[DllImport("user32.dll")]
static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName);
private int IDC_HAND = 32649; /// IDC_HAND = 32649;///IDC_UPARROW=32516///IDC_CROSS=32515
private const uint OCR_NORMAL = 32512;

on event

private void setcursor()
{
IntPtr hcursor = LoadCursor(IntPtr.Zero, IDC_HAND);/// IDC_HAND/// IDC_UPARROW//IDC_CROSS
bool ret_val = SetSystemCursor(hcursor, OCR_NORMAL);
}
What I need is a LARGE CROSS
so I made these changes

DllImport("user32.dll")]
static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName);
private int IDC_CROSS=32515; /// IDC_HAND = 32649;///IDC_UPARROW=32516///IDC_CROSS=32515
private const uint OCR_NORMAL = 32512;

private void Form1_Load(object sender, EventArgs e)
{
RegistryKey loadcursor = Registry.CurrentUser.OpenSubKey("Control Panel\\Cursors", true);
loadcursor.SetValue("Crosshair","%SYSTEMROOT%\\Cursors\\lcross.cur");
loadcursor.Close();
}

on event
private void setcursor()
{
IntPtr hcursor = LoadCursor(IntPtr.Zero, IDC_CROSS);/// IDC_HAND/// IDC_UPARROW//IDC_CROSS
bool ret_val = SetSystemCursor(hcursor, OCR_NORMAL);
}
am changing the poiter of the crosshair cursor the crude way !
dont now how to make it apply the rgistry changes. so that you dont
have re boot to make changes apply.
I would do it in the private void setcursor(),
but there is no system "large crosshair cursor".
only lcross.cur in windows/cursors.

AM I MESSED UP OR WHAT?
Thanks,
Regards.

P.S.
here is a link to the published project
it works great. Just want to put a little polish on it.
www.softsourcesolutions.com/nabit.zip

modified on Friday, September 18, 2009 10:33 PM

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.