Thank you!
You actually answered my question that I asked in Tk::DialogBox as the top window. When I was reading your post, I suddenly realized that to raise the DailogBox to front is not enough. What I should do is to:
- Bring console window to font
- show DialogBox
I modified your code a little bit just because I am more used to Win32::API ;-)
my $api1 = Win32::API->new('kernel32', 'GetConsoleWindow', '', 'N');
my $api2 = Win32::API->new('user32', 'ShowWindow' , 'NN', 'N');
my $i = $api1->Call();;
$api2->Call($i, 1);
my $dialog = $mw->DialogBox(-title => "Is $host trusted?", -buttons =>
+ ["Yes", "No"]);
$dialog->geometry("600x50+0+0");
$dialog->deiconify();
my $answer = $dialog->Show();
|