C program to automatically press F6 every few seconds

F

findmadhav

I need a program in C (something like a TSR) which will automatically
press the function key F6, say about every 5 seconds. Can anyone
provide me with an exe of such a program?
Thanks in advance.
 
J

jacob navia

I need a program in C (something like a TSR) which will automatically
press the function key F6, say about every 5 seconds. Can anyone
provide me with an exe of such a program?
Thanks in advance.
I can write it under windows, linux, or even mac...


But

***it will not be free of course! ***

What wonders me is that people think they will get here people
ready to work for free for them.

If you pay for it then you can have it. If not... just write it yourself!
 
Y

Yu SONG

I need a program in C (something like a TSR) which will automatically
press the function key F6, say about every 5 seconds. Can anyone
provide me with an exe of such a program?
Thanks in advance.

Post this to a "specific platform" newsgroup (e.g. Linux, Windows)


--
Song

/* E-mail.c */
#define User "Yu.Song"
#define At '@'
#define Warwick "warwick.ac.uk"
int main() {
printf("Yu Song's E-mail: %s%c%s", User, At, Warwick);
return 0;}

Further Info. : http://www.dcs.warwick.ac.uk/~esubbn/
_______________________________________________________
 
R

Robert Gamble

Yu said:
Post this to a "specific platform" newsgroup (e.g. Linux, Windows)


--
Song

/* E-mail.c */
#define User "Yu.Song"
#define At '@'
#define Warwick "warwick.ac.uk"
int main() {

Better written as:
int main (void) {
printf("Yu Song's E-mail: %s%c%s", User, At, Warwick);

You need to add a \n to ensure the string is actually printed ;)
return 0;}

Robert Gamble
 
M

Mark

Robert Gamble said:
Better written as:
int main (void) {
You need to add a \n to ensure the string is actually printed ;)

No he doesn't...
return from main is equivalent to calling exit() with value returned.
exit() function must flush all unwritten buffered data.
therefore:
Will be enough to ensure the string is actually printed. :p

Mark
 
M

Martin Ambuhl

No he doesn't...
return from main is equivalent to calling exit() with value returned.
exit() function must flush all unwritten buffered data.
therefore:
Will be enough to ensure the string is actually printed. :p

But he does need to end the the last line of output with a '\n' to have
portable behavior. The most common kind of implementation-specific
behavior is whether the prompt overwrites the last line when not so
terminated. When the prompt does overwrite that line, that line might
disappear before even noticed, so appears never to have been printed.
 
R

Robert Gamble

Mark said:
No he doesn't...
return from main is equivalent to calling exit() with value returned.
exit() function must flush all unwritten buffered data.
therefore:

Will be enough to ensure the string is actually printed. :p

This is true, however there is a good chance the string will be
overwritten or mangled by the command prompt when the program returns
to a shell. Let me rephrase: You should add a \n to increase the
chances of the printed string being seen by the user.

Robert Gamble
 
M

Mark

Martin Ambuhl said:
But he does need to end the the last line of output with a '\n' to have
portable behavior.

Another erroneous statement.
The behavior of the application is portable with or without the newline.
The most common kind of implementation-specific behavior is whether the
prompt overwrites the last line when not so terminated.
I don't see 'the most common kind of implementation-specific behavior' in my
standard...
nor any reference to this 'prompt' that you speak of. Can you provide a
reference point?
When the prompt does overwrite that line, that line might disappear
before even noticed, so appears never to have been printed.
Disappear? From what? You assume output is going to a terminal... why?

Stop making crap up and pretending that there is merit to your words. :p

Regards,
Mark
 
E

Eric Sosman

Mark said:
Another erroneous statement.
The behavior of the application is portable with or without the newline.

7.19.2/2: "[...] Whether the last line requires a
terminating new-line character is implementation-defined."
Disappear? From what? You assume output is going to a terminal... why?

If it's going to a file, say, you may find it instructive
to read a little further along in 7.19.2/2: "Data read in from
a text stream will necessarily compare equal to the data that
were earlier written out to that stream only if: [...] the last
character is a new-line character."
Stop making crap up and pretending that there is merit to your words. :p

.... but this parting shi\bot makes me wonder whether you are in
a frame of mind receptive to instruction. "Don't confuse me with
the facts: my mind is made up!"
 
M

Martin Ambuhl

Mark said:
Another erroneous statement.
The behavior of the application is portable with or without the newline.

