Tag Archives: C#

Asteroid

For making an asteroid game,
I found it hard at first but it’s quite easy.

One of Newton’s law : In the absence of a net external force, a body either is at rest or moves with constant velocity.
We are evolving in space so the last phrase part is our algorithm.
But you might have encountered some problems [...]

Generic Singleton

Click here for an introduction to the Singleton.
You might wonder the useful-ness of doing this.
Well, I found that by pure accident, I was reviewing some code then I decided to try enhance the original Singleton pattern.
Here are the benefits :

You don’t need to have a field or property representing the singleton instance,
With its syntax, it [...]

TaskDialog hidden icons.

Before starting, you need to know there’s a small issue on using the API in your project, you can get an Unable to find an entry point name ‘TaskDialogIndirect’ in DLL ‘comctl32.dll’ error.
To get the whole story, see my post Unable to find an entry point name ‘TaskDialogIndirect’ in DLL ‘comctl32.dll’

Thanks to Bart Desmet, you [...]

Unable to find an entry point name 'TaskDialogIndirect' in DLL 'comctl32.dll'

For those of you who tried Windows API Code Pack, particularly the TaskDialog managed wrapper, you’ve probably encountered the following error when trying to run your program.

Too bad,
I was happy when I heard they finally released a managed API for those (not yet managed) APIs …
I have been struggling a lot last year to [...]

The Singleton pattern !

UPDATE : I have created a generic Singleton.
For the first programming related post, it is going to be a simple post.
The Singleton pattern,
What is this ?
If you are familiar with programming, you probably know what this is, if you are new to programming, i’ll try to explain it to you, especially what it can do [...]

Detect the type of your monitor

UPDATE : Here is the monitor management application !
MonitorConfigurationAPI
Requirements : Vista and a display monitor with Vista drivers.
Usage : Click ‘Probe’ button then wait a few seconds !
Issues

Color temperature doesn’t produce expected results
During detection, some monitors may change their settings

If you don’t have a Vista-specific driver, you shouldn’t install an old XP driver otherwise it [...]

Block system shutdown

UPDATE : Here is a sample code for Vista only.
ShutdownBlockReasonCreate
Running the program then initiating a shutdown will display the Windows feature.
As things seems to have changed a little in Windows 7, it doesn’t work with it. I will post an updated version of it, when the documentation is available.
Sometimes you need to handle a shutdown [...]