On Fri, May 27, 2011 at 7:29 PM, Mark Dootson <mark.doot...@znix.com> wrote:
>
>> in Win32::API. It works OK, (I've done this in the past though can't
>> track any code down at present).
>
> Tracked down now:
>
> my $SendMessageTimeout = new Win32::API('user32',
> 'SendMessageTimeout','NNNPNNP', 'N')
>        or die "Get SendMessageTimeout: "  . Win32::FormatMessage
> (Win32::GetLastError ());

Thanks for the code!
One small thing. I think the recommended way to use "new" is to always use
the direct mode ( Win32::API->new ) and not the indirect (new Win32::API )
as the latter will not always do the right thing.

Arguably if all I have is the above code in my script then the problem won't
be triggered but I think most people, if regularly see such code they
will not know
when to avoid it. So I think it would be better not to use it even in places
where it is harmless.

Gabor

Reply via email to