#!/usr/bin/perl
use strict;
use Win32::GUI;
#zsyourdad
my $dos = Win32::GUI::GetPerlWindow();
Win32::GUI::Hide($dos);
my $Window = new Win32::GUI::Window (
-name => "Window",
-title => "NetSend Utility",
-pos => [100, 100],
-size => [200, 375],
-minsize => [200, 375],
) or die "new Window";
$Window->AddLabel(
-text => "Which user do you wish to message?",
-pos => [6, 1],
);
# Create Textfield for Edit Text
$Window->AddTextfield(
-name => "user",
-pos => [6, 20],
-size => [100, 25],
-multiline => 0,
-hscroll => 0,
-vscroll => 0,
-autohscroll => 0,
-autovscroll => 0,
-keepselection => 1,
);
#Text Asking What you wish to send
$Window->AddLabel(
-text => "What text do you wish to send",
-pos => [6, 60],
);
#Textfield for The text you wish to send...
$Window->AddTextfield(
-name => "text",
-pos => [6, 80],
-size => [100, 25],
-multiline => 0,
-hscroll => 0,
-vscroll => 0,
-autohscroll => 0,
-autovscroll => 0,
-keepselection => 1,
);
#How Many Times are you going to send the text?
$Window->AddLabel(
-text => "How many times do you wish to send?",
-pos => [6, 120],
);
$Window->AddTextfield(
-name => "timed",
-pos => [6, 140],
-size => [100, 25],
-multiline => 0,
-hscroll => 0,
-vscroll => 0,
-autohscroll => 0,
-autovscroll => 0,
-keepselection => 1,
);
#Adds Button To $window
$Window->AddButton(
-name => "Button1",
-text => "Net Send!",
-pos => [ 10, 300 ],
);
$Window->Show();
Win32::GUI::Dialog();
sub myWindow_Terminate {
return -1;
}
sub Button1_Click {
my $times = $Window->timed->Text;
my $text = $Window->text->Text;
my $user = $Window->user->Text;
#while we are sending the text we want the user to know whats going on
$Window->Button1->Text("Sending..");
#starts a while loop that will end when the value of $times is equal to less then or equal to zero
while ($times > 0)
{
system "Net Send $user $text\n";
$Window->Button1->Text("$times\n");
#Deceasing the value of $times? <?>
$times--;
};
$Window->Button1->Text("Sent!");
}