| Message: 56847 |
 |
BY: Bob Whiteside (rawhite) DATE: 2008-05-29 18:07 SUBJECT: I'm so confuse. Win32API or Win32::API Hi All,
Ok, I thought I was making progress, but have discovered a fundamental confusion on my part. Recall, I'm the guy trying to write a little robot. I've been using a class Win32API. I'm pleased: I can move the mouse, send mouse clicks and keystrokes.
The next thing I wanted to do was hook the keyboard, so my robot could watch for a particular key and pause or halt.
I grep-ed through my ruby install (I just installed the one-click-installer) and found a very nice test class tc_win32_api_callback.rb that called EnumWindows, which accepts a callback function. I thought I'd start with that as an example then see if I could create a keyboard Hook (I think this is what I want to do...)
Anyway, this is the point at which I realized there are two different win32 thingies? Win32API, which I'd been using, and Win32::API. These seem to differ in the order of arguments, among other things.
So (sorry about the long-windedness), my questions are:
- Am I right that I have two different win32 interfaces installed?
- If so, which should I be using?
- Are these compatible? That is, can I keep my existing Win23API stuff, and use the Win32::API classes for my keyboard hook?
- Is there a callback mechanism in the Win32API?
Cheers,
--Bob
| |