 |
Forums |
Admin Discussion Forums: help Start New Thread
By: Daniel Berger
RE: no Ruby 2.x support for Win32::API ?? [ reply ] 2009-10-19 02:51
|
I should have said, "They've already declared that they're not going to support Win32API in 2.x".
I'm not sure if that's true any more, though. Seems like it's still in 1.9.x. But it doesn't matter. You should use win32-api because of its support for callbacks and function pointers if nothing else.
Regards,
Dan
|
By: Dan Rathbun
RE: no Ruby 2.x support for Win32::API ?? [ reply ] 2009-10-18 23:17
|
DB wrote:
"They've already declared that they're not going to support win32-api in 2.x. Besides, I don't trust them to manage it."
I thot you had said in the release notes, that it was the OLD 1.6.x WIN32API.so that was to be dropped from Ruby 2.x?
In that last post in this thread, you said "win32-api" (which is *your* package!) I need a replacement for the old WIN32API if it will not be supported by Ruby 2.x? Can you clarify?
|
By: Daniel Berger
RE: I'm so confuse. Win32API or Win32::API [ reply ] 2008-05-29 19:38
|
Yes, Win32API is what ships with the Ruby standard library. The win32-api library is our own interface.
You should always use win32-api (ours) because our library supports callbacks and Win32API does not.
Preserving your original code is just a matter of changing the constructor arguments. In ours the dll goes last instead of first, and defaults to 'kernel32'.
HTH,
Dan
|
By: Bob Whiteside
I'm so confuse. Win32API or Win32::API [ reply ] 2008-05-29 18:07
|
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
|
|
 |