Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread
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


Thread View

Thread Author Date
I'm so confuse. Win32API or Win32::APIBob Whiteside2008-05-29 18:07
      RE: I'm so confuse. Win32API or Win32::APIDaniel Berger2008-05-29 19:38
            RE: I'm so confused. Win32API or Win32::APIBob Whiteside2008-05-30 04:22
            RE: I'm so confuse. Win32API or Win32::APIRoger Pack2009-01-03 18:44
                  RE: I'm so confuse. Win32API or Win32::APIDaniel Berger2009-01-03 19:06
                        RE: no Ruby 2.x support for Win32::API ??Dan Rathbun2009-10-18 23:17
                              RE: no Ruby 2.x support for Win32::API ??Daniel Berger2009-10-19 02:51

Post a followup to this message