From: Rogers, J. <rog...@oc...> - 2002-07-11 00:19:43
|
These two curious scripts below where posted on this list some time = ago, (there is no archive search sorry I dont know who) Its probably not quite what you wanted, but could be worth a play. #-------------sender.pl #!perl -w use strict; use Win32::GUI; my $hwind =3D &gethandle; #my $hwind =3D <STDIN>; print "hwind $hwind"; print "\nEnter text: "; my $text =3D <STDIN>; Win32::GUI::Text($hwind, $text); Win32::GUI::InvalidateRect($hwind, 1); #EOF sub gethandle{ my $winname=3D'Autoscroller'; my $desktop =3D GUI::GetDesktopWindow(); my $window =3D GUI::GetWindow($desktop, GW_CHILD); while($window) {my $title =3D GUI::Text($window); if($title eq "$winname"){print "found $winname\n"; =09 my $window2 =3D GUI::GetWindow($window, GW_CHILD); =09 $hwind=3D$window2; =09 } $window =3D GUI::GetWindow($window, GW_HWNDNEXT); } $hwind} ###end #------mainwindow.pl use strict; use Win32::GUI; my $winMain =3D new Win32::GUI::Window( -left =3D> 13, -top =3D> 32, -width =3D> 439, -height =3D> 260, -name =3D> "winMain", -text =3D> "Autoscroller", ); $winMain->AddLabel( -text =3D> "lblTest", -name =3D> "lblTest", -left =3D> 0, -top =3D> 0, -width =3D> 400, -height =3D> 250, ); $winMain->lblTest()->Text("The hwind is: " . $winMain->lblTest()->{-handle}); $winMain->Show(); Win32::GUI::Dialog(); ####finish =20 John Rogers System Engineer Oce Australia Ph 3212 8114=20 ##############################################################=20 Disclaimer=20 If this e-mail has been sent to you in error, please notify=20 Oc=E9-Australia Limited immediately and delete this e-mail from=20 your system.=20 Any views expressed in this e-mail are those of the individual=20 sender and may not necessarily reflect the views of=20 Oc=E9-Australia Limited.=20 ############################################################## |