Oh! Ja! Dann passiert das nur bei Win7?
Verdammt! Kennt jemand einen Ausweg?
Nachtrag: Unter Win7 passiert das sowohl als 64Bit- als auch als 32Bit-Version. Liegt also scheinbar nicht an 64Bit.
Oh! Ja! Dann passiert das nur bei Win7?
Verdammt! Kennt jemand einen Ausweg?
Nachtrag: Unter Win7 passiert das sowohl als 64Bit- als auch als 32Bit-Version. Liegt also scheinbar nicht an 64Bit.
Wenn ich eine Rebar an die Größe der GUI anpasse, dann werden die einzelnen Elemente nicht refresht (siehe Screenshots).
Wie kann ich das refreshen hinkriegen?
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GuiReBar.au3>
#include <GuiToolBar.au3>
#include <GuiComboBox.au3>
#include <GuiDateTimePicker.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <GuiConstantsEx.au3>
Opt("MustDeclareVars", 1)
$Debug_RB = False
Global $hReBar
GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
_main()
Func _main()
Local $hgui, $btnExit, $hToolbar, $hCombo, $hDTP, $hInput
Local Enum $idNew = 1000, $idOpen, $idSave, $idHelp
$hgui = GUICreate("Rebar", 400, 396, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX))
; create the rebar control
$hReBar = _GUICtrlRebar_Create($hgui, BitOR($CCS_TOP, $WS_BORDER, $RBS_VARHEIGHT, $RBS_AUTOSIZE, $RBS_BANDBORDERS))
; create a toolbar to put in the rebar
$hToolbar = _GUICtrlToolbar_Create($hgui, BitOR($TBSTYLE_FLAT, $CCS_NORESIZE, $CCS_NOPARENTALIGN))
; Add standard system bitmaps
Switch _GUICtrlToolbar_GetBitmapFlags($hToolbar)
Case 0
_GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_SMALL_COLOR)
Case 2
_GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR)
EndSwitch
; Add buttons
_GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW)
_GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN)
_GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE)
_GUICtrlToolbar_AddButtonSep($hToolbar)
_GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP)
; create a combobox to put in the rebar
$hCombo = _GUICtrlComboBox_Create($hgui, "", 0, 0, 120)
_GUICtrlComboBox_BeginUpdate($hCombo)
_GUICtrlComboBox_AddDir($hCombo, @WindowsDir & "\*.exe")
_GUICtrlComboBox_EndUpdate($hCombo)
; create a date time picker to put in the rebar
$hDTP = _GUICtrlDTP_Create($hgui, 0, 0, 190)
; add band with control
_GUICtrlRebar_AddBand($hReBar, $hCombo, 120, 200, "Dir *.exe")
; add band with date time picker
_GUICtrlRebar_AddBand($hReBar, $hDTP, 120)
; add band with toolbar to begining of rebar
_GUICtrlRebar_AddToolBarBand($hReBar, $hToolbar, "", 0)
;add another control
_GUICtrlRebar_AddBand($hReBar, GUICtrlGetHandle($hInput), 120, 200, "Name:")
$btnExit = GUICtrlCreateButton("Exit", 150, 360, 100, 25)
GUISetState(@SW_SHOW)
Sleep(1000)
WinMove($hgui, '', Default, Default, 500)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $btnExit
Exit
EndSwitch
WEnd
EndFunc ;==>_main
Func WM_SIZE($hWnd)
Local $wpos
$wpos = WinGetPos($hWnd)
ControlMove($hWnd, "", $hReBar, 0, 0, $wpos[2])
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_SIZE
Func WM_NOTIFY()
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
"!===========================================================" & @LF & _
"+======================================================" & @LF & _
"-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
"+======================================================" & @LF)
EndFunc ;==>_DebugPrint
Na, dann halt mit AdlibRegister:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]Global $WMP, $Button2, $channel = "http://blackbeats.fm/listen.asx", $Label
[/autoit] [autoit][/autoit] [autoit]$Form1 = GUICreate("Loop-Stop", 247, 109, 426, 173)
GUISetOnEvent(-3, "_Exit")
$WMP = ObjCreate("WMPlayer.OCX")
$Button1 = GUICtrlCreateButton("Play", 24, 56, 81, 41, 0)
GUICtrlSetOnEvent(-1, "_play")
$Button2 = GUICtrlCreateButton("Stop", 128, 56, 81, 41, 0)
GUICtrlSetOnEvent(-1, "_stop")
$Label = GUICtrlCreateLabel("Label", 32, 16, 80, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
While Sleep(50)
WEnd
Func _Exit()
Exit
EndFunc ;==>_Exit
Func _play()
$WMP.URL = $channel
$WMP.controls.play()
GUICtrlSetData($Label, "Loading...")
AdlibRegister('_loadcheck', 20)
EndFunc ;==>_play
Func _loadcheck()
If $WMP.playstate = 3 Then
GUICtrlSetData($Label, "Playing")
AdlibUnRegister('_loadcheck')
EndIf
EndFunc
Func _stop()
$WMP.controls.stop()
AdlibUnRegister('_loadcheck')
GUICtrlSetData($Label, "Stopped")
EndFunc ;==>_stop
Wichtig ist halt, dass Du die Funktion, die Du über einen Event aufrufst, schnell wieder verlässt, damit ein evtl. anderer Event (Stop-Button) abgearbeitet werden kann.
Alles im OnEventMode:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]Global $WMP, $Button2, $channel = "http://blackbeats.fm/listen.asx", $Label, $Play = False, $Stop = False
[/autoit] [autoit][/autoit] [autoit]$Form1 = GUICreate("Loop-Stop", 247, 109, 426, 173)
GUISetOnEvent(-3, "_Exit")
$WMP = ObjCreate("WMPlayer.OCX")
$Button1 = GUICtrlCreateButton("Play", 24, 56, 81, 41, 0)
GUICtrlSetOnEvent(-1, "_play")
$Button2 = GUICtrlCreateButton("Stop", 128, 56, 81, 41, 0)
GUICtrlSetOnEvent(-1, "_stop")
$Label = GUICtrlCreateLabel("Label", 32, 16, 80, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
While Sleep(50)
If $Play Then
$Play = False
$WMP.URL = $channel
$WMP.controls.play()
GUICtrlSetData($Label, "Loading...")
While $WMP.playstate <> 3 And $Stop = False
Sleep(20)
WEnd
If $Stop Then
$Stop = False
Else
GUICtrlSetData($Label, "Playing")
EndIf
EndIf
WEnd
Func _Exit()
Exit
EndFunc ;==>_Exit
Func _play()
$Play = True
EndFunc ;==>_play
Func _stop()
$Stop = True
$WMP.controls.stop()
GUICtrlSetData($Label, "Stopped")
EndFunc ;==>_stop
Edit: Nochmal geändert. Hatte das mit dem Abruch falsch.
@Twodollarbillie: Keine Sorge, solche Meldungen werden ganz schnell entsorgt.
@dr.mo: Wenn Du das Skript nicht verstehst, dann interpretier auch nichts hinein. Das Skript von Twodollarbillie macht nichts weiter als eine MsgBox zu öffen, wenn man auf den riesigen Button klickt.
Was soll es denn werden?
Vielleicht ist ein Listview besser geeignet? Dort macht das hinzufügen nicht so viel aus.
Die Ausreden werden auch immer schlechter.
[closed]
Du solltest schon Dein ganzes Skript posten, sonst kann Dir keiner helfen.
Die Idee ist ganz gut. Das Aussehen vielleicht nicht mehr ganz zeitgemäß.
Unter Win7 hängt sich das Skript auf, wenn man auf einen Button klickt.
[OT on]DosControl war der beste und schnellste Dateimanager damals auf dem Amiga (ich war registrierter User). Und die KDS-Mailbox war damals die erste Mailbox, bei der ich mich anmeldete.[OT off]
Ich danke auch euch für die guten Wünsche. Gefeiert wird aber erst am WE.
Allerdings habe ich diese Woche Urlaub. Insofern trifft das mit dem "gutgehen lassen" voll zu. ![]()
Hier noch ein paar Varianten:
[autoit]
$string = 'x:\Bla\mein langes File.xyz'
$filename = StringSplit($string, '\')
ConsoleWrite(' StringSplit: "' & $filename[$filename[0]] & '"' & @CR)
$filename = StringMid($string, StringInStr($string, '\', 0, -1) + 1)
ConsoleWrite(' StringMid: "' & $filename & '"' & @CR)
$filename = StringTrimLeft($string, StringInStr($string, '\', 0, -1))
ConsoleWrite(' StringTrimLeft: "' & $filename & '"' & @CR)
$filename = StringRegExpReplace($string, '.+\\(.+)', '$1')
ConsoleWrite(' StringRegExpReplace: "' & $filename & '"' & @CR)
Man kann das lesen des Skripts nur erschweren (Obfuscator). Gänzlich verhindern kann man es nicht.
Herzlichen Dank für all die guten Wünsche!
Das ist hier wirklich ein tolles Forum und ich bin froh ein Teil davon zu sein.
Auf ins nächste Jahr... ![]()
Ich habe die Suchfunktion noch weiter ausgebaut (siehe Screenshot) und einen kleinen Fehler behoben (Danke, Kleiner).
Neue Version in Post#1.
Wenn Du Listview-Einträge mittels der Listview-UDF erstellst, musst Du das Handle zum löschen benutzen:
#include <GUIListView.au3>
Opt("GUIOnEventMode", 1)
$TitelGUI = GUICreate("Test", 420, 405, -1, -1)
GUICtrlSetOnEvent(-3, "_exit")
$StatusLabel = GUICtrlCreateLabel("Herzlich Willkommen ", 160, 385)
GUICtrlCreateLabel("Status:", 110, 385)
Global $hStart = GUICtrlCreateButton("Hinzufügen", 30, 60, 85, 25)
GUICtrlSetOnEvent(-1, "_Add")
Global $hPause = GUICtrlCreateButton("Löschen", 30, 90, 85, 25)
GUICtrlSetOnEvent(-1, "_Del")
GUICtrlCreateButton("Beenden", 30, 250, 85, 25)
GUICtrlSetOnEvent(-1, "_exit")
$LV = GUICtrlCreateListView("Befehl|Wert(e)", 165, 30, 250, 350)
For $i = 0 To 5
GUICtrlCreateListViewItem("Test|" & $i, $LV)
Next
_GUICtrlListView_SetColumnWidth($LV, 0, 80)
_GUICtrlListView_SetColumnWidth($LV, 1, 165)
GUISetState(@SW_SHOW, $TitelGUI)
While Sleep(100) ; <- Im OnEventMode muss hier ein Sleep rein, sonst hast Du 100% Prozessorauslastung
WEnd
Func _Add()
_GUICtrlListView_InsertItem($LV, "Test", $i)
_GUICtrlListView_AddSubItem($LV, $i, $i, 1)
$i += 1
EndFunc ;==>_Add
Func _Del()
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($LV)) ; <- Hier das Handle benutzen, wenn Du Listview-Einträge mit der Listview-UDF erstellst.
$i = 0
EndFunc ;==>_Del
Func _exit()
Exit
EndFunc ;==>_exit
Schau Dir mal _GUICtrlTreeView_SetItemParam() an.
Was genau meinst Du mit "wird nicht mehr leise"?
Die Drehzahl bleibt immer im hohen Bereich oder hört sich der Lüfter ausgeschlagen an (kaputtes Lager)? Im letzteren Fall, Lüfter austauschen.
Ansonsten mal nachschauen, ob sich an dem Lüfter Dreck (Staub) angesetzt hat. Wenn es sich um den Prozessorlüfter handelt, könnte auch der Kühlkörper verdreckt sein.
Es könnte auch sein, dass sich die Ansaugöffnungen mit Dreck zugesetzt haben. Dadurch wird dann der Luftdurchsatz verringert und die Temperatur geht nach oben, was die Lüfterregelung mit einer erhöhten Drehzahl auszugleichen versucht.
Das könnte dann ungefähr so aussehen:
#include <Array.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
Global $aLand[3] = ["Deutschland", "Frankreich", "Italien"], $sLand = _ArrayToString($aLand)
Global $aStadt[3] = ["Berlin|Köln|Düsseldorf", "Paris|Lyon|Le Mans", "Rom|Neapel|Modena"]
$Form1 = GUICreate("Form1", 419, 84, 192, 124)
$Ausbilder = GUICtrlCreateCombo("Auswahl", 28, 32, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, $sLand)
$Stadt = GUICtrlCreateCombo("Auswahl", 208, 32, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetState(-1, $GUI_DISABLE)
$Label1 = GUICtrlCreateLabel("Land", 28, 12, 28, 17)
$Label2 = GUICtrlCreateLabel("Stadt", 208, 8, 29, 17)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Ausbilder
For $i = 0 To UBound($aLand) - 1
If GUICtrlRead($Ausbilder) = $aLand[$i] Then
GUICtrlSetData($Stadt, "")
GUICtrlSetData($Stadt, "Auswahl")
GUICtrlSetData($Stadt, $aStadt[$i], "Auswahl")
ExitLoop
EndIf
Next
If $i < UBound($aLand) Then
GUICtrlSetState($Stadt, $GUI_ENABLE)
Else
GUICtrlSetState($Stadt, $GUI_DISABLE)
EndIf
Case $Stadt
MsgBox(0, "Stadt", GUICtrlRead($Stadt))
EndSwitch
WEnd