Skip to main content


Showing posts from December, 2009

Google Search

Custom Search

Live Search

Yahoo Search

Search the web Search this site

BlackBerry Security Permissions

If you are eager to find out about BlackBerry security permissions and ways to handle prompts following video from BlackBerry will help you in understanding the basics of it. more if you are seeking ways to change application permissions using code, following link will help you to get more details of the Application Permissions class from RIM device API.

Disabling Date-Time Changes

Do you know that you can programmatically stop the user changing the date and time of a Pocket PC device?This is useful if your applications need to take time accurately for some reason from the device.The following code will disable the user from accessing the date time changing settings using his Windows Mobile powered device.

privatevoid btnDisableClock_Click(object sender, EventArgs e) {RegistryKey hklm = Registry.LocalMachine;     hklm = hklm.OpenSubKey(@"\Software\Microsoft\Clock\", true);     System.Byte[] offValue = newbyte[1];     offValue[0] = 0x30;     hklm.SetValue("AppState", offValue);     lblTitle.Text = "Change Clock Status - Disabled"; }

If you want to re-enable the setting, to make the user able to change the data and time use the below code.

privatevoid btnEnableClock_Click(object sender, EventArgs e) {RegistryKey hklm = Registry.LocalMachine;     hklm = hklm.OpenSubKey(@"\Software\Microsoft\Clock\", true);     System.Byte[] offV…

Boeing 787 - DreamLiner

Boeing's newest plane 787 DreamLiner had made its first flight. As of Boeing this is a great achievement and a history changer. View the video and lots of other details at New Air Plane and Boeing.

Disabling Right Click

To disable right click context menu you can use one of the following methods.
Method 1 – Using attribute oncontextmenu attribute of the body tag.
By using this you can block the right click action and the context menu without using JavaScript.

<bodyoncontextmenu="return false">

This will be useless if you need to do some action on the click. In such a case use the Method 2.Method 2 – Using JavaScript.Place the following JavaScript and modify the script as you need. This will just show a popup window to the user saying that Right clicking is disabled.

<scriptlanguage="javascript">     document.onmousedown = disableRightClick;function disableRightClick(e) {if (event.button == 2) {             alert("Right click is disabled.");returnfalse;         }     }</script>

Finding the Image Format

Here is a small code that I wrote to find the image format of an image. This code will check for the raw image format of the image you select and will display in a pop up window. Hope this helps.

using System.Drawing.Imaging;

privatevoid button1_Click(object sender, EventArgs e) {     openFileDialog1.ShowDialog();Image img = Image.FromFile(openFileDialog1.FileName);ImageFormat imgfmt = img.RawFormat;if (imgfmt.Equals(ImageFormat.Bmp))MessageBox.Show(ImageFormat.Bmp.ToString());elseif (imgfmt.Equals(ImageFormat.Jpeg))MessageBox.Show(ImageFormat.Jpeg.ToString());elseif (imgfmt.Equals(ImageFormat.Tiff))MessageBox.Show(ImageFormat.Tiff.ToString());elseif (imgfmt.Equals(ImageFormat.Wmf))MessageBox.Show(ImageFormat.Wmf.ToString());elseif (imgfmt.Equals(ImageFormat.Icon))MessageBox.Show(ImageFormat.Icon.ToString());elseif (imgfmt.Equals(ImageFormat.Png))MessageBox.Show(ImageFormat.Png.ToString());elseif (imgfmt.Equals(ImageFormat.Gif))MessageBox.Show(ImageFormat.Gif.ToString()); }

Rapping Flight Attendant

If you have flown in aircraft's you may definitely have heard of the in flight safety announcements made by the flight attendants. But have you paid enough attention to it?
Anyway I bet that you have never listened to anything like this before.

This is David Holmes, a flight attendant of Southwest Airlines who is known as rapping flight attendant who came up with a nice idea.

Remember the Old Days

Thought to add the following photos in remembrance of AirLanka which was Sri Lankas national carrier before being renamed to SriLankan.