Neue Version siehe Post#1
äöü und ß werden jetzt rihtig gelesen und der Link von AutoBert geht jetzt.
Neue Version siehe Post#1
äöü und ß werden jetzt rihtig gelesen und der Link von AutoBert geht jetzt.
Könnte jemand bitte die äquivalenten Schlüssel dazu für WinVista suchen und posten? Am besten nach CriticalBatteryAlarm oder so suchen.
Danke!
$string = "blah n/a blup" ; "n/a" üöäß ![]()
$string = "blah wert:1234 blup" ; "1234"
MsgBox(0,"", StringReplace(StringRegExpReplace(StringReplace($string, ' n/a ', '0000'), '\D', ''), '0000', 'n/a'))
[/autoit]Brauchst du sowas?
MsgBox(0, "Active SSID", _GetActiveSSID())
[/autoit] [autoit][/autoit] [autoit]Func _GetActiveSSID()
Local $SSID = ""
$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\wmi")
If Not IsObj($objWMIService) Then Exit (MsgBox(0, "Exiting...", "Initial WMI query failed!"))
$objMSNdis_80211_ServiceSetIdentifierSet = $objWMIService.ExecQuery("Select * from MSNdis_80211_ServiceSetIdentifier Where active=true")
If Not IsObj($objMSNdis_80211_ServiceSetIdentifierSet) Then Exit (MsgBox(0, "Exiting...", "''$objMSNdis_80211_ServiceSetIdentifierSet'' not an Object!"))
For $objMSNdis_80211_ServiceSetIdentifier In $objMSNdis_80211_ServiceSetIdentifierSet
$ID = ""
For $i = 0 To $objMSNdis_80211_ServiceSetIdentifier.Ndis80211SsId(0)
$ID = $ID & Chr($objMSNdis_80211_ServiceSetIdentifier.Ndis80211SsId($i + 4))
Next
$SSID = $ID
Next
Return $SSID
EndFunc ;==>_GetActiveSSID
autoBert:
Kannst du mal die Links posten, mit denen du es versucht hast? Hab die gleiche Version der IE, aber damit dürfte es sowieso nichts am Hut haben.
Techmix: Deswegen heißt das ganze auch Spoiler-Reader
Außerdem kommst du auch einfacher zum passenden Link (siehe Post #14).
@L3viathan2142: Danke! Endlich mal positive Kritik ![]()
Meldet euch, falls euch noch was auffällt.
Hallo Leute!
Aus den (fast nicht vorhandenen
) Reaktionen heraus denke ich, dass ich noch ein wenig zu dem Skript erklären muss. Dem Permalink erhalte ich wenn ich einen Rechtsklick auf die Beitragsnummer mache und danach auf Verknüpfung kopieren klicke (siehe Bild
). Wenn das Skript gestartet ist, dann wird der Quelltext der Seite geladen, und der Autoit-Code der sich in einem Spoiler befindet wird in Scite geladen.
Techmix: Dein Link verweist zu einem Beitrag, der keinen Spoiler enthält. Damit funktioniert mein Skript noch nicht! Ich werde versuchen dieses Manko in der nächsten Version zu beseitigen. Danke fürs testen trotzdem. Jetzt da du weißt wie es funktioniert, kannst du mir hoffentlich ein für mich besseres Feedback geben.
Es gibt eine neue Version, siehe Post#1! Läuft bei mir bisher einwandfrei, konnte aber noch nicht viel testen.
Viel Spaß und danke fürs testen, Fehler melden und natürlich für positive Kritik und Vorschläge.
Also meines Erachtens ist mp3 völlig ausreichend. WAV braucht viel zu viel Speicherplatz und WMA halte ich für Microsoft-Schwachsinn.
Oscar, ich bin begeistert von deinem Skript! ![]()
Zitat von olyIst sowas mit autoit leicht umzusetzen?
Ich würde sagen relativ einfach, ja. Schau dir mal die _GDIPlus.... Befehle in der Hilfe und mittels der Suche hier im Forum an. Da gibt es schon ähnliches.
Vllt findet sich ja jemand hier im Forum, der dir ein bisschen weiter hilft, ich hab heute keine Zeit mehr.
Versuch mal die UPX-Komprimierung abzuschalten.
Das kannte auch noch nicht! Funktioniert einwandfrei. ![]()
Kann man ein Doppelklick-Event auf ein Label abfangen? Oder gibt es da einen Workaround?
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Description=Eigene veränderliche Titelleiste
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=funkey
#AutoIt3Wrapper_Res_Language=3079
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Color.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]Const $WS_EX_COMPOSITED = 0x2000000
Global $title = "Hallo Autoit.de ;-)"
Global $hGui = GUICreate($title, 400, 500, -1, -1, BitOR($WS_POPUP, $WS_DLGFRAME, $WS_SIZEBOX), $WS_EX_COMPOSITED)
;~ GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
;~ GUISetOnEvent($GUI_EVENT_RESTORE, "_Restore")
GUISetIcon("shell32.dll", 42)
GUICtrlCreateIcon("shell32.dll", 42, 2, 2, 16, 16, 0x0300)
GUICtrlSetResizing ( -1,256+512+32+2)
Global $Btn_Min = GUICtrlCreateButton('0', 348, 3, 16, 15) ; _
;~ GUICtrlSetOnEvent(-1, '_Minimize')
GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
GUICtrlSetTip(-1, 'Minimieren')
GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')
Global $Btn_Max = GUICtrlCreateButton('1', 364, 3, 16, 15) ;
;~ GUICtrlSetOnEvent(-1, '_Maximize')
GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
GUICtrlSetTip(-1, 'Maximieren')
GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')
Global $Btn_Restore = GUICtrlCreateButton('2', 364, 3, 16, 15) ;
;~ GUICtrlSetOnEvent(-1, '_Restore')
GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
GUICtrlSetTip(-1, 'Verkleinern')
GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')
GUICtrlSetState(-1, $GUI_HIDE)
Global $Btn_Close = GUICtrlCreateButton('r', 382, 3, 16, 15) ; x
;~ GUICtrlSetOnEvent(-1, '_Exit')
GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
GUICtrlSetTip(-1, 'Schließen')
GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')
Global $Lbl_Caption = GUICtrlCreateLabel(" " & $title, 0, 0, 400, 20, 0x4000200, 0x00100020)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetResizing(-1, 512)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 9, 551, 0);, 'MS Sans Serif')
Global $hChild = GUICreate('Child', 3200, 20, 0, 0, $WS_CHILD, -1, $hGui)
Global $Ctrl_Grafik = _CreateColorTransition(0, 0, 3200, 20, 0xFF0000, 0x0B6295, 1, 4)
GUISetState()
GUISwitch($hGui)
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
[/autoit] [autoit][/autoit] [autoit]GUISetState()
[/autoit] [autoit][/autoit] [autoit]AdlibEnable('_RotateCaption', 350)
[/autoit] [autoit][/autoit] [autoit]While 1
Sleep(20000)
WEnd
Func _RotateCaption()
Local $aPosC = WinGetPos($hChild), $aPosG = WinGetPos($hGui)
If $aPosC[0] - $aPosG[0] <= -1600 Then
WinMove($hChild, '', -20, 0)
Else
WinMove($hChild, '', $aPosC[0] - $aPosG[0] - 20, 0)
EndIf
EndFunc ;==>_RotateCaption
Func _Minimize()
GUISetState(@SW_MINIMIZE)
EndFunc ;==>_Minimize
Func _Maximize()
GUISetState(@SW_MAXIMIZE)
GUICtrlSetState($Btn_Max, $GUI_HIDE)
GUICtrlSetState($Btn_Restore, $GUI_SHOW)
EndFunc ;==>_Maximize
Func _Restore()
GUISetState(@SW_RESTORE)
GUICtrlSetState($Btn_Restore, $GUI_HIDE)
GUICtrlSetState($Btn_Max, $GUI_SHOW)
EndFunc ;==>_Restore
Func _Exit()
Exit
EndFunc ;==>_Exit
Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
Local $nNotifyCode = BitShift($wParam, 16)
Local $nID = BitAND($wParam, 0x0000FFFF)
Local $hCtrl = $lParam
Switch $nID
Case $Btn_Min
If $nNotifyCode = 0 Then
GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
_Minimize()
EndIf
Case $Btn_Max
If $nNotifyCode = 0 Then
GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
_Maximize()
EndIf
Case $Btn_Restore
If $nNotifyCode = 0 Then
GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
_Restore()
EndIf
Case $Btn_Close
If $nNotifyCode = 0 Then
GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
_Exit()
EndIf
Case $Lbl_Caption
MsgBox(262144 + 64,$nNotifyCode,"Das Label wurde geklickt")
If $nNotifyCode = 5 Then
_Maximize()
EndIf
EndSwitch
EndFunc ;==>WM_COMMAND
Func _CreateColorTransition($iPosx, $iPosy, $iWidth, $iHeight, $nColorStart, $nColorEnd, $iAlignment = 0, $iWaveFaktor = 1)
; funkey
Local $startRot, $startGruen, $startBlau, $endRot, $endGruen, $endBlau, $Color
Local $ColorOffsetRot, $ColorOffsetGruen, $ColorOffsetBlau, $Grafik
$startRot = _ColorGetRed($nColorStart)
$startGruen = _ColorGetGreen($nColorStart)
$startBlau = _ColorGetBlue($nColorStart)
$endRot = _ColorGetRed($nColorEnd)
$endGruen = _ColorGetGreen($nColorEnd)
$endBlau = _ColorGetBlue($nColorEnd)
$Grafik = GUICtrlCreateGraphic($iPosx, $iPosy, $iWidth, $iHeight, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
$iHeight += $iWaveFaktor - Mod($iHeight, $iWaveFaktor)
Switch $iAlignment
Case 0
$ColorOffsetRot = ($endRot - $startRot) / ($iHeight / $iWaveFaktor)
$ColorOffsetGruen = ($endGruen - $startGruen) / ($iHeight / $iWaveFaktor)
$ColorOffsetBlau = ($endBlau - $startBlau) / ($iHeight / $iWaveFaktor)
Switch Mod($iWaveFaktor, 2)
Case 0
For $w = 1 To $iWaveFaktor - 1 Step 2
For $i = ($w - 1) * ($iHeight / $iWaveFaktor) To ($w) * ($iHeight / $iWaveFaktor) - 1
$Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2) & _
Hex($startGruen + $ColorOffsetGruen * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2) & _
Hex($startBlau + $ColorOffsetBlau * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
Next
For $i = $w * ($iHeight / $iWaveFaktor) To ($w + 1) * ($iHeight / $iWaveFaktor) - 1
$Color = '0x' & Hex($endRot - $ColorOffsetRot * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2) & _
Hex($endGruen - $ColorOffsetGruen * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2) & _
Hex($endBlau - $ColorOffsetBlau * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
Next
Next
Case 1
For $i = 0 To $iHeight - 1
$Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1), 2) & _
Hex($startGruen + $ColorOffsetGruen * ($i + 1), 2) & _
Hex($startBlau + $ColorOffsetBlau * ($i + 1), 2)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
Next
EndSwitch
Case Else
$ColorOffsetRot = ($endRot - $startRot) / ($iWidth / $iWaveFaktor)
$ColorOffsetGruen = ($endGruen - $startGruen) / ($iWidth / $iWaveFaktor)
$ColorOffsetBlau = ($endBlau - $startBlau) / ($iWidth / $iWaveFaktor)
Switch Mod($iWaveFaktor, 2)
Case 0
For $w = 1 To $iWaveFaktor - 1 Step 2
For $i = ($w - 1) * ($iWidth / $iWaveFaktor) To ($w) * ($iWidth / $iWaveFaktor) - 1
$Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2) & _
Hex($startGruen + $ColorOffsetGruen * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2) & _
Hex($startBlau + $ColorOffsetBlau * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $iHeight)
Next
For $i = $w * ($iWidth / $iWaveFaktor) To ($w + 1) * ($iWidth / $iWaveFaktor) - 1
$Color = '0x' & Hex($endRot - $ColorOffsetRot * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2) & _
Hex($endGruen - $ColorOffsetGruen * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2) & _
Hex($endBlau - $ColorOffsetBlau * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $iHeight)
Next
Next
Case 1
For $i = 0 To $iHeight - 1
$Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1), 2) & _
Hex($startGruen + $ColorOffsetGruen * ($i + 1), 2) & _
Hex($startBlau + $ColorOffsetBlau * ($i + 1), 2)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
Next
EndSwitch
EndSwitch
Return $Grafik
EndFunc ;==>_CreateColorTransition
Bessere Version
mit WS-Constanten aus der winuser.h
#include <Constants.au3>
#include <WindowsConstants.au3>
Local $aStyle[2] = _WinGetStyle(WinGetHandle('Windows Task-Manager'))
[/autoit] [autoit][/autoit] [autoit]MsgBox(0, "Styles", _WinStyle2Text($aStyle[0]))
MsgBox(0, "ExStyles", _WinExStyle2Text($aStyle[1]))
Func _WinStyle2Text($iStyle)
; funkey
Local $sReturn
Local $aStyles[27][2] = [['$WS_OVERLAPPEDWINDOW', BitOR($WS_OVERLAPPED, $WS_CAPTION, $WS_SYSMENU, $WS_THICKFRAME, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX)], _
['$WS_POPUPWINDOW' , BitOR($WS_POPUP, $WS_BORDER, $WS_SYSMENU)], _
['$WS_POPUP' , 0x80000000], _
['$WS_CHILD' , 0x40000000], _
['$WS_MINIMIZE' , 0x20000000], _
['$WS_VISIBLE' , 0x10000000], _
['$WS_DISABLED' , 0x08000000], _
['$WS_CLIPSIBLINGS', 0x04000000], _
['$WS_CLIPCHILDREN', 0x02000000], _
['$WS_MAXIMIZE' , 0x01000000], _
['$WS_CAPTION' , 0x00C00000], _
['$WS_BORDER' , 0x00800000], _
['$WS_DLGFRAME' , 0x00400000], _
['$WS_VSCROLL' , 0x00200000], _
['$WS_HSCROLL' , 0x00100000], _
['$WS_SYSMENU' , 0x00080000], _
['$WS_THICKFRAME' , 0x00040000], _
['$WS_GROUP' , 0x00020000], _
['$WS_TABSTOP' , 0x00010000], _
['$WS_MINIMIZEBOX' , 0x00020000], _
['$WS_MAXIMIZEBOX' , 0x00010000]]
;~ ['$WS_TILED' , $WS_OVERLAPPED], _
;~ ['$WS_ICONIC' , $WS_MINIMIZE], _
;~ ['$WS_SIZEBOX' , $WS_THICKFRAME], _
;~ ['$WS_CHILDWINDOW' , $WS_CHILD], _
;~ ['$WS_TILEDWINDOW' , $WS_OVERLAPPEDWINDOW]]
;~ ['$WS_OVERLAPPED' , 0x00000000], _
For $i = 0 To UBound($aStyles, 1) - 1
If BitAND($iStyle, $aStyles[$i][1]) = $aStyles[$i][1] Then
$sReturn &= $aStyles[$i][0] & @CRLF
$iStyle = BitXOR($iStyle, $aStyles[$i][1])
EndIf
Next
Return $sReturn & @CRLF & 'Unbekannt: 0x'& Hex($iStyle, ![]()
EndFunc ;==>_WinStyle2Text
Func _WinExStyle2Text($iExStyle)
; funkey
Local $sReturn
Local $aExStyles[27][2] = [['$WS_EX_OVERLAPPEDWINDOW', BitOR($WS_EX_WINDOWEDGE,$WS_EX_CLIENTEDGE)], _
['$WS_EX_PALETTEWINDOW' , BitOR($WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)], _
['$WS_EX_DLGMODALFRAME' , 0x00000001], _
['$WS_EX_DRAGDETECT' , 0x00000002], _
['$WS_EX_NOPARENTNOTIFY' , 0x00000004], _
['$WS_EX_TOPMOST' , 0x00000008], _
['$WS_EX_ACCEPTFILES' , 0x00000010], _
['$WS_EX_TRANSPARENT' , 0x00000020], _
['$WS_EX_MDICHILD' , 0x00000040], _
['$WS_EX_TOOLWINDOW' , 0x00000080], _
['$WS_EX_WINDOWEDGE' , 0x00000100], _
['$WS_EX_CLIENTEDGE' , 0x00000200], _
['$WS_EX_CONTEXTHELP' , 0x00000400], _
['$WS_EX_RIGHT' , 0x00001000], _
['$WS_EX_LEFT' , 0x00000000], _
['$WS_EX_RTLREADING' , 0x00002000], _
['$WS_EX_LTRREADING' , 0x00000000], _
['$WS_EX_LEFTSCROLLBAR' , 0x00004000], _
['$WS_EX_RIGHTSCROLLBAR' , 0x00000000], _
['$WS_EX_CONTROLPARENT' , 0x00010000], _
['$WS_EX_STATICEDGE' , 0x00020000], _
['$WS_EX_APPWINDOW' , 0x00040000], _
['$WS_EX_LAYERED' , 0x00080000], _
['$WS_EX_NOINHERITLAYOUT', 0x00100000], _
['$WS_EX_LAYOUTRTL' , 0x00400000], _
['$WS_EX_COMPOSITED' , 0x02000000], _
['$WS_EX_NOACTIVATE' , 0x08000000]]
For $i = 0 To UBound($aExStyles, 1) - 1
If BitAND($iExStyle, $aExStyles[$i][1]) = $aExStyles[$i][1] Then
$sReturn &= $aExStyles[$i][0] & @CRLF
$iExStyle = BitXOR($iExStyle, $aExStyles[$i][1])
EndIf
Next
Return $sReturn & @CRLF & 'Unbekannt: 0x'& Hex($iExStyle, ![]()
EndFunc ;==>_WinExStyle2Text
Func _WinGetStyle($WinTitle, $WinText = "")
; modified by funkey
Local $RetValue[2], $Temp, $h_window
$h_window = $WinTitle
If Not IsHWnd($h_window) Then
$h_window = WinGetHandle($WinTitle, $WinText)
If @error Then Return SetError(1, 0, "")
EndIf
; read Windowstyle
$Temp = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $h_window, "long", $GWL_STYLE)
If @error Then SetError(2, 0, "")
$RetValue[0] = '0x' & StringFormat('%008s', Hex($Temp[0]))
; read extended Windowstyle
$Temp = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $h_window, "long", $GWL_EXSTYLE)
If @error Then SetError(3, 0, "")
$RetValue[1] = '0x' & StringFormat('%008s', Hex($Temp[0]))
Return $RetValue
EndFunc ;==>_WinGetStyle
Edit: unnötige Zeilen aus dem Skript entfernt
Der Task-Manager beinhaltet den Style 0x0000004C, ich habe keine Ahnung, was die 4C bedeutet ![]()
Hab dir mal was zusammengestellt
Du kannst es ja noch erweitern, hab jetzt nur schnell die Autoit-Styles eingebunden.
#include <Array.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
Global Const $WS_EX_COMPOSITED = 0x02000000
GUICreate('Style-Test von funkey', 100, 100, -1, -1, BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_COMPOSITED, $WS_EX_TOPMOST))
$Style = _WinGetStyle('Style-Test von funkey')
_ArrayDisplay($Style, 'Gesamt-Style')
MsgBox(0, "Styles", _WinStyle2Text($Style[0]))
MsgBox(0, "Styles", _WinExStyle2Text($Style[1]))
Func _WinStyle2Text($iStyle)
; funkey
Local $sReturn
Local $aStyles[23][2] = [['$WS_MAXIMIZEBOX', 0x00010000], _
['$WS_MINIMIZEBOX', 0x00020000], _
['$WS_TABSTOP', 0x00010000], _
['$WS_GROUP', 0x00020000], _
['$WS_SIZEBOX', 0x00040000], _
['$WS_THICKFRAME', 0x00040000], _
['$WS_SYSMENU', 0x00080000], _
['$WS_HSCROLL', 0x00100000], _
['$WS_VSCROLL', 0x00200000], _
['$WS_DLGFRAME', 0x00400000], _
['$WS_BORDER', 0x00800000], _
['$WS_CAPTION', 0x00C00000], _
['$WS_OVERLAPPEDWINDOW', 0x00CF0000], _
['$WS_TILEDWINDOW', 0x00CF0000], _
['$WS_MAXIMIZE', 0x01000000], _
['$WS_CLIPCHILDREN', 0x02000000], _
['$WS_CLIPSIBLINGS', 0x04000000], _
['$WS_DISABLED', 0x08000000], _
['$WS_VISIBLE', 0x10000000], _
['$WS_MINIMIZE', 0x20000000], _
['$WS_CHILD', 0x40000000], _
['$WS_POPUP', 0x80000000], _
['$WS_POPUPWINDOW', 0x80880000]]
For $i = 0 To UBound($aStyles, 1) - 1
If BitAND($iStyle, $aStyles[$i][1]) = $aStyles[$i][1] Then $sReturn &= $aStyles[$i][0] & @CRLF
Next
Return $sReturn
EndFunc ;==>_WinStyle2Text
Func _WinExStyle2Text($iStyle)
; funkey
Local $sReturn
Local $aExStyles[16][2] = [['$WS_EX_ACCEPTFILES', 0x00000010], _
['$WS_EX_MDICHILD', 0x00000040], _
['$WS_EX_APPWINDOW', 0x00040000], _
['$WS_EX_CLIENTEDGE', 0x00000200], _
['$WS_EX_CONTEXTHELP', 0x00000400], _
['$WS_EX_DLGMODALFRAME', 0x00000001], _
['$WS_EX_LEFTSCROLLBAR', 0x00004000], _
['$WS_EX_OVERLAPPEDWINDOW', 0x00000300], _
['$WS_EX_RIGHT', 0x00001000], _
['$WS_EX_STATICEDGE', 0x00020000], _
['$WS_EX_TOOLWINDOW', 0x00000080], _
['$WS_EX_TOPMOST', 0x00000008], _
['$WS_EX_TRANSPARENT', 0x00000020], _
['$WS_EX_WINDOWEDGE', 0x00000100], _
['$WS_EX_LAYERED', 0x00080000], _
['$WS_EX_COMPOSITED', 0x02000000]]
For $i = 0 To UBound($aExStyles, 1) - 1
If BitAND($iStyle, $aExStyles[$i][1]) = $aExStyles[$i][1] Then $sReturn &= $aExStyles[$i][0] & @CRLF
Next
Return $sReturn
EndFunc ;==>_WinExStyle2Text
Func _WinGetStyle($WinTitle, $WinText = "")
; modified by funkey
Local $RetValue[2], $Temp, $h_window
$h_window = $WinTitle
If Not IsHWnd($h_window) Then
$h_window = WinGetHandle($WinTitle, $WinText)
If @error Then Return SetError(1, 0, "")
EndIf
; read Windowstyle
$Temp = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $h_window, "long", $GWL_STYLE)
If @error Then SetError(2, 0, "")
$RetValue[0] = '0x' & StringFormat('%008s', Hex($Temp[0]))
; read extended Windowstyle
$Temp = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $h_window, "long", $GWL_EXSTYLE)
If @error Then SetError(3, 0, "")
$RetValue[1] = '0x' & StringFormat('%008s', Hex($Temp[0]))
Return $RetValue
EndFunc ;==>_WinGetStyle
Das Flag bei StringRegExp muss 3 sein und nicht 1.
[autoit]#include <Array.au3>
$var = "blup>1223<blahblup>423<blah"
$ar = StringRegExp($var,"blup>(\d+?)<blah",3)
_ArrayDisplay($ar)
Herzlich willkommen Birgit!
Es freut mich immer, wenn wieder ein Österreicher / eine Österreicherin diesem Forum beitritt.
Du wirst sehen, dass du mit Autoit dein Leben vor bzw. mit dem PC ziemlich erleichtern kannst. Da du ja schon programmieren kannst, wird Autoit zu lernen für dich ein Kinderspiel sein.
Auf gute Zusammenarbeit!
RegRead liest erst beim 2. Versuch den selben Schlüsel zu lesen, den richtigen Wert aus
Das sieht für mich wie ein Bug aus. Gibt es da Bestätigungen dafür?
Hab mal eine Debug-Zeile eingefügt, mit der Ausgabe von RegRead und dem @error. Dadurch wird jetzt aber immer der richtige Sound abgespielt.
_PlayDefaultSystemSound('DeviceFail', 1) ;funkey
[/autoit] [autoit][/autoit] [autoit]; #FUNCTION# ====================================================================================================================
; Name...........: _PlayDefaultSystemSound()
; Description ...: Spielt einen Systemklang, welcher in der Registry definiert ist.
; Syntax.........: _PlayDefaultSystemSound($sSoundName, $iWait = 0)
; Parameters ....: $sSoundName - Name des SystemSound's
; | Default - Standardton Warnsignal / Default Beep
; | CriticalBatteryAlarm - Alarm bei kritischem Batteriestand / when battery is critical
; | DeviceConnect - Geräteanschluß / when a device is connect
; | DeviceDisconnect - Gerätetrennung / when a device is disconnect
; | DeviceFail - Geräteanschluß fehlgeschlagen / when a deviceconnect is fail
; | LowBatteryAlarm - Alarm bei niedrigem Batteriestand / when battery is low
; | MailBeep - Posteingangsbenachrichtigung / when email is received
; | SystemAsterisk - Stern / Asterisk
; | SystemExclamation - Hinweis / when windows shows a warning
; | SystemExit - Windows beenden / when Windows shuts down
; | SystemHand - Kritischer Abbruch / when a critical stop occurs
; | SystemNotification - Sprechblase / when a critical stop occurs
; | SystemStart - Windows starten / when Windows starts up
; | WindowsLogoff - beim Windows abmelden / when logging off Windows
; | WindowsLogon - beim Windows anmelden / when logging on Windows
; | EmptyRecycleBin - Löschen des Papierkorbs / when recycle bin is emptied
; | Navigating - Browser Klick / navigating in browser
; $iWait - Warten bis SoundPlay beendet? (0 = nein / 1 = ja)
; Return values .: -----
; Author ........: funkey (AutoIt.de)
; ===============================================================================================================================
Func _PlayDefaultSystemSound($sSoundName, $iWait = 0)
; funkey
Local $sKey = 'HKEY_USERS\.Default\AppEvents\Schemes\Apps\.Default'
If $sSoundName = 'EmptyRecycleBin' Or $sSoundName = 'Navigating' Then $sKey = 'HKEY_USERS\.Default\AppEvents\Schemes\Apps\Explorer'
Local $sFile = StringReplace(RegRead($sKey &'\' & $sSoundName & '\.Default', ''), '%SystemRoot%', @WindowsDir)
If $sFile = "" Then
SoundPlay(StringReplace(RegRead($sKey &'\.Default\.Default', ''), '%SystemRoot%', @WindowsDir), $iWait)
Else
SoundPlay($sFile, $iWait)
EndIf
EndFunc ;==>_PlaySystemSound
EDIT: k.A. ob das ganze Vista-tauglich ist !?
EDIT: Hatte noch eine Fehler drinn, der RegRead unglücklicherweise beeinflusst hat.
POST 1000 ![]()
Hab mal was getestet. 'EmptyRecycleBin' ging nicht mit micha_he 's Version, also hab ich eine eigene Funktion geschrieben, die mir die Default-Sounds wiedergibt. Dabei ist es egal welches Schema aktiv ist. Wenn kein Default-Sound vergeben sein sollte, wird genau wie bei micha_he 's Version ein Ping gespielt.
Ich hab die Funktionen auch umbenannt.
_PlayDefaultSystemSound('EmptyRecycleBin', 1) ;funkey
_PlayCurrentSystemSound('EmptyRecycleBin', 0) ;micha_he
; #FUNCTION# ====================================================================================================================
; Name...........: _PlayCurrentSystemSound()
; Description ...: Spielt einen Systemklang, welcher in der Registry oder der Win.ini definiert ist.
; Syntax.........: _PlayCurrentSystemSound($sSoundName[, $bAsync])
; Parameters ....: $sSoundName - Name des SystemSound's
; | SystemAsterisk - Stern / Asterisk
; | Default - Standardton Warnsignal / Default Beep
; | EmptyRecycleBin - Löschen des Papierkorbs / when recycle bin is emptied
; | SystemExclamation - Hinweis / when windows shows a warning
; | SystemExit - Windows beenden / when Windows shuts down
; | Maximize - Maximieren / when a program is maximized
; | MenuCommand - Menübefehl / when a menu item is clicked on
; | MenuPopup - Menü-Popup / when a (sub)menu pops up
; | Minimize - Minimieren / when a program is minimized to taskbar
; | MailBeep - Posteingangsbenachrichtigung / when email is received
; | Open - Programm öffnen / when a program is opened
; | SystemHand - Kritischer Abbruch / when a critical stop occurs
; | AppGPFault - Programmfehler / when a program causes an error
; | SystemQuestion - Frage / when a system question occurs
; | RestoreDown - Verkleinern / when a program is minimized to taskbar
; | RestoreUp - Vergrößern / when a program is restored to normal size from taskbar
; | SystemStart - Windows starten / when Windows starts up
; | Close - Programm schließen / when program is closed
; | Ringout - Freizeichen / when (fax) call is made outbound and the line is ringing
; | RingIn - Eingehender Anruf / incoming (fax) call
; | DeiviceConnect - Geräteanschluß / when a device is connect
; | DeviceDisconnect - Gerätetrennung / when a device is disconnect
; | DeviceFail - Geräteanschluß fehlgeschlagen / when a deviceconnect is fail
; | CriticalBatteryAlarm - Alarm bei kritischem Batteriestand / when battery is critical
; | LowBatteryAlarm - Alarm bei niedrigem Batteriestand / when battery is low
; | MailBeep - Posteingangsbenachrichtigung / when a mail is arrived
; | PrintComplete - Druckvorgang abgeschlossen / when a printjob is completed
; $bAsync - Abspielen erfolgt Syncron
; Return values .: -----
; Author ........: micha_he (AutoIt.de)
; Informations...: weitere System-Event-Namen können Sie unter folgendem Registryzweigen finden bzw. hinzufügen:
; - HKEY_USERS\.DEFAULT\AppEvents\EventLabels\
; - HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default
; ===============================================================================================================================
Func _PlayCurrentSystemSound($sSoundName, $bAsync = False)
Local Const $SND_ALIAS = 0x10000
Local Const $SND_ASYNC = 0x1
Local $flags
$flags = $SND_ALIAS
If $bAsync Then $flags = BitOR($flags, $SND_ASYNC)
DllCall('winmm.dll', 'int', 'PlaySoundA', 'str', $sSoundName, 'int', 0, 'int', $flags)
EndFunc ;==>_PlayCurrentSystemSound
; #FUNCTION# ====================================================================================================================
; Name...........: _PlayDefaultSystemSound()
; Description ...: Spielt einen Systemklang, welcher in der Registry definiert ist.
; Syntax.........: _PlayDefaultSystemSound($sSoundName, $iWait = 0)
; Parameters ....: $sSoundName - Name des SystemSound's
; | Default - Standardton Warnsignal / Default Beep
; | CriticalBatteryAlarm - Alarm bei kritischem Batteriestand / when battery is critical
; | DeiviceConnect - Geräteanschluß / when a device is connect
; | DeviceDisconnect - Gerätetrennung / when a device is disconnect
; | DeviceFail - Geräteanschluß fehlgeschlagen / when a deviceconnect is fail
; | LowBatteryAlarm - Alarm bei niedrigem Batteriestand / when battery is low
; | MailBeep - Posteingangsbenachrichtigung / when email is received
; | SystemAsterisk - Stern / Asterisk
; | SystemExclamation - Hinweis / when windows shows a warning
; | SystemExit - Windows beenden / when Windows shuts down
; | SystemHand - Kritischer Abbruch / when a critical stop occurs
; | SystemNotification - Sprechblase / when a critical stop occurs
; | SystemStart - Windows starten / when Windows starts up
; | WindowsLogoff - beim Windows abmelden / when logging off Windows
; | WindowsLogon - beim Windows anmelden / when logging on Windows
; | EmptyRecycleBin - Löschen des Papierkorbs / when recycle bin is emptied
; | Navigating - Browser Klick / navigating in browser
; $iWait - Warten bis SoundPlay beendet? (0 = nein / 1 = ja)
; Return values .: -----
; Author ........: funkey (AutoIt.de)
; ===============================================================================================================================
Func _PlayDefaultSystemSound($sSoundName, $iWait = 0)
; funkey
Local $sKey = 'HKU\.Default\AppEvents\Schemes\Apps\.Default'
If $sSoundName = 'EmptyRecycleBin' Or $sSoundName = 'Navigating' Then $sKey = 'HKU\.Default\AppEvents\Schemes\Apps\Explorer'
Local $sFile = StringReplace(RegRead($sKey &'\' & $sSoundName & '\.Default', ''), '%SystemRoot%', @WindowsDir)
If $sFile = "" Then
SoundPlay(StringReplace(RegRead($sKey &'\.Default\.Default', ''), '%SystemRoot%', @WindowsDir), $iWait)
Else
SoundPlay($sFile, $iWait)
EndIf
EndFunc ;==>_PlaySystemSound
EDIT: Hatte noch eine Fehler drinn, der RegRead unglücklicherweise beeinflusst hat.
Hallo Oscar!
Respekt, der Player ist dir sehr gut gelungen! ![]()
![]()
Hab noch einen kleinen Bug entdeckt. Wenn die Option 'Start With Last PlayList' aktiviert ist, und man startet den Player mit einer anderen Datei als Parameter-Übergabe, dann ist kurz die übergebene Datei sichtbar, wird dann aber von der vorherigen Playlist überschrieben. Vllt kann die neue Datei oben auf der Playlist hinzugefügt werden. Optimal wäre auch noch eine Option für das automatische Abspielen beim Start abzuschalten (nur, wenn nicht eine Datei als Parameter übergeben wurde).
Danke, dass du dieses tolle Skript mit uns teilst!
Dann ist nicht leichtes helfen ![]()
$h_control = ControlGetHandle($s_string, "", "[CLASS:Internet Explorer_Server; INSTANCE:" & $i_instance & "]")
$oResult = __IEControlGetObjFromHWND($h_control)
Opt("WinTitleMatchMode", $iWinTitleMatchMode)
If IsObj($oResult) Then
SetError($_IEStatus_Success)
Return $oResult
Else
__IEErrorNotify("Warning", "_IEAttach", "$_IEStatus_NoMatch")
SetError($_IEStatus_NoMatch, 1)
Return 0
EndIf
Demnach, kann das wahrscheinlich das Control [CLASS:Internet Explorer_Server; INSTANCE:" & $i_instance & "] nicht gefunden werden, weil es noch nicht geladen ist. ![]()
Ich würde das Fenster vom Skript schließen lassen und ein neues öffnen um das Problem zu umgehen.