LocusSolus LocusSolus - 1 year ago 215
Perl Question

How can I detect window resize event using Win32::GUI and WM_DISPLAYCHANGE?

I am struggling to make a simple receive

informing my Win32::GUI app that the Windows Screen Resolution has changed, since the results for this question here is "0" accordingly informed by the search engine.

Could you provide a simple working example of a simple
program that detects a
message and prints some info about that change in resolution?

Answer Source

From user "beech" at PerlMonks:

Try using the Hook method:

something like

$main->Hook( WM_DISPLAYCHANGE(), \&onDisplayChange );
sub onDisplayChange {
    my( $object, $wParam, $lParam, $type, $msgcode) = @_;
    print "Click handler called!\n";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download