Steve,

I've been tearing my hair out for a few days trying to get these Hooks
to work (and hoping not to have to bug you), but am just about out of
ideas. The following code (as brief as I can make it) doesn't work:

use Win32::GUI;
my $mw = new Win32::GUI::Window(-name => "mw");
sub mw_Terminate {return -1}
sub windowmoved {print "WM_MOVE\n"}
$mw->Hook(3, \&windowmoved);
print "Hook\n";
$mw->Show();
Win32::GUI::Dialog();

I ran that, moved the window and exited. I see the "Hook" message, but
no "WM_MOVE". From your example, I believe that code should work. Am I
right? I substituted the Dialog() call with a PeekMessage loop and see a
few messages (much fewer than I expected) but no WM_MOVE and no
WM_NOTIFY, which is where I'm hoping to get to eventually. That confused
me. I did see a message 15 (WM_PAINT?) and tried that in the Hook call,
but still can't get the handler to fire.

If the perl code is correct, could this be something in my environment?
I was running perl 5.8.0 (ActiveState build 806) with Laurent's
Win32-GUI-0.0.670-PPM-5.8. I upgraded to perl 5.8.2 (808) with no
change. I then built 0.0.670 from scratch using MinGW following
Laurent's instructions. After a few hiccups, that compiled OK but Hooks
still didn't work. I then tried your latest GUI.xs but couldn't even get
that to compile. Have you compiled it with MinGW?

Do you know if anyone else has had any success with Hooks?

Thanks once again for any help,
Glenn





Reply via email to