I'm working on some scripted GUI test for a windows C# .net app. I'm using Ruby to drive the testing and my feet are officially wet in the realms of WIN32API - but I'm certainly not over-confident with it. As a mater of fact, I feel like I'm missing some fundamental understanding. At this point, the only way I know how to gain access to different controls is through the combination of control class and maybe some identifying text.

My problem is, the application I have to test has a series of several buttons - all of which contain an icon and no text.

Is there a method I could use to retrieve a specific button? I've played with the notion of doing this via relative positioning, but that kind of sucks, and I'm not super interested in it.

I have access to the source code; if there is some identifying attribute/property that I can set, I'm more than willing. I'm just ignorant at this point.