Hallo,
kann mir jemand sagen, warum mein Script abstürzt und die CPU-Auslastung dann bei 50% liegt (Wegen dualcore!)?
Spoiler anzeigen
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=1.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Description=Spielt einzelne Songs ab.
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Burak Keskin
#AutoIt3Wrapper_Res_Language=1031
#AutoIt3Wrapper_res_requestedExecutionLevel=requireAdministrator
#AutoIt3Wrapper_Res_Field=E-Mail|[email='burak.keskin@arcor.de'][/email]
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/sf 1 /sv 1
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.1.1 (beta)
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <Inet.au3>
$Form1 = GUICreate("Last.FM Player", 342, 331)
GUIRegisterMsg($WM_ACTIVATE, "_ReDraw")
$Label1 = GUICtrlCreateLabel("Interpret:", 8, 8, 46, 17)
$Input1 = GUICtrlCreateInput("Deftones", 64, 8, 121, 21)
$Label2 = GUICtrlCreateLabel("Song:", 8, 40, 32, 17)
$Input2 = GUICtrlCreateInput("Digital Bath", 64, 40, 121, 21)
$Button1 = GUICtrlCreateButton("Ok", 208, 40, 75, 25)
GUICreate("", 300, 222, 10, 70, $WS_CHILD, -1, $Form1)
GUISetBkColor(0x000c)
$oIE = ObjCreate("Shell.Explorer.2")
$GUIActiveX = GUICtrlCreateObj($oIE, -10, -15, 310, 237)
$oIE.navigate(@TempDir & "\Temp.html")
$oIE.document.body.style.border = "0px"
$oIE.document.body.scroll = "no"
GUISetState()
[/autoit] [autoit][/autoit] [autoit]GUISetState(@SW_SHOW, $Form1)
[/autoit] [autoit][/autoit] [autoit]_user32_RedrawWindow($Form1, BitOR($RDW_ERASE, $RDW_INVALIDATE, $RDW_ALLCHILDREN, $RDW_UPDATENOW))
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_Anfrage()
Case $Input2
_Anfrage()
EndSwitch
WEnd
Func _Anfrage()
GUICtrlSetState($Button1, $GUI_Disable)
$Fopen = FileOpen(@TempDir & "\Temp.html", 2)
$Interpret = GUICtrlRead($Input1)
$Song = GUICtrlRead($Input2)
$Source = _LastFM_Get_Player_Source(_LastFM_Generate_Url($Interpret, $Song) & "?autostart")
If $Source <> -1 Then
FileWrite($Fopen, $Source)
FileClose($Fopen)
$oIE.navigate(@TempDir & "\Temp.html")
$oIE.document.body.style.border = "0px"
$oIE.document.body.scroll = "no"
Else
MsgBox(0, "Fehler", "Musik nicht gefunden!")
EndIf
GUICtrlSetState($Button1, $GUI_Enable)
EndFunc ;==>_Anfrage
Func _user32_RedrawWindow($hWnd, $Flag)
$Ret = DllCall("User32.dll", "int", "RedrawWindow", "hwnd", $hWnd, "int", 0, "int", 0, "uint", $Flag)
Return $Ret[0]
EndFunc ;==>_user32_RedrawWindow
Func _LastFM_Generate_Url($LF_Interpret, $LF_Song)
Local $LF_URL = "http://www.lastfm.de/music/" & $LF_Interpret & "/_/" & $LF_Song
Return StringReplace($LF_URL, " ", "+")
EndFunc ;==>_LastFM_Generate_Url
Func _LastFM_Get_Player_Source($LF_URL)
Local $LF_Source = _INetGetSource($LF_URL), $Loop
Local $LF_S_Bet = _StringBetween($LF_Source, '<object type="application/x-shockwave-flash"', '</object>')
For $Loop = 0 To UBound($LF_S_Bet)
If IsArray($LF_S_Bet) Then
If StringInStr($LF_S_Bet[$Loop], "lfmPlayer.swf") Then
Return '<object type="application/x-shockwave-flash"' & $LF_S_Bet[$Loop] & '</object>'
EndIf
EndIf
Next
Return -1
EndFunc ;==>_LastFM_Get_Player_Source
Func _ReDraw($hWnd, $Msg, $wParam, $lParam)
_user32_RedrawWindow($Form1, BitOR($RDW_ERASE, $RDW_INVALIDATE, $RDW_ALLCHILDREN, $RDW_UPDATENOW))
EndFunc ;==>_ReDraw