Internetbrowser-Objekt ohne Rand

  • Hallo,

    ich habe einen kleinen Last.FM Player geschrieben. Allerdings ist mir dabei aufgefallen, dass man den Player nicht ohne Rand nach links verschieben kann. Siehe Bild:

    [Blockierte Grafik: http://download.lima-city.de/deepred/Bilder/72576195847653269.jpg]

    Warum ist der Player nicht ganz linkt bzw. oben links. Ich benutze bei meinem Script dieses Objekt: Shell.Explorer.2

  • verstehe ich das richtig du willst das der player Ohne rand ist und an der oberen linken ecke hängt?
    schick mal ein beipsiel wie es ausschauen soll damit man sich was denken kann ^-°

    [autoit]


    #cs-----------------------------------------------------------------------------
    Hilfe ist immer gut also nimmt sie an ^^
    #ce-----------------------------------------------------------------------------

    [/autoit]
  • Ach ja der Code hier :D :

    Spoiler anzeigen
    [autoit]

    #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] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.1.1 (beta)
    Author: myName

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Template AutoIt script.

    [/autoit] [autoit][/autoit] [autoit]

    #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>

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Last.FM Player", 342, 331)
    $Label1 = GUICtrlCreateLabel("Interpret:", 8, 8, 46, 17)
    $Input1 = GUICtrlCreateInput("Rise Against", 64, 8, 121, 21)
    $Label2 = GUICtrlCreateLabel("Song:", 8, 40, 32, 17)
    $Input2 = GUICtrlCreateInput("Tip the Scales", 64, 40, 121, 21)
    $Button1 = GUICtrlCreateButton("Ok", 208, 40, 75, 25)

    [/autoit] [autoit][/autoit] [autoit]

    $oIE = ObjCreate("Shell.Explorer.2")
    $GUIActiveX = GUICtrlCreateObj($oIE, 0, 70, 342, 261)

    [/autoit] [autoit][/autoit] [autoit]

    $oIE.navigate("http://cdn.last.fm/webclient/s12n/s/49/lfmPlayer.swf")

    [/autoit] [autoit][/autoit] [autoit]

    GUIRegisterMsg($WM_ACTIVATE, "_ReDraw")

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)

    [/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

    [/autoit] [autoit][/autoit] [autoit]

    Func _Anfrage()
    GUICtrlSetState($Button1, $GUI_Disable)
    $Fopen = FileOpen(@TempDir & "\Temp.html", 2)

    [/autoit] [autoit][/autoit] [autoit]

    $Interpret = GUICtrlRead($Input1)
    $Song = GUICtrlRead($Input2)

    [/autoit] [autoit][/autoit] [autoit]

    $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")
    Else
    MsgBox(0, "Fehler", "Musik nicht gefunden!")
    EndIf
    GUICtrlSetState($Button1, $GUI_Enable)
    EndFunc ;==>_Anfrage

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    Func _ReDraw($hWnd, $Msg, $wParam, $lParam)
    _user32_RedrawWindow($Form1, BitOR($RDW_ERASE, $RDW_INVALIDATE, $RDW_ALLCHILDREN, $RDW_UPDATENOW))
    EndFunc ;==>_ReDraw

    [/autoit]
  • Machs mit einer Child-Gui!

    Spoiler anzeigen
    [autoit]

    #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] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.1.1 (beta)
    Author: myName

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Template AutoIt script.

    [/autoit] [autoit][/autoit] [autoit]

    #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>

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Last.FM Player", 342, 331)
    GUIRegisterMsg($WM_ACTIVATE, "_ReDraw")
    $Label1 = GUICtrlCreateLabel("Interpret:", 8, 8, 46, 17)
    $Input1 = GUICtrlCreateInput("Rise Against", 64, 8, 121, 21)
    $Label2 = GUICtrlCreateLabel("Song:", 8, 40, 32, 17)
    $Input2 = GUICtrlCreateInput("Tip the Scales", 64, 40, 121, 21)
    $Button1 = GUICtrlCreateButton("Ok", 208, 40, 75, 25)

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("", 342, 261, 0, 70, $WS_CHILD, -1, $Form1)

    [/autoit] [autoit][/autoit] [autoit]

    $oIE = ObjCreate("Shell.Explorer.2")
    $GUIActiveX = GUICtrlCreateObj($oIE, -10, -15, 342, 261)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ $oIE.document.body.style.border = "0px"
    ;~ $oIE.document.body.scroll = "no"

    [/autoit] [autoit][/autoit] [autoit]

    $oIE.navigate("http://cdn.last.fm/webclient/s12n/s/49/lfmPlayer.swf")

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    Func _Anfrage()
    GUICtrlSetState($Button1, $GUI_Disable)
    $Fopen = FileOpen(@TempDir & "\Temp.html", 2)

    [/autoit] [autoit][/autoit] [autoit]

    $Interpret = GUICtrlRead($Input1)
    $Song = GUICtrlRead($Input2)

    [/autoit] [autoit][/autoit] [autoit]

    $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

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    Func _ReDraw($hWnd, $Msg, $wParam, $lParam)
    _user32_RedrawWindow($Form1, BitOR($RDW_ERASE, $RDW_INVALIDATE, $RDW_ALLCHILDREN, $RDW_UPDATENOW))
    EndFunc ;==>_ReDraw

    [/autoit]

    Nettes Projekt!

  • er meint bestimmt so ihr mal ein link im englischen forum http://www.autoitscript.com/forum/index.php?showtopic=27320 schau dir das mal da an im 6 post ca

    oder meinst du so ?

    Spoiler anzeigen
    [autoit]


    #include <GUIConstants.au3>
    Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash")
    GUICreate ("Flash", 600, 400, -1, -1)
    GUIRegisterMsg(0x0202,"test")
    $GUIActiveX = GUICtrlCreateObj( $oRP, 0, 0 , 600 , 350)
    With $oRP
    .bgcolor = "#000000"
    .Movie = "http://cdn.last.fm/webclient/s12n/s/49/lfmPlayer.swf";
    .ScaleMode = 2
    .Loop = False
    .wmode = "transparent"
    .FlashVars = ""
    EndWith
    GUISetState ()
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg=$GUIActiveX
    MsgBox(0 , "" , "click")
    EndSelect
    WEnd
    $oRP = 0
    GUIDelete ()
    Exit
    Func test($1,$2,$3,$4)
    MsgBox(0 ,"" , $1 & @CRLF & $2 & @CRLF & $3 & @CRLF & $4)
    EndFunc

    [/autoit]