Skip to main content

Posts

Showing posts from January, 2009

Disable PrintScreen on C# without Keyboard Hooks

Yes, there is a simple solution to prevent grabbing information on your C# application screen with the keyboard's printscreen key without using keyboard hooks or calling COM interops. The solution makes use of Windows Forms Message Filter to trap keyboard events on your application window.

To trap keyboard events with Windows Message Filter, you need to implement the IMessageFilter interface and override the member PreFilterMessage(ref Message WM) method. This is the method called whenever a Form receives a keyboard or mouse event. You may want to read more about IMessageFilter.

The problem is that even though you have trapped the PrintScreen keypress event, the captured image will still persist to the clipboard. Therefore the simplest solution is to clear up the clipboard right after the PrintScreen is pressed on the keyboard.

This is how the overridden method will look like this:

publicbool PreFilterMessage(refMessage WM)
{
Keys kCode = (Keys)…

Fixing a Problematic Motorola L6

Few days after I have re-flashed my Motorola L6 phone, I encountered a problem with the firmware. It seems like the firmware cannot access the phone memory. When I select an item in the main menu, my phone just displays the message "Please Wait..." and does nothing after. The phone cannot be used in this current state and the only i see one option to fix this and it is to re-flash again with a newer firmware. Now the problem is that i will lose my contact database if i do this so i looked for way to back it up. I tried using Windows XP's hyper terminal to read the phone memory thru AT commands but got no success.


The good thing is that i made a backup of the whole application folder (Motorola Software Update) including the registry changes. I made a copy of the files inside the application folder right after it has backed up the personal data on the phone. So the temporary files were also copied unconsciously.

Restart the Motorola phone on Bootloader mode. This can be done…