|
Someone wrote an article earlier this week on using PInvoke to execute x86 Op Codes from within a C# application.
For the life of me, I cannot find it. Can anyone point me in the direction to that article?
|
|
|
|
|
|
|
I have 2 treeviews in an application.While I am dragging a node from a treeview to a node in other treeview I want to get the name of these two nodes(one of is dragging node ,the other is dropped node)How can i get these nodes?
Thanks for your help...
|
|
|
|
|
Hi
I make a C# usercontrol.
in the load event of the control I want to do some work only if the control is in run time so i check for the DesignMode property:
if(DesignMode) return;
but the DesignMode is always false.
anyway to solve this ?
|
|
|
|
|
Can anyone help me to know how can I debug C# scripts? e.g. for VB/JAVA scripts we use 'Stop/debugger'(respectively) keyword & it starts debugger. Likewaise how can I start debugger from C# scripts?
Thanks from me.
|
|
|
|
|
This code should launch and attach a debugger:
System.Diagnostics.Debugger.Launch();
And then this code should signal a breakpoint to it:
System.Diagnostics.Debugger.Break();
|
|
|
|
|
Thanks for reply. this works but unfortunately does not solve my problem. When I select debugger for debugging, it launches my main program in debugger instead of script. I look fofrward to debug only script.
|
|
|
|
|
I don't really understand what you mean by script... runtime generated code? But anyways, if it's not part of the main application, I don't know of a way to debug it.
|
|
|
|
|
What might be the best way to check a string for an instance of a carriage return?
Would something like this work?
if ( s.IndexOf(Convert.ToChar(13)) > 0 )
{
//CR Found
}
Is there a better way?
|
|
|
|
|
Marginally faster (without Convert ) and correct (will also find CR at the beginning of the string):
if (s.IndexOf('\r') >= 0)
{
} mav
|
|
|
|
|
But it depends if the string was created on windows, unix or mac.
On windows you'll have \r\n
On unix, just \n
and mac just \r
so if you have unix string and search for \r you won't find new lines.
You can use Environment.NewLine to get the version of new line that your program is running on.
|
|
|
|
|
He was asking for Carriage Return, not newline character(s).
But otherwise, you're correct
|
|
|
|
|
How do you take info from a text box and send it to ones email address?
-Thanks
Wt.Hg
|
|
|
|
|
Quite easy. There's a class in the framework for this: System.Web.Mail.MailMessage .
You might want to look it up in the framework documentation.
Regards,
mav
|
|
|
|
|
I there any way that i could broadcast keyboard events?
(make it seem like a use clicked a key, when infact he didnt)
thx for the help
|
|
|
|
|
I found a way to move the mouse:
const int MOUSEEVENTF_LEFTDOWN = 0x02;
const int MOUSEEVENTF_LEFTUP = 0x04;
[DllImport("user32")] public static extern int SetCursorPos(int x, int y) ;
[DllImport("user32")] public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
private void button1_Click(object sender, System.EventArgs e) {
SetCursorPos(200,200);
mouse_event(MOUSEEVENTF_LEFTDOWN,0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP,0, 0, 0, 0);
}
can this be modified to broadcast keys?
|
|
|
|
|
There is a much easier way to move the mouse pointer:
Just set the System.Windows.Forms.Cursor.Position property.
To broadcast keystrokes, you could use the System.Windows.Forms.Sendkeys.Send method.
www.troschuetz.de
|
|
|
|
|
|
That is for some MKS toolkit. You probably don't have it, whatever it is.
There were quite a few methods to signal keypresses in Win32 API. SendInput(), keybd_event(), SetKeyboardState(). Look them up in MSDN for more details.
|
|
|
|
|
thank you very much, i will look those up
|
|
|
|
|
|
Check out this article for info on how to use Win32 functions in C#:
http://www.codeproject.com/dotnet/PInvoke.asp
|
|
|
|
|
Anyone help me !!!!
1) How to set a color to ToolBar ?
2) How to set a color to ToolBarButton ?
Thank YOu
|
|
|
|
|
You looking for?
ToolBar.BackColor
Not too sure on the Button
|
|
|
|