|
-
Jun 24th, 2007, 04:37 PM
#1
Thread Starter
Junior Member
a few questions
EDIT:express edition,2005
first-pause, in other words do nothing, like this.
messagebox.show("a");
pause for 1000 milliseconds
show a new messagebox
basically, just wait a set amount of time then preform a new command
second-pause and external process, such as notepad.
i want to be able to pause an external process in the same way that the command:
system.thread.threading.sleep(int in milliseconds);
pauses itself
thanks for the help.
Last edited by gamesguru; Jun 24th, 2007 at 04:42 PM.
-
Jun 24th, 2007, 05:17 PM
#2
Re: a few questions
to pause your program you can use:
Code:
System.Threading.Thread.Sleep(2000);
And I don't think the second part is doable in managed code
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 24th, 2007, 05:35 PM
#3
Thread Starter
Junior Member
Re: a few questions
you completely mis-understood me...i want to pause an EXTERNAL process, like notepad or pinball...and i've seen it done,in managed code, in delphi or pascal or whatever it's called.
the second part is just simply do nothing for a set amount of time so...
messagebox.show("a");
wait 2000 milliseconds
messagebox.show("b");
so that would allow you to click the "a" messagebox while waiting for the b.
-
Jun 24th, 2007, 05:44 PM
#4
Re: a few questions
I'm not really familiar with delphi or pascal but if my background knowledge is correct.. They compile into unmanaged code
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 24th, 2007, 05:54 PM
#5
Thread Starter
Junior Member
Re: a few questions
so you're telling me that there's no way to do either of these in c#...
-
Jun 24th, 2007, 07:40 PM
#6
Re: a few questions
I really don't know
but I think that if there is a way it'll be using unmanaged code within your app
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 24th, 2007, 07:46 PM
#7
Re: a few questions
Manipulating external programs is almost universally done using unmanaged code. You could create a C# app to do it but it would require that your app call unmanaged code, i.e. Windows API functions. If you want to know how to declare external functions in C# code then we can tell you, but what functions to call is really a question for the API forum.
As for your first request, I can only assume that there's more to it than meets the eye given that you demonstrate an existing knowledge of the Thread.Sleep method in the same post. MessageBoxes can't dismiss themselves, nor can they be dismissed in code. If you mean that you want a MessageBox to display for 1 second then disappear and another be shown it's not possible. You would have to design your own form to display in the first place so that you could code a Timer to close it after 1 second.
-
Jun 24th, 2007, 08:23 PM
#8
Thread Starter
Junior Member
Re: a few questions
ok thanks for the first part, but you mis-understood me also, lets say that i want to send a keystroke, sendkeys.send(keys here);
then delay 1000 milliseconds, without pausing the thread. in simple words i need to, well, nothing for 1 second. then send another keystroke.
one of my friends said that this was an api function. but i was wondering if it can be done without one.
-
Jun 25th, 2007, 05:19 AM
#9
Re: a few questions
I think you'll find that, rather than our misunderstanding your question, you just didn't explain properly. If you want to do something at an interval then use a Timer. Do whatever, start a Timer, then do whatever when the Timer's Tick event is raised. You can specify the Interval and you can either let the Timer run or Stop it after the first Tick.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|