Re: How to remotely activate Ctrl-C ?
From: Jack (replyto_at_newsgroup)
Date: 03/30/04
- Next message: Rick Pinney: "Re: VB Text-To-Voice SDK kit"
- Previous message: Bob Butler: "Re: How to remotely activate Ctrl-C ?"
- In reply to: J French: "Re: How to remotely activate Ctrl-C ?"
- Next in thread: Bob Butler: "Re: How to remotely activate Ctrl-C ?"
- Reply: Bob Butler: "Re: How to remotely activate Ctrl-C ?"
- Reply: J French: "Re: How to remotely activate Ctrl-C ?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 30 Mar 2004 10:41:20 -0500
I read about that Sleep function and I am a little confused.
In my program (telephony application) I am using quite often the time delays
loops.
The time delay function I am using looks like that:
Public Start as Single
Public Sub DelayTimer(TimeDelay As Single)
Start = Timer ' Set start time.
Do While Timer < Start + TimeDelay
Loop
End Sub
and 'interactive' time delay function:
Public Sub DelayTimerInter(TimeDelay As Single)
Start = Timer ' Set start time.
Do While Timer < Start + TimeDelay
DoEvents
Loop
End Sub
How these above compare with the Sleep function? What is better to use?
I am not a professional programmer but I like to do things the right way :)
Jack
"J French" <erewhon@nowhere.com> wrote in message
news:40691ba0.80933856@news.btclick.com...
> On Tue, 30 Mar 2004 01:15:35 -0500, "Jack" <replyto@newsgroup> wrote:
>
> >Interesting.
> >I do not have Sleep function in my vbasic5 and I just put some time delay
> >loop to no avail.
>
> You'll hav it in a minute
>
> >But, when I use DoEvents just before getting clipboard data there is not
> >error anymore :)
>
> Great
>
> >I do this:
> > DoEvents
> > lname = Clipboard.GetText
> >How about that?
>
> That looks fine.
>
> Now you are in for a shock.
>
> VB sits on top of Windows and most of what it really does is make
> Calls into Subs and Functions that Windows provides.
> - these are called APIs - Application Programmer Interfaces
>
> There are hundreds, or rather thousands of APIs
>
> Here is one of them
> - stick it at the top of your Form and presto
> ... you have Sleep( 250 ) in VB5
>
> Private Declare Sub Sleep _
> Lib "kernel32.dll" _
> (ByVal dwMilliseconds As Long)
>
> There is a superb downloadable API Guide at:
> www.AllAPI.net
>
> It is full of easy to test examples
>
> Easily the most useful programming resource I have ever found
> ( although it is best used in conjunction with the Win32 Programmer's
> Reference Help Files and MSDN )
>
> I recommend that you put Sleep(250) in after the DoEvents because
> DoEvents processes all /your/ outstanding Windows Messages in /your/
> message queue
> - but Sleep(250) hand over the CPU to the other Apps running on the
> system for 1/4 of a second, which gives the App that you are pumping
> key presses at a chance to do its Clipboard copy and close the
> Clipboard
> - probably just belt and braces, but still good practice
>
> I rather suspect that you will have some fun with the API Guide
>
> Good Luck
- Next message: Rick Pinney: "Re: VB Text-To-Voice SDK kit"
- Previous message: Bob Butler: "Re: How to remotely activate Ctrl-C ?"
- In reply to: J French: "Re: How to remotely activate Ctrl-C ?"
- Next in thread: Bob Butler: "Re: How to remotely activate Ctrl-C ?"
- Reply: Bob Butler: "Re: How to remotely activate Ctrl-C ?"
- Reply: J French: "Re: How to remotely activate Ctrl-C ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|