I want to develop a C program which when double clicked will press both Ctrl+B key combined
Printable View
I want to develop a C program which when double clicked will press both Ctrl+B key combined
What do you mean by your program being "double clicked"?????
A C program cannot press keyboard keys, unless it controls some physical agent (hardware, biological, etc) that performs the physical act.
If you want a program that can simulate keystrokes as input to another program (i.e. get another program to act as if the user has hit those keys) the techniques depend on your operating system and compiler/library.
I am using windows xp. I actually wanted a .exe file which when executed will press the keys CTRL+B in the desktop(this key is the boss key of my bittorrent software)
Pressing ctrl-b will be a lot quicker than fumbling around for an exe file to do the same.
It would be lot easier but i want it to be done in startup of windows xp
That implies you're running bittorrent at startup too. If so, simply start it minimised. No need to have another program do that.
Of course, if you're trying to conceal your downloading of porn from an employer, hiding bittorrent is not enough. Employers who care to can easily monitor your internet usage without touching your desktop computer, since they have control of the networking infrastructure that your computer connects to.
They seem dumb at that level. But they can check the taskbar. Any way do my problem has any solution "pressing keystroke in windows xp desktop using C function
This is something that is actually pretty difficult to find through google and such (at least it was for me when I looked for it a long time ago, took me ages to find).
Look into Windows Function keybd_event() or get the window handle and SendMessage.
You'll also have to take into account keyboard focus (in the first method).
EDIT: As already mentioned by other posters, this is a very unclean way to do it, but it should do the job I guess. If it can be avoided, it should be.
Thanks
It is solved for now
I will try not using these