Tag Archives: Win32

Sending a key to a window that’s not in focus (C program)

In a previous post, I showed how a C program can simulate a keystroke in Windows using SendInput. I also posted a subsequent example showing how to simulate a keypress with the Control key included (e.g. Ctrl+V). In this post … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , , , , , , , | 12 Comments

Vision: a DirectShow machine vision engine

For the last few weeks, I’ve been working sporadically on a DirectShow reimplementation of the simple machine vision engine I wrote for my Robotics class. The original version used the old Video For Windows API, which is relatively simple, but … Continue reading

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

Setting the precise dimensions of a window

I wrote this little program to let me set the exact dimensions of any window on my desktop. This is something I often need to do for taking screenshots that fit nicely in a blog post. The complete C code … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

Simulating a Ctrl-V keystroke in Win32 (C or C++) using SendInput

This short example program simulates pressing Ctrl-V on the keyboard (the Windows shortcut for “Paste”) once every second. It’s a modified version of an earlier example I posted on keystroke simulation using the Win32 SendInput function. What’s different this time … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | 47 Comments

How a console application can set the size of its window

This is an example of a Win32 console application that sets the size of the window it’s running in. When you run it, it sets the size of the console window to 640 x 400 pixels. It actually seems to … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | 2 Comments

Simulating a keystroke in Win32 (C or C++) using SendInput

This program is a simple example of using the Win32 SendInput function to generate a simulated keystroke. When you run this program, it simply waits 5 seconds and then simulates a press and release of the “A” key on the … Continue reading

Posted in Uncategorized | Tagged , , , , , , | 79 Comments

SerialSend – a Windows program to send a short text string via serial port

NOTE (18-12-2012): Since posting this, I have updated SerialSend to add some additional useful features and make more robust. The updated version is available from the SerialSend page. When I’m building robots, I sometimes find it useful to send short … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , | 29 Comments