Garrett Goebel wrote:
>I'm posting this again... since the last time I posted was in the middle
>of the holidays and I got no response. BTW, does anyone know where dada
>is? His website has been down for a couple days now.
taadaa! I'm here :-)
sorry friends, I was in (much needed :-) holidays during holidays,
but I've not forgot you all and I've done a *lot* of work on Win32::GUI...
my website is down and will continue to be down for some days, we had
and still having very serious problems (visiting hackers with all the
consequences that you can imagine).
well, at least now you know that I'm still alive... and now let's come to
your message: first of all, thank you for your contribution!
I didn't used the patch process since my XS changes almost every day and so
I prefer to apply the changes manually, but I really appreciated it and I
invite everyone to do the same ;-)
regarding the functions you submitted, this is the status of the art with
some comments:
- SendMessageTimeout()
OK, implemented with some changes, see GetWindowThreadProcessId()
- Maximize()
OK
- SetCapture()
OK
- ReleaseCapture()
OK
- GetDlgItem()
TODO
- GetCurrentProcess()
TODO (but does it really belong to Win32::GUI??? it seems to have
more to do with process management than with user interface)
- GetCurrentProcessId()
redundant, you can use Perl's internal $$ to get there
- GetCurrentThread()
see GetCurrentProcess()
- GetCurrentThreadId()
see GetCurrentProcess()
- AttachThreadInput()
OK
- GetWindowThreadProcessId()
OK, implemented with some changes (see below)
>I'm having a problem with the last.
your problem is that you cannot pass a pointer (LPDWORD) directly
as a perl variable; your implementation is:
>DWORD
>GetWindowThreadProcessId(handle, lpdword)
> HWND handle
> LPDWORD lpdword
>CODE:
> RETVAL = GetWindowThreadProcessId(handle,lpdword);
>OUTPUT:
> RETVAL
but this should really be:
void
GetWindowThreadProcessId(handle)
HWND handle
PREINIT:
DWORD tid;
DWORD pid;
PPCODE:
tid = GetWindowThreadProcessId(handle, &pid);
EXTEND(SP, 2);
XST_mIV(0, tid);
XST_mIV(1, pid);
XSRETURN(2);
this way:
1) "pid" is allocated as a DWORD, otherwise you're writing
8 bytes into a non-allocated address and get the
"instruction referenced memory that can not be read..."
error.
2) Perl returns an array of two values containing the
tid (thread identifier) and pid (process identifier), a
better way to get the info you requested.
the same applies to SendMessageTimeout(), where you
also did put an LPDWORD in the input parameter list.
...and of course, you don't need to add LPDWORD to
the TYPEMAP.
BTW:
>I do:
>my $dlg_tpid = $gui->GetWindowThreadProcessId($handle,$whatever);
>
>I get:
>"Usage: Win32::GUI::GetWindowThreadProcessId(handle, lpdword) at
>AutoTest.pm line 228"
this way you're using the function as a method, and you're effectively
passing 3 parameters: the reference to the $gui object, $handle and
$whatever.
the correct use (with the correct implementation, of course) is:
>my $dlg_tpid = GUI::GetWindowThreadProcessId($handle);
eg. you must call it as a "standalone" function, not as a method.
hope this helps...
PS: more exciting news about the Win32::GUI module will follow
shortly ;-)
bye,
Aldo Calpini
<[EMAIL PROTECTED]>
LIBERA ME DOMINE DE MORTE AETERNA
IN DIE ILLA TREMENDA
QUANDO COELI MOVENDI SUNT
ET TERRA