Results 1 to 9 of 9

Thread: a few questions

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    26

    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.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    26

    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.

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    26

    Re: a few questions

    so you're telling me that there's no way to do either of these in c#...

  6. #6
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    26

    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.

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width