Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Jim Tooley
  Where is Jim Tooley?
 Lodi
 Wisconsin - United States
 Jim Tooley
 Tags
Subject: RE: Using the Keyboard Command with a timer
Thread ID: 143172 Message ID: 143176 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Saturday, August 25, 2007 6:31:44 PM         
   


> Hello,
>
> I have a printscreen program running on my computer. It is fired anytime I hit the 'F8' key. It's output is a .jpg file of the screen.
>
> I'm trying to write a program where a timer fires the 'F8' causing a printscreen capture to occur at set intervals.
>
> I've set the relevant timer control properties as follows:
> interval= 2000
> enabled = .t.
>
> The timer event contains: KEYBOARD '{F8}' plain
>
> I also have a little routine in the timer event that displays the number of times the timer has been triggered.
>
> When I run the routine, I can see the timer count increasing but the 'F8' printscreen doesn't happen.
>
> If I press the 'F8' key manually within the VFP environment, the screen capture occurs as expected.
>
> Can anyone see what I'm missing?
>
> Thank you,
>
> JT

JT,

Think about your timer from a design perspective. You don't actually want to inert keystrokes, but rather, you want it to perform a screen capture. If your F8 key were to call a function like MyScreenCapture() and if your screen capture code were to be placed in that function, it wouldn't matter where you called that function from. You could just as easily call that MyScreeenCapture() function from a timer, from a command button, from a right click dropdown menu or what ever.

Ken
You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

Using the Keyboard Command with a timer Posted by Jim Tooley @ 8/25/2007 4:40:02 PM
RE: Using the Keyboard Command with a timer Posted by tushar @ 8/25/2007 5:08:22 PM
RE: Using the Keyboard Command with a timer Posted by Jim Tooley @ 8/25/2007 6:38:35 PM
RE: Using the Keyboard Command with a timer Posted by Ken Murphy @ 8/25/2007 7:45:40 PM
RE: Using the Keyboard Command with a timer Posted by Ken Murphy @ 8/25/2007 6:31:44 PM