Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 18:04

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



GUICtrlRead und WinSetState

Discussion on GUICtrlRead und WinSetState within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
HardCore.1337's Avatar
 
elite*gold: 1
Join Date: Feb 2009
Posts: 1,726
Received Thanks: 729
GUICtrlRead und WinSetState

Hi, ich hätte da mal eine Frage. Und zwar programmier ich grade ein Programm (Script), das ein beliebiges Programm beendet, minimiert oder maximiert.

Mein Code:
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Konfiguration"447163192124)
GUISetBkColor(0xFFFFFF)
$Group1 GUICtrlCreateGroup("HotKey"16016281137)
GUICtrlSetFont(-1104000"MS Sans Serif")
$Label1 GUICtrlCreateLabel("Fenster minimieren  -  Nummernfeld Minus"1769625120)
$Label2 GUICtrlCreateLabel("Anwendung Beenden  -  Ende"1767216720)
$Label3 GUICtrlCreateLabel("Programm Beenden  -  Escape"1764818820)
$Label4 GUICtrlCreateLabel("Fenster maximieren  -  Nummernfeld Plus"17612024620)
GUICtrlCreateGroup("", -99, -9911)
$Button1 GUICtrlCreateButton("Programm Beenden"812812325$WS_GROUP)
$Label5 GUICtrlCreateLabel("Wie heißt das Programm?"82412517)
$Input1 GUICtrlCreateInput(""84812121)
$Button2 GUICtrlCreateButton("Speichern"88012325$WS_GROUP)
GUISetState(@SW_SHOW)
$read INIRead ("C:\Settings.ini""Main""Value""")
_GUICtrlEdit_SetText($Input1$read)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            
Exit
        Case 
$Button2
            FileIniWrite
()

    EndSwitch
WEnd

$var 
GUICtrlRead ($Input1)

Func FileIniWrite ()
    
$var GUICtrlRead ($Input1)
    
IniWrite ("C:\Settings.ini""Main""Value"$var)
EndFunc

HotKeySet 
("{ESC}""Terminate")
HotKeySet ("{End}""_CLOSE")
HotKeySet ("M""MAx")
HotKeySet ("n""Min")



Func Terminate ()
    Exit 
1
EndFunc

Func _CLOSE 
()
    
WinKill ($var)
EndFunc

Func MAX 
()
    
WinSetState ($var"", @SW_SHOW)
EndFunc

Func Min 
()
    
WinSetState ($var"", @SW_HIDE)
EndFunc 
Also Fehler enstehen keine (Syntaxfehler) aber es passiert einfach nix. Hab den Code mal an Solitär probiert, aber wenn ich M oder n drücke verkleinert noch vergrößert sich das fenster. Schließen kann ich es auch nicht. Woran liegt es?

mfg
HardCore.1337 is offline  
Old 12/10/2009, 15:55   #2
 
elite*gold: 1
Join Date: Oct 2008
Posts: 1,078
Received Thanks: 276
Die Hotkeys werden erst nach der Whileschleife eingestellt, funktionieren also nich
.nAno is offline  
Thanks
1 User
Old 12/10/2009, 17:45   #3
 
HardCore.1337's Avatar
 
elite*gold: 1
Join Date: Feb 2009
Posts: 1,726
Received Thanks: 729
Danke
HardCore.1337 is offline  
Old 12/10/2009, 18:04   #4
 
elite*gold: 1
Join Date: Oct 2008
Posts: 1,078
Received Thanks: 276
np
.nAno is offline  
Old 12/10/2009, 18:21   #5
 
HardCore.1337's Avatar
 
elite*gold: 1
Join Date: Feb 2009
Posts: 1,726
Received Thanks: 729
Ich bin wohl bissel zu blöd dafür.
Das eigene Programm schließt sich, aber die Anwendung die geschlossen werden soll bleibt offen. Minimieren und maximieren geht erst gar nicht
HardCore.1337 is offline  
Old 12/10/2009, 19:18   #6
 