Jane , you Ignorant Slut. Please learn something before your mouth-off.
Among the things that the implementation must specify is, according to
the standard,
-- Whether the last line of a text stream requires a
terminating new-line character (7.19.2).
And 7.19.2 tells us
[#2] A text stream is an ordered sequence of characters
composed into lines, each line consisting of zero or more
characters plus a terminating new-line character. Whether
the last line requires a terminating new-line character is
implementation-defined. Characters may have to be added,
altered, or deleted on input and output to conform to
differing conventions for representing text in the host
environment. Thus, there need not be a one-to-one
correspondence between the characters in a stream and those
in the external representation. Data read in from a text
stream will necessarily compare equal to the data that were
earlier written out to that stream only if: the data consist |
only of printing characters and the control characters
horizontal tab and new-line; no new-line character is
immediately preceded by space characters; and the last
character is a new-line character. Whether space characters
that are written out immediately before a new-line character
appear when read in is implementation-defined.
I don't see 'the most common kind of implementation-specific behavior' in my
standard...
nor any reference to this 'prompt' that you speak of. Can you provide a
reference point?

It is obvious to anyone that can actually read that I was referring to
actual conditions in the real world, not about the standard making
claims about them. But that wouldn't matter to you, since you obviously
have not read the standard at all. Note the wide range of
implementation-specific behavior that the text of the standard (above)
does mention.
Disappear? From what? You assume output is going to a terminal... why?

I don't presume any such thing. If you are incapable of understanding
the word 'might', then there is no hope for you.
Stop making crap up and pretending that there is merit to your words. :p

Good advice. It's time for you totake it, you slimy toad.
 
K

Kenny McCormack

Robert Gamble said:
This is true, however there is a good chance the string will be
overwritten or mangled by the command prompt when the program returns
to a shell. Let me rephrase: You should add a \n to increase the
chances of the printed string being seen by the user.

Just keep in mind that if "the standard" said that 2+2 = 17, then the
regulars in this group would assert that as fact. They will then tend to
become violent if you even so much as assume that anything else could
possibly be true.

And, to be fair, within the context of this newsgroup, they would be
absolutely right. That is, within the context of this newsgroup, 2+2 *IS*
(and I cannot stress that too strongly) seventeen.
 
M

Mark McIntyre

Another erroneous statement.

Before arguing with CLC regulars, check the Standard.
The behavior of the application is portable with or without the newline.

Nope, its implementation defined.
I don't see 'the most common kind of implementation-specific behavior' in my
standard...

Dur. Thats because its implementation-specific, and by definition not
covered by the standard.
Disappear? From what? You assume output is going to a terminal... why?

Why not? Its a possible destination, and in fact was the one probably
intended by the original example.
Stop making crap up and pretending that there is merit to your words. :p

Er, check in the mirror...
 
G

GMM50

I love this group. Let's never try to become so politically correct
that we loose the whit and charm.

It's brilliant. Also lots of good material.


THanbks
gm
 
W

Walter Roberson

Just keep in mind that if "the standard" said that 2+2 = 17, then the
regulars in this group would assert that as fact.

Unary representation grouped in octal notation??



[I know, I know, unary isn't one of the representations allowed in
the standard. ;-) ]
 
M

Mark

Martin Ambuhl said:
Jane , you Ignorant Slut.
Very nice.
Please learn something before your mouth-off.
Teach me oh might guru.
Among the things that the implementation must specify is, according to the
standard,
-- Whether the last line of a text stream requires a
terminating new-line character (7.19.2).

And how do you interpret that?
A line, by definition (which you already quoted later in this message)
consists of 0 or more chars plus a terminating newline.
My interpretation of that statement is: depending on your implementation
the terminating new-line character on the last line may be optional.
Keeping in mind that the terminating new-line is required on all others
I think that's the only way that statement truly can be interpreted.

