Tag Archives: gcc

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

Simple ARM example for LPC1114

My colleagues Frank Duignan and Richard Hayes have been experimenting with an ARM Cortex M0 microcontroller in a dual inline package (DIP) which can be plugged straight into a breadboard. The chip they’re using is LPC1114FN28/102, which is made by … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , | 16 Comments

Writing bytes to a serial port in C

This is a (relatively) simple example of a C program to send five bytes to a serial port in Windows. In this case, I’m sending the five characters “hello” via COM22 at 38400 baud, but of course the program can … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , | 36 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 , , , , , , , , | 39 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