PB4 - Beta 2 questions

Everything else that doesn't fall into one of the other PB categories.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

PB4 - Beta 2 questions

Post by SFSxOI »

Although I thought i'd be able to get around to using beta 2 sooner, i didn't get to it until today.

I see in the readme.html these two items:

changed: WindowMouseX(#Window) - new parameter
changed: WindowMouseY(#Window) - new parameter

the parameter (#Window) - does this mean we still have to create a window before we can use these commands? In other words, we can't use these commands to interact with another window not created by our code? If you can use these commands to interact with another window, whats the proper way to fill in the parameter by getting a #Window from the other 'foreign' window?
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

You can use DesktopMouseX/Y() to get screen coordinates without the need for a window.
quidquid Latine dictum sit altum videtur
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Thanks freak for your response,

But....i don't want the DesktopMouseX/Y()

I do a lot of interaction with other windows that my code doesn't create. I need WindowMouseX() and WindowMouseY(), i need the X and Y of the mouse in the other windows.

from reading the help in version 3.94 it says that the mouse commands in 3.94 use directX and directinput, however, you can't use them to interact with other windows that your code does not create unless its something like a native windows application like paint.exe or something. Most of the time, actually all of the time, the foreign windows i need to interact with are already open, and need to be already open before any 'interaction interface' takes place so opening them from PB is not an option most of the time. And....lately i'm running into a lot of stuff that uses directinput, so i need some commands that will allow me to control the mouse in these other applications windows.

So, unless i'm looking at this wrong, that PB uses directX and directinput for its mouse commands but will only work if your code creates the window or its a native window application (paint.exe and notepad.exe for example), then the PB mouse commands don't work with other windows because of this need for a #Window parameter which PB doesn;t seem to be aware of for other windows it doesn't create.
freak wrote:You can use DesktopMouseX/Y() to get screen coordinates without the need for a window.
Post Reply