Windows API to draw a dazzling Ferrari(Easter egg)!

Did you know that there is a window’s API to draw a dazzling Ferrari on screen, provided you give a valid window dc! Make sure your window is big enough to accommodate the Ferrari. Drawing will be faster if you pass a memory device context and then later bitblt it to the real device context. […]
Continue reading…

 

Applying registry changes without restarting explorer!

You make some changes to windows registry but can’t see the effect on explorer? Well you’ve got to do some more housekeeping to get going, broadcast a setting changed message to all windows to let them know and to get explorer refreshed… [sourcecode language=’cpp’]DWORD dwResult = 0; SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, SMTO_ABORTIFHUNG, 100, &dwResult […]
Continue reading…

 

How to start a process hidden!

I’ve seen people asking this question number of times, so for those people here is the answer… When creating a process via CreateProcess we’ve got to give a STARTUPINFO structure as a parameter which specifies startup options for a process. Set dwFlags member to STARTF_USESHOWWINDOW to indicate that we will be using wShowWindow member of STARTUPINFO. Then set wShowWindow to […]
Continue reading…

 

Retrieving graphics objects selected into a DC!

Felt the need to retrieve current brush or pen or palette selected into a DC? Sometime back a friend of mine asked me this question, as an answer I gave him a better solution, but the question was a valid one! So are there any windows api’s that helps us in the regard? Well the […]
Continue reading…