use strict; use warnings; use Tk; use Win32::FileOp; my $mw = MainWindow -> new; $mw -> withdraw; my $windowid = hex ($mw -> id); my $openbutton = $mw -> Button ( -text => 'Open', -command => \&opensub, ) -> pack; my $savebutton = $mw -> Button ( -text => 'save', -command => \&savesub, ) -> pack; my $browsebutton = $mw -> Button ( -text => 'browse', -command => \&browsesub, ) -> pack; $mw -> Popup; MainLoop; sub opensub { my $file = OpenDialog(-title => "open", -handle => $windowid); } sub savesub { my $file = SaveAsDialog(-title => "save", -handle => $windowid); } sub browsesub { my $dir = BrowseForFolder ("no handle"); my $dir1 = BrowseForFolder("with handle", -handle => $windowid); }