Window Hider problem

03/16/2009 20:25 plachta1234#1
Ich wollte mir grad ein kleines Tool bauen doch anstatt das angegebene Fenster zu Hiden, Hided es sich selber.
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Window Hider"300179193125)
$Button1 GUICtrlCreateButton("Hide"3216217330)
$Button2 GUICtrlCreateButton("Show"3256217330)
$Input1 GUICtrlCreateInput("Window Name"409620921)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$read1 GuiCtrlRead ($Input1)
$hWnd WinGetHandle ($read1)

While 
1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button2
            _Show
()
        Case 
$Button1
            _Hide
()
    EndSwitch
WEnd

Func _Show
()
    
WinSetState($hWnd"", @SW_SHOW)
EndFunc   

Func _Hide
()
    
WinSetState($hWnd"", @SW_HIDE)
EndFunc 
Wo liegt mein Problem?
03/16/2009 20:45 buFFy!#2
Quote:
Originally Posted by plachta1234 View Post
Ich wollte mir grad ein kleines Tool bauen doch anstatt das angegebene Fenster zu Hiden, Hided es sich selber.
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Window Hider"300179193125)
$Button1 GUICtrlCreateButton("Hide"3216217330)
$Button2 GUICtrlCreateButton("Show"3256217330)
$Input1 GUICtrlCreateInput("Window Name"409620921)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$read1 GuiCtrlRead ($Input1)
$hWnd WinGetHandle ($read1)

While 
1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button2
            _Show
()
        Case 
$Button1
            _Hide
()
    EndSwitch
WEnd

Func _Show
()
    
WinSetState($hWnd"", @SW_SHOW)
EndFunc   

Func _Hide
()
    
WinSetState($hWnd"", @SW_HIDE)
EndFunc 
Wo liegt mein Problem?
Versuch einfach nicht soviele Variablen und Funktionen zu verschachteln..
benutzen wir einfach mal das von blauwiggle geliebte Wort "Stackoverflow".

Code:
#include <ButtonConstants.au3> 
#include <EditConstants.au3> 
#include <GUIConstantsEx.au3> 
#include <WindowsConstants.au3> 

#Region ### START Koda GUI section ### Form= 
$Form1 = GUICreate("Window Hider", 300, 179, 193, 125) 
$Hide = GUICtrlCreateButton("Hide", 32, 16, 217, 33, 0) 
$Show = GUICtrlCreateButton("Show", 32, 56, 217, 33, 0) 
$WINDOWNAME = GUICtrlCreateInput("Window Name", 40, 96, 209, 21) 
GUISetState(@SW_SHOW) 
#EndRegion ### END Koda GUI section ### 

While 1 
    $nMsg = GUIGetMsg() 
    Switch $nMsg 
        Case $GUI_EVENT_CLOSE 
            Exit 
        Case $Show
            WinSetState(GuiCtrlRead($WINDOWNAME), "", @SW_SHOW) 
        Case $Hide
            WinSetState(GuiCtrlRead($WINDOWNAME), "", @SW_HIDE)
    EndSwitch 
WEnd 

Func _Show() 
    WinSetState(GuiCtrlRead($WINDOWNAME), "", @SW_SHOW) 
EndFunc    

Func _Hide() 
    WinSetState(GuiCtrlRead($WINDOWNAME), "", @SW_HIDE) 
EndFunc
03/16/2009 21:13 plachta1234#3
oh danke schön es funktioniert perfekt