Re: php local application send mouse click

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12 Apr 2008, at 15:25, Daniel Kolbo wrote:
Stut wrote:
On 12 Apr 2008, at 00:13, Daniel Kolbo wrote:
In addition to the function i mentioned from winbinder wb_send_message() I have tried:

I tried loading in the user32.dll extension from within the php.ini, this failed. I tried loading in the user32.dll from within the script, this failed.

dl("user32.dll")
The dl function is for loading PHP extensions, not any old DLL. The same goes for the extensions section of php.ini.
I tried loading in the php_w32api.dll from within the script (i copied the php_w32api.dll from php4 into my ext/ folder in php5.

dl("php_w32api.dll");

this worked; however, when I tried registering the functions from within the script it failed on me.

w32api_register_function("User32.dll",
                       "mouse_event",
                       "void");

I really am at a lose of how to even begin. How would I execute a mouse click from a php script on a console application?
1) You should be using SendInput not mouse_event unless you're on Windows 9x. 2) Why are you trying to do this in PHP? It would be much easier to develop and test in C# or VB or even C++. At the very least I'd recommend doing that to get the sequence of API calls worked out and then port it over to PHP.
-Stut

RE: 1) I agree. I read a lot of people were having problems with SendInput, so I just tried it with mouse_event.

RE: 2) I am choosing PHP b/c i am better skilled in PHP. Alas, I have pretty much resigned to having to develop this in C# of VB. I am reading the zend page on developing php extensions. I figure I will develop the php extension in C# or VB, then load it in php. Is this what you mean by "port" to PHP?

Get it working in another language so you know which API calls you need, then work on getting access to those calls to work from PHP.

If your only reason for doing it in PHP is your experience I'd suggest just doing it in C# and don't bother porting it. By porting it I mean converting it from C# to PHP.

One other thing worth asking yourself... is there an easier way to achieve what you want than simulating a mouse click? You might have better luck telling the screen control you need to click on that it's been clicked rather than actually programmatically clicking the mouse button. But that's going way beyond the scope of this list. I suggest you ask in one of the MS support forums.

-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux