Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

find windows each time

  • Loading branch information...
commit d6fe5f4942e30243c452ed1885302216b3f5acf4 1 parent 72e7fc9
@mj41 authored
Showing with 16 additions and 6 deletions.
  1. +16 −6 taskbar-pamilla.pl
View
22 taskbar-pamilla.pl
@@ -148,8 +148,14 @@ sub new {
my $ShowWindow = new Win32::API('user32', 'ShowWindow', 'NN', 'N');
my $title = 'Pamilla';
- my $hw = $FindWindow->Call( 0, $title );
- $ShowWindow->Call( $hw, 0 ); # SW_HIDE
+
+ my $get_window = sub {
+ return $FindWindow->Call( 0, $title );
+ };
+ my $hw = $get_window->();
+ if ( $hw ) {
+ $ShowWindow->Call( $hw, 0 ); # SW_HIDE
+ }
$this->{selected_item} = @tb_items_order[0];
my $sub_select_takbar = sub {
@@ -164,10 +170,14 @@ sub new {
wxTheClipboard->Close;
}
- if ( $item_rawname eq 'paused' ) {
- $ShowWindow->Call( $hw, 0 ); # SW_HIDE
- } else {
- $ShowWindow->Call( $hw, 3 ); # SW_SHOWMAXIMIZED
+
+ my $hw = $get_window->();
+ if ( $hw ) {
+ if ( $item_rawname eq 'paused' ) {
+ $ShowWindow->Call( $hw, 0 ); # SW_HIDE
+ } else {
+ $ShowWindow->Call( $hw, 3 ); # SW_SHOWMAXIMIZED
+ }
}
$this->{selected_item} = $item_rawname;

0 comments on commit d6fe5f4

Please sign in to comment.
Something went wrong with that request. Please try again.