|
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
|
|
|
|
|
Thank You. I know/try this property.
Unfortunately, ToolBar.BackColor won't work
|
|
|
|
|
Sorry man, didn't know that you'd tried that. It appears to be overridden and maybe this was done just so that the toolbar could inherit from Control but not do anything for the backcolor property. You might have to write your own if you're set on changing the color.
|
|
|
|
|
Hi, I am making an application that requires a global keyboard hook, so i am using the one i found on this website: http://www.codeproject.com/csharp/globalhook.asp
However when i try to creat a new hook:
hook = new UserActivityHook();
It throws an exception:
throw new Exception("SetWindowsHookEx failed.");
why is this happening (i am using visual studio whitbey, c#, .NET framework v2)
|
|
|
|
|
EDIT: it seems to work only when u launch the exe (not im debug)
why is that?
|
|
|
|
|
hey guys,
i'm working on a program which will be able to display as many types of images as possible. I'm kind of a newbie, but thus far i can view the typical .jpg and .gif files. As well as a couple others such as bitmaps. However, i have many flash animations, which i have made, and i would like a way to display these flash animations/videos in the program as well. I know in internet explorer and other web programs, this is done through the flash plugin. Can i do this similarly with a program.
As i'm kind of a newbie, this may be way over my head, but if it can be done without dozens of lines of code, please send me your thoughts on how this can be accopmlished. or just tell me i'm stupid and that it isn't possible.;)
<marquee>thanks!!!
|
|
|
|
|
I have made a simple 3D engine capable of rendering simple meshes and X-File based meshes. It works kinda well, but I got a problem with HLSL.
How can I create and use a simple Effect written in HLSL??
Does anyone know how to do that?
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
|
|
|