Tag Archive: win32

Jul
24
2012

Simple Main Window Class

Here’s another fairly trivial code snippet. I’ve stumbled across some borked attempts at initializing and maintaining rendering windows for games lately. Most failed to properly respond to window messages, either ignoring WM_CLOSE outright or letting DefWindowProc() call DestroyWindow() when WM_CLOSE was received, thereby not giving the rest of the game’s code any time to cleanly …

Continue reading »

Jun
12
2012

How to Delete Directories Recursively with Win32

Well, while I’m at it, here’s the counterpart to the recursive directory creation function from my last post, a function that recursively deletes a directory and all its contents. Ordinarily, you could just use the shell API to achieve this on classic Win32: /// <summary>Deletes a directory and everything in it</summary> /// <param name=”path”>Path of …

Continue reading »

Jun
12
2012

How to Create Directories Recursively with Win32

As I just found out, the CreateDirectory function on Win32 can only create one directory at a time. If one, for example, specifies C:\Users\All Users\FirstNew\SecondNew as the directory to create, and both FirstNew and SecondNew do not exist, then CreateDirectory() fails. That’s less than ideal for some cases. Recently, for example, I wanted my game …

Continue reading »

Social Widgets powered by AB-WebLog.com.