Vivid Abstractions Where Programming Becomes An Abstraction

25Aug/110

How To: Computer Locks Up Instead of Going to Sleep

First you should follow the steps mentioned in this article: http://support.microsoft.com/kb/976877

 

Additionally I had to change some other options as well:

Change the Sleep and Hibernation time, to your liking. Expand the "Allow Hybrid Sleep" section and disable it.

 

Enjoy!

17Aug/110

How to: ICQ Keys Not Working

Go into a conversation, click inside the chat input window and press the keys "Alt + Shift". Everything should be back to normal! =)

Tagged as: , , , ,
18Dec/101

Steam Not Working? Cannot access the website?

I just found out that my PeerBlock is blocking Valve corporation making it unable for me to reach their websites, nor connect to the steam client.

The best thing is just to turn off PeerBlock while using Steam.

14Dec/091

GetAsyncKeyState not working? Look here!

Especially when running on a 64-bit system you may run into problems. To ensure your application works on 32-bit and 64-bit you have to make some small changes to the API declaration.

To make something clear: Even though it says "user32.dll" it is actually a dll with 64-bit functions. The 32-bit version of it is in the WOW64 folder.
wrap-lines: true
This is the code I am using:

using System.Runtime.InteropServices;
    static class VKeyboard
    {
        [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern IntPtr GetAsyncKeyState(IntPtr vKey);
        public static bool CheckKeyDown(System.Windows.Forms.Keys vKey)
        {
            return 0 != ((Int64)GetAsyncKeyState((IntPtr)vKey) & 0x8000);
        }
    }

To call this just use:

if (VKeyboard.CheckKeyDown(Keys.ControlKey))
{
//do something
}

The integer types were changed to IntPtr because IntPtr is a wrapper that changes depending on the system (32-bit or 64-bit). You can change vKey as well to IntPtr to save the typecast but I like the "Keys." calling method.

Enjoy.

   
SEO Powered by Platinum SEO from Techblissonline

Page optimized by WP Minify WordPress Plugin