From: Jonathan S. <jso...@al...> - 2001-03-29 13:50:07
|
Harold, Thanks!!! I think that will work well enough for me. Jonathan ----- Original Message -----=20 From: Piske, Harald=20 To: 'per...@li...'=20 Sent: Wednesday, March 28, 2001 5:46 PM Subject: RE: [perl-win32-gui-users] desktop Hi Jonathan. =20 I found a way - not exactly easy, probably far from perfect, but it = works. I hide all windows - walking backwards through the chain of = desktop children, to avoid making each active just before hiding it. = Then I cover the background with a big, fat, ugly, black rectangle and = show my own window. Note I restore all the hidden stuff in END{}. = Otherwise, if your program dies, you'll end up with a perfectly = invisible OS. On the other hand, that might avoid a few annoying windows = faults ... =20 Have fun Harald =20 use Win32::GUI; use Win32::API; BEGIN { undef $blank; undef @hidden; $CreateWindowEx =3D new Win32::API ('user32', $_ =3D = 'CreateWindowEx', [N,P,P,N,I,I,I,I,I,I,I,P], I) or die $_; $ShowWindow =3D new Win32::API ('user32', $_ =3D 'ShowWindow', [I, = I], I) or die $_; $DestroyWindow =3D new Win32::API ('user32', $_ =3D 'DestroyWindow', = [I], I) or die $_; } END { $ShowWindow->Call ($_, 8) for @hidden; $DestroyWindow->Call ($blank) if $blank; undef $CreateWindowEx; undef $DestroyWindow; undef $ShowWindow; } $Main =3D new Win32::GUI::Window (-name =3D> 'Main', -pos =3D> [100, 100], -size =3D> [400, 300]); sub Main_Terminate {-1} $Main->AddLabel (-name =3D> $_ =3D 'All alone!', -text =3D> $_, -pos =3D> [160, 110]); $desktop =3D $Main->GetDesktopWindow (); $_ =3D Win32::GUI::GetWindow ($desktop, GW_CHILD); $_ =3D Win32::GUI::GetWindow ($_, GW_HWNDLAST); do { if (Win32::GUI::IsVisible ($_)) { push @hidden, $_; $ShowWindow->Call ($_, 0);} } while $_ =3D Win32::GUI::GetWindow ($_, GW_HWNDPREV); @area =3D Win32::GUI::GetWindowRect ($desktop); $blank =3D $CreateWindowEx->Call (0, $_ =3D 'STATIC', '',=20 0x5C000004, @area, $desktop, 0, 0, 0) or die $_; $Main->Show (); Win32::GUI::Dialog (); -----Original Message----- From: Jonathan Southwick [mailto:jso...@al...] Sent: Wednesday, March 28, 2001 10:31 To: per...@ht... Subject: [perl-win32-gui-users] desktop Is there any way to blackout the desktop (as a screensaver would) = using the GUI module? I still want to be able to show my own windows I = create in my program. Jonathan Southwick Technical & Network Services Allegheny College, Meadville, PA jso...@al... |