Now, when writing to stdout using printf() each line written IS the 'last'
line.
consider:
printf("some prompt:");
fflush(stdout);
Is this portable? I think so, but maybe I'm mistaken.
Will it output a 'line'? No, because it's missing the terminating new-line.
It will output a partial line... that being: "zero or more characters plus a
terminating new-line character" sans the new-line character.
Isn't that legal? I think so, but maybe I'm mistaken.
Isn't that one of the purposes of fflush()?
And 7.19.2 tells us
[#2] A text stream is an ordered sequence of characters
composed into lines, each line consisting of zero or more
characters plus a terminating new-line character. Whether
the last line requires a terminating new-line character is
implementation-defined. Characters may have to be added,
altered, or deleted on input and output to conform to
differing conventions for representing text in the host
environment. Thus, there need not be a one-to-one
correspondence between the characters in a stream and those
in the external representation. Data read in from a text
stream will necessarily compare equal to the data that were
earlier written out to that stream only if: the data consist |
only of printing characters and the control characters
horizontal tab and new-line; no new-line character is
immediately preceded by space characters; and the last
character is a new-line character. Whether space characters
that are written out immediately before a new-line character
appear when read in is implementation-defined.
Thank you, you've provided the definitions for text streams, and lines.
Once again for review: a line is required to contain a terminating new-line
unless it is the last line, in which case it is implementation defined as to
whether or not it is required. Agreed?

Now, where in the standard does it state that it implementations may
choose to disregard 'partial' lines that have been fflush()ed? It doesn't.
It is obvious to anyone that can actually read that I was referring to
actual conditions in the real world, not about the standard making claims
about them.
I thought the purpose of this group was to talk about the standard and
the claims made by it, no? Did I accidentally stumble into
comp.real.world.claims ???
But while we're on the subject,
Unixes don't typically reset the position of the prompt...
MS windows/dos boxes typically spit out an extra newline when your
application finishes before displaying the prompt.
On what 'real world' condition do you notice this behavior?
But that wouldn't matter to you, since you obviously have not read the
standard at all.
Bits and pieces... a lot of bits and pieces. Never did read the entire
thing
straight through though... I still peruse sections from time to time
though.
Nice piece of documentation to keep handy ;)
Note the wide range of implementation-specific behavior that the text of
the standard (above) does mention.
Yes, but code containing 'implementation-specific' behavior is still
considered 'portable'... no?
If it wasn't then the only true valid definition for main() would have to
be:
int main(void); - no?
5.1.2.2.1
-- If the value of argc is greater than zero, the array
members argv[0] through argv[argc-1] inclusive shall
contain pointers to strings, which are given
implementation-defined values by the host environment
prior to program startup.
I don't presume any such thing. If you are incapable of understanding the
word 'might', then there is no hope for you.
I understand 'might', but that was not the issue... the word in question was
'prompt' .
If you don't presume a terminal, then please explain what you meant by
'prompt' :p
Good advice. It's time for you totake it, you slimy toad.

Take my own advice?
Let's take another look at the original statements in question.
RG> You need to add a \n to ensure the string is actually printed ME>
return from main is equivalent to calling exit() with value returned.
ME> exit() function must flush all unwritten buffered data.
Do you have an argument with my statement?
Granted, last line may not be (on some implementations) a 'line' but
regardless, it will still be printed.
MA>But he does need to end the the last line of output with a '\n' to have
MA>portable behavior
ME>The behavior of the application is portable with or without the newline.
Again, do you have an argument with my statement? It's quite possible that
the data in question may not be visible on some systems, but that is caused
by something happening 'after' the program in question has completed... not
caused by the behavior of the application as it runs. The application
itself
cannot control what happens when it completes, consider an OS which may
clear the entire terminal upon executing your utility or do away with the
window
completely... does that make your application 'non-portable'... I would
think not.

Mark
 
M

Martin Ambuhl

Mark said:
Now, where in the standard does it state that it implementations may
choose to disregard 'partial' lines that have been fflush()ed? It doesn't.

Jane, you Ignorant Slut.
I never made such a claim.
To recap:
Please learn some honesty along with the ability to read.
 
M

Mark

Martin Ambuhl said:
Jane, you Ignorant Slut.
Who is Jane? Your mother? Your wife?
Or is that your poor attempt to be funny?
I never made such a claim.
Nor did I claim that you did.
I was pointing out that the data must be written after the fflush().
Please learn some honesty along with the ability to read.
You snipped the entire message without responding to the
contents and accuse me of not being honest or able to read...
Please take your own advice.

Now let's try this again, if you can manage to converse intelligently,
tell me where I'm mistaken. (or you can take the easy way out and
insult me without contributing anything remotely intelligent... again!)

Among the things that the implementation must specify is, according to the
standard,
-- Whether the last line of a text stream requires a
terminating new-line character (7.19.2).

And how do you interpret that?
A line, by definition (which you already quoted later in this message)
consists of 0 or more chars plus a terminating newline.
My interpretation of that statement is: depending on your implementation
the terminating new-line character on the last line may be optional.
Keeping in mind that the terminating new-line is required on all others
I think that's the only way that statement truly can be interpreted.

Now, when writing to stdout using printf() each line written IS the 'last'
line.
consider:
printf("some prompt:");
fflush(stdout);
Is this portable? I think so, but maybe I'm mistaken.
Will it output a 'line'? No, because it's missing the terminating new-line.
It will output a partial line... that being: "zero or more characters plus a
terminating new-line character" sans the new-line character.
Isn't that legal? I think so, but maybe I'm mistaken.
Isn't that one of the purposes of fflush()?
And 7.19.2 tells us
[#2] A text stream is an ordered sequence of characters
composed into lines, each line consisting of zero or more
characters plus a terminating new-line character. Whether
the last line requires a terminating new-line character is
implementation-defined. Characters may have to be added,
altered, or deleted on input and output to conform to
differing conventions for representing text in the host
environment. Thus, there need not be a one-to-one
correspondence between the characters in a stream and those
in the external representation. Data read in from a text
stream will necessarily compare equal to the data that were
earlier written out to that stream only if: the data consist |
only of printing characters and the control characters
horizontal tab and new-line; no new-line character is
immediately preceded by space characters; and the last
character is a new-line character. Whether space characters
that are written out immediately before a new-line character
appear when read in is implementation-defined.
Thank you, you've provided the definitions for text streams, and lines.
Once again for review: a line is required to contain a terminating new-line
unless it is the last line, in which case it is implementation defined as to
whether or not it is required. Agreed?

Now, where in the standard does it state that it implementations may
choose to disregard 'partial' lines that have been fflush()ed? It doesn't.
It is obvious to anyone that can actually read that I was referring to
actual conditions in the real world, not about the standard making claims
about them.
I thought the purpose of this group was to talk about the standard and
the claims made by it, no? Did I accidentally stumble into
comp.real.world.claims ???
But while we're on the subject,
Unixes don't typically reset the position of the prompt...
MS windows/dos boxes typically spit out an extra newline when your
application finishes before displaying the prompt.
On what 'real world' condition do you notice this behavior?
But that wouldn't matter to you, since you obviously have not read the
standard at all.
Bits and pieces... a lot of bits and pieces. Never did read the entire
thing
straight through though... I still peruse sections from time to time
though.
Nice piece of documentation to keep handy ;)
Note the wide range of implementation-specific behavior that the text of
the standard (above) does mention.
Yes, but code containing 'implementation-specific' behavior is still
considered 'portable'... no?
If it wasn't then the only true valid definition for main() would have to
be:
int main(void); - no?
5.1.2.2.1
-- If the value of argc is greater than zero, the array
members argv[0] through argv[argc-1] inclusive shall
contain pointers to strings, which are given
implementation-defined values by the host environment
prior to program startup.
I don't presume any such thing. If you are incapable of understanding the
word 'might', then there is no hope for you.
I understand 'might', but that was not the issue... the word in question was
'prompt' .
If you don't presume a terminal, then please explain what you meant by
'prompt' :p
Good advice. It's time for you totake it, you slimy toad.

Take my own advice?
Let's take another look at the original statements in question.
RG> You need to add a \n to ensure the string is actually printed ME>
return from main is equivalent to calling exit() with value returned.
ME> exit() function must flush all unwritten buffered data.
Do you have an argument with my statement?
Granted, last line may not be (on some implementations) a 'line' but
regardless, it will still be printed.
MA>But he does need to end the the last line of output with a '\n' to have
MA>portable behavior
ME>The behavior of the application is portable with or without the newline.
Again, do you have an argument with my statement? It's quite possible that
the data in question may not be visible on some systems, but that is caused
by something happening 'after' the program in question has completed... not
caused by the behavior of the application as it runs. The application
itself
cannot control what happens when it completes, consider an OS which may
clear the entire terminal upon executing your utility or do away with the
window
completely... does that make your application 'non-portable'... I would
think not.


Mark
 
M

Mark

Eric Sosman said:
Poor kid can't even Google.

Actually, that was 'my' poor attempt at being funny :p
But feel free to kick in with a post that actually contributes
something to the discussion Eric. You are one of the
brighter posters on CLC and I'd hate for you to limit your
response to: 'poor kid can't even google.'

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top