in reply to Re^4: Win32 GUI Window Problem
in thread Win32 GUI Window Problem
You'd get better responses if your code showed some semblence of effort. A few questions:
Anyway, try this:
#! perl -slw use strict; use Win32::GUI(); use Win32::Sound; my $filename="yourfile.dat"; open(TXT, $filename)||die("Could not open file!"); my @filedata = <TXT>; close(TXT); my( $running, @alerts ) = 0; my $p = 100; for my $element ( @filedata ) { if( $element =~ /(\s+)(\d{1,4})(\.\d{1,4}){3}(\s+)/) { push @alerts, Build_Window( $element, $p += 10 ); ++$running; } } sub Alert_Terminate { return --$running ? 1 : -1; } sub Build_Window { my( $element, $pos ) = @_; my $win = new Win32::GUI::Window( -name => "Alert", -width => 500, -height => 150, -pos => [ $pos, $pos ] ); my $font = Win32::GUI::Font->new( -name => "Arial", size => 46, -bold => 1 ); $win->AddLabel(-text => localtime(), -font => $font); $win->AddLabel( -text => "SNORT ALERT: MALICIOUS BEHAVIOR DETECTED!", -font => $font, -top => 50 ); $win->AddLabel(-text => $element, -font => $font, -top => 75); Win32::Sound::Play("SystemExclamation"); $win->Show(); return $win; } Win32::GUI::Dialog();
But be aware, your apparent lack of understanding, and of effort to understand, means that you are going to have to start reading some documentation, and try to develop your understanding by writing a few simple (non-GUI) programs, before you will get further help from me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Win32 GUI Window Problem
by Acid Amygdala (Novice) on Feb 09, 2009 at 21:47 UTC | |
by BrowserUk (Patriarch) on Feb 09, 2009 at 22:33 UTC | |
by Acid Amygdala (Novice) on Feb 10, 2009 at 20:34 UTC |