Tag Archives: MinGW

Using SendInput to type unicode characters

I received a query from reader Partha D about generating unicode keystrokes using the SendInput function in Windows. As I understand it, Partha wants to generate one or more unicode keystrokes when a particular keyboard shortcut is pressed. The following … Continue reading

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

Creating a shadow template of a PGM image

I’ve just been cleaning up a scanned copy of a line drawing on paper. The background of the scanned image is quite dark and the shadowing is a bit uneven over the full image region, which makes it difficult to … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , | 1 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 , , , , , , , , | 44 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

Writing Bitmap Files in Windows

This is a bitmap file writing example. I compiled it with MinGW (gcc). It generates the following image and saves it as a bitmap file called “image.bmp”. Here’s the source code:

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