Hello,
I am mostly familiar with php for serving up web pages; however,
recently I have been writing a local command line script on my WinXP
machine. I have spent the better part of this last week and all of
today trying to figure out a way to send a mouse click to a particular
window on the screen.
I first saw w32api.dll on the php.net site. However, I cannot find this
dll, but this searching took me to winbinder and php-gtk2. It seems
that I can only get winbinder to get (not send) mouse information: event
type and x,y positions. I am not too familiar with php-gtk nor creating
dlls.
I want to use my local php command line script on my winXP machine to
send mouse events (click) to a window. I am open to any ideas on how to
do this.
For C++ and VB there seems to be the SendMessage() function. Is there a
way to tap into that function from my php script?
winbinder has a function that wraps the SendMessage() function called
wb_send_message, but after literally 9 hours i quit.
on the MSDN.microsoft site, I saw the functions mouse_event() and
SendInput() of the "user32.dll"
http://msdn2.microsoft.com/en-us/library/ms646310.aspx
http://msdn2.microsoft.com/en-us/library/aa932376.aspx
I copied the "user32.dll" to my php/ext folder and tried loading the
"user32.dll" both as an extension directive in php.ini and by using the
dl() function in my script (dl() is enabled). However, both methods
gave me a PHP warning:
as an extension in php.ini it gives the following error:
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library)
'user32.dll
' in Unknown on line 0
get_loaded_extensions() confirms user32.dll never gets loaded.
invoking dl("user32.dll") yields the warning:
PHP Warning: dl(): Invalid library (maybe not a PHP library)
'user32.dll' in [my script]
Possible ideas:
-Load a dll with the dl() function? (Write the dll with VB or C++)
-use the w32api_register_function() in php somehow to 'tap' into windows
api functions.
-use a project that can assist me in this like php-gtk2 or winbinder
-maybe someone has a copy of w32api.dll
-something about COM objects, though i am really not familiar
It seems as though the C languages and VB languages can do this.
Perhaps I could write and compile a dll in that language, somehow load
it up in php (even though i am having errors doing that currently), then
I can use those functions in my dll to send my mouse clicks through php.
I am throwing out this question to the community and wondering what your
suggestions would be for how to go about sending a mouse click event to
my windows api from a php script.
I am not interested in writing javascript as this is not a web application.
Any thoughts, comments, suggestions, about how to do send mouse events
from a php script will be much appreciated.
Thanks in advance,
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php