Geekin' It Real

More than just a living, coding is a lifestyle.
  • Differences in WM_NCHITTEST with DWM enabled

    I was messing around with handling WM_NCHITTEST.  I have the frame extended over the entire client area so I thought it would be useful to translate HTCLIENT to HTCAPTION.  No problem there.

    But just for kicks, I decided to also [temporarily] translate HTMINBUTTON, HTMAXBUTTON, and HTCLOSE to HTCAPTION and that's where it got interesting.  With the DWM rendering the non-client area, the minimize, maximize, and close buttons still worked normally.  So I disabled the non-client area rendering on the window and they worked like the caption, as I had intended.

  • Vista To The Rescue

    Thanks to Windows Vista and my subsequently installing it on my work system, I have returned to what I did for the 5 years prior to learning C#: programming against the Win32 API in C++.

    I ventured back to the unmanaged world in order to try out the new APIs and controls available in Vista.  I've already played around with the DWM API.  There's so much more to play with; it's just a matter of finding the right situation to use it.

    There's one thing I really need to learn: drawing.  In particular, drawing on a translucent surface.  I'm very bad at conceptualizing graphics, even 2D graphics, and I really don't know where to get started.  From what I've read, I need to use GDI+ in order to draw on 'glass' surfaces.  All the common controls use GDI functions and I have no idea how to make them use GDI+ functions.  I really don't want to have to create my own basic controls like buttons (thus avoiding the "not invented here" phenomenon).  If I can do that, I'm going to mature immensely.

  • Null expectations in computer science

    I've been dealing with VB 6 a lot lately -- too much, in fact -- and I'm getting really sick of it.  Among other things, I keep dealing with stupidity as evidenced by the following comment I found in code:

    "VB doesn't like Nulls"

    When I finally heard someone say "VB doesn't handle Nulls well", I had to correct him.  This mentality seems to propagate in a companies like The Talent Pitâ„¢ where bad code leads to more bad code and misunderstandings becomes accepted as fact.

    It's not that VB doesn't handle Nulls well.  Most VB programmers don't know VB and its type system well enough to know how to write correct code to handle them.  The Null value in VB 6 is also its own type.  VB handles the Null type according to very specific rules and understanding those rules is the key to being able to write the code to handle it.  Among those rules is that Null cannot be converted to any type, neither implicitly nor explicitly, and that's where people tend to throw in the towel and blame VB instead of learning about it.

    Knowing how this stuff works is one of the things that distinguishes programmers from script kiddies.  While what we do may seem like art or even magic, it is at its core still a science...  Computer Science.

    It's hard to believe that I defended VB but it was only to chastise so-called "programmers" who are too lazy to learn even the simplest of concepts, people who go to great lengths to stay stupid.

    posted 31-07-2006 02:54 by bbenson | 0 Comments
    Filed Under:
  • Hello World.

    I suppose it's fitting that my first entry in a programming blog would be titled so.  It doesn't bother me that it's horribly derivitive.  It's a universally recognizable indication (among programmers, anyway) of the beginning of something that is expected to evolve and improve.

    I have a blog on a popular community/networking site, but it's no place for a programming blog.  Most people there are looking for-- well, that doesn't really matter.  It's not programming information, that's for sure.  That's why I started this blog.  I wanted a blog that was specifically for programming.  Perhaps I'll attract an audience that can appreciate what I have to contribute.

    I hope you'll check back or even copy one of the syndication links and plug it into your reader/aggregator.

SkinName:iroha_Blog2
Powered by Community Server, by Telligent Systems