Xereon's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 793
Received Thanks: 366
Quote:
Originally Posted by General Desert View Post
Ich bin wohl bissel zu blöd dafür.
Das eigene Programm schließt sich, aber die Anwendung die geschlossen werden soll bleibt offen. Minimieren und maximieren geht erst gar nicht
Wenn sich dein Programm schließt, ist das meistens eine Folge von einen Runtime-Fehler. Guck mal in der Konsole, ob da was steht.
Xereon is offline  
Old 12/10/2009, 19:47   #7
 
banjo1's Avatar
 
elite*gold: 1371
Join Date: Dec 2007
Posts: 14,904
Received Thanks: 19,354
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Konfiguration"447163192124)
GUISetBkColor(0xFFFFFF)
$Group1 GUICtrlCreateGroup("HotKey"16016281137)
GUICtrlSetFont(-1104000"MS Sans Serif")
$Label1 GUICtrlCreateLabel("Fenster minimieren  -  Nummernfeld Minus"1769625120)
$Label2 GUICtrlCreateLabel("Anwendung Beenden  -  Ende"1767216720)
$Label3 GUICtrlCreateLabel("Programm Beenden  -  Escape"1764818820)
$Label4 GUICtrlCreateLabel("Fenster maximieren  -  Nummernfeld Plus"17612024620)
GUICtrlCreateGroup("", -99, -9911)
$Button1 GUICtrlCreateButton("Programm Beenden"812812325$WS_GROUP)
$Label5 GUICtrlCreateLabel("Wie heißt das Programm?"82412517)
$Input1 GUICtrlCreateInput(""84812121)
$Button3 GUICtrlCreateButton("Hotkey aktiviere"810412325$WS_GROUP)
$Button2 GUICtrlCreateButton("Speichern"88012325$WS_GROUP)
GUISetState(@SW_SHOW)
$read INIRead ("C:\Settings.ini""Main""Value""")
_GUICtrlEdit_SetText($Input1$read)
#EndRegion ### END Koda GUI section ###



While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            
Exit
        Case 
$Button2
            FileIniWrite
()
        Case 
$Button3
            Hotkey
()
    EndSwitch
WEnd


Func FileIniWrite 
()
    
$var GUICtrlRead ($Input1)
    
IniWrite ("C:\Settings.ini""Main""Value"$var)
EndFunc


Func Hotkey 
()
HotKeySet ("{ESC}""Terminate")
HotKeySet ("{End}""_CLOSE")
HotKeySet ("m""Max")
HotKeySet ("n""Min")
    
EndFunc

Func Terminate 
()
    Exit 
1
EndFunc

Func _CLOSE 
()
    
$var GUICtrlRead($Input1)
    
WinKill ($var)
EndFunc

Func Max 
()
    
$var GUICtrlRead($Input1)
    
WinSetState ($var"", @SW_MINIMIZE)
EndFunc

Func Min 
()
    
$var GUICtrlRead($Input1)
    
WinSetState ($var"", @SW_RESTORE)
EndFunc 
banjo1 is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Schnelle Hilfe]Guictrlread???
04/08/2010 - AutoIt - 2 Replies
Hallo will mal schnell fragen mach grade nen script für mich in SciTe bzw. AutoIt... also wie macht man das nochmal mit send, guictrlread under input? also ich meins so ist falsch ich weiß... (glaub ich) send(Guictrlread=$input1) was hab ich da falsch gemacht?? hatte das mal im kopf doch dann hab ichs vergessen thx für help.
Problem mit GUICtrlRead
11/26/2009 - AutoIt - 8 Replies
Wollte hier n Script machen welches ne eingegebene IP bzw Hostnamen pingen kann und auch nen anderen Rechner durchsuchen kann (das ist erstma zweitrangig). Problem ist das das anpingen beim 1. mal funktioniert und beim 2. mal nur 0 gepingt wird. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\hans\desktop\autoit test\lanchecker\w gui\lan checker v01a gui.kxf...
[HILFE] GuiCtrlRead funst nit
09/19/2009 - AutoIt - 10 Replies
Hey, ich habe ein problem #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\admin\desktop\autoexpspender.kxf $Auto = GUICreate("mouwMOUW", 633, 447, 193, 125) GUISetBkColor(0x000080)



All times are GMT +2. The time now is 18:04.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.