Hallo,
probieren geht eben über studieren.
ne, jetzt mal im Ernst. Hat jemmand ne Idee, wie ich jetzt daran noch ein Menü hängen kann wie z: Bsp. bei Datei?
Schwitz & stöhn
Grüße
fschaef
Hallo,
probieren geht eben über studieren.
ne, jetzt mal im Ernst. Hat jemmand ne Idee, wie ich jetzt daran noch ein Menü hängen kann wie z: Bsp. bei Datei?
Schwitz & stöhn
Grüße
fschaef
Hallo,
habs gelöst, mit _GUICtrlToolbar_AddButton.
Beweis:
Hallo liebe Autoit-Community,
ich wollte in meinem Explorer in der Menü-Leiste einen neuen Eintrag hinzufügen. Siehe unten:
Autoit-Info liefert hierzu folgende Informationen:
ToolbarWindow323
[CLASS:ToolbarWindow32; INSTANCE:3]
Weiß jemand wie das geht?
Vielen Dank im voraus!
fschaef
Hallo, liebe Autoit Community,
habe heute das schöne Wetter genossen, darum meine späte Antwort auf Eure Beiträge.
Ja, VDownloader ist ein Downloader für z. Bsp. Youtube, das ist richtig. Au3Info hingegen erkennt bei mir
keine Controls, nur das Hauptfenster. Ich benutze Autoit Version 3.3.6.1.
LG fschaef
Hallo, schönen Guten Abend,
weiß jemand, wie ich an die Controls dieses Programmes komme?
Autoit Info Window liefert:
Title: VDownloader
Class: HwndWrapper[VDownloader.exe;;e9195d90-6c5b-458f-907c-186dd34d1aed]
MfG
fschaef
Hallo,
kann ich nicht machen, weil ich u. a. Informationen extrahieren will, wo die Leerzeichen erhalten bleiben sollen. Z. Bsp. in Titeln usw.
LG fschaef
Hallo Alle,
ich lese vom Internet eine Datei ein, die so aussieht (1 String):
[autoit]
</script>
<div class="result-item *sr ">bla bla irgendetwas
Ich möchte nun alle Leerzeichen und Zeilenumbrüche (HEX 0A) zwischen diesen beiben Tags entfernen.
Geht das mit REGex? Ich habs nicht rausbekommen
Ich hänge die die Datei mal an.
Vielen Dank und LG
fschaef
Kann rausgenommen werden, habe ich vergessen!
Sorry und Danke.
LG fschaef
Hallo Alle,
ich habe mir ein Script geschrieben, welches auf YouTube alle Videos fü einen Author/Keywords sucht und in einem Listview anzeigt. Nach dem Laden der Daten kann man per Rechtsklick ein kontextmenü aufrufen.
Wenn ich dann ein Menüeintrag (Zu Download hinzufügen) auswählöe, passiert .... None ...
Kann da jemand mal schauen?
Achtung: Das Script benötigt im Verzeichnis @scriptdir folgende Verzeichnisstruktur: \bilder\test+\sounds
#include <file.au3>
#include <array.au3>
#include <string.au3>
#Include <GuiListView.au3>
#include <GuiStatusBar.au3>
#Include <GuiListBox.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#include <GuiImageList.au3>
#include <Constants.au3>
#include <GDIPlus.au3>
#include "_GUIImageList_AddBitmapEx.au3"
#Include <Misc.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <WindowsConstants.au3>
#include <ListViewConstants.au3>
#include <StructureConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>
#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Local $aParts[3] = [250, 550, -1]
[/autoit] [autoit][/autoit] [autoit]$Form1 = GUICreate("Youtube Video Suche", 953, 547, 32, 124)
$hStatus = _GUICtrlStatusBar_Create ($Form1, $aParts)
$rc = ping("www.youtube.de")
If $rc = 0 Then
$lb_MsgText1 = GUICtrlCreateLabel("Keine aktive Internetverbindung vorhanden!", 40, 124, 540, 100)
GUICtrlSetFont(-1, 22, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
Else
$lV_Searchresults = GUICtrlCreateListView("", 40, 72, 601, 450, -1, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE, $LVS_EX_SUBITEMIMAGES))
_GUICtrlListView_SetExtendedListViewStyle($lV_Searchresults, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES, _
$LVS_EX_DOUBLEBUFFER))
GUICtrlSetFont(-1, 9, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000A0)
GUICtrlSetBkColor(-1, 0xBBCCEE)
$lb_Author = GUICtrlCreateLabel("Name/Nickname des Authors", 40, 24, 140, 17)
$ef_Author = GUICtrlCreateInput("matimar1", 40, 45, 140, 20)
$lb_Keyword = GUICtrlCreateLabel("Schlüsselwort", 185, 24, 140, 17)
$ef_Keyword = GUICtrlCreateInput("Feng shui music", 185, 45, 140, 20)
$btn = GUICtrlCreateButton("Suche starten", 330, 45, 90, 20)
[/autoit] [autoit][/autoit] [autoit]$lb_MsgText = GUICtrlCreateLabel("Hole Seite 1", 572, 24, 60, 17)
$hListBox = GUICtrlCreateList("", 658, 22, 40, 55)
$lV_Downloads = GUICtrlCreateListView("", 661, 72, 250, 450, -1, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE, $LVS_EX_SUBITEMIMAGES))
_GUICtrlListView_SetExtendedListViewStyle($lV_Downloads, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES, _
$LVS_EX_DOUBLEBUFFER))
GUICtrlSetFont(-1, 9, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000A0)
GUICtrlSetBkColor(-1, 0xBBCCEE)
$CM_DownloadDummy = GUICtrlCreateDummy()
$ListView1context = GUICtrlCreateContextMenu($CM_DownloadDummy)
$MenuItem1 = GUICtrlCreateMenuItem("Zu Download-Liste hinzufügen", $ListView1context)
$CM_SortDummy = GUICtrlCreateDummy()
$ListView1context1 = GUICtrlCreateContextMenu($CM_SortDummy)
$ListView1context1Download = GUICtrlCreateMenuItem("Zu Download-Liste hinzufügen", $ListView1context1)
$ListView1context1Trenner = GUICtrlCreateMenuItem("", $ListView1context1)
$ListView1context1Sort = GUICtrlCreateMenu("Sortierung", $ListView1context1)
$MenuItem2 = GUICtrlCreateMenuItem("Aufsteigend", $ListView1context1Sort)
$MenuItem3 = GUICtrlCreateMenuItem("Absteigend", $ListView1context1Sort)
; Add columns
;_GUICtrlListView_AddColumn($lV_Searchresults, "", 25)
_GUICtrlListView_AddColumn($lV_Searchresults, "", 0)
_GUICtrlListView_AddColumn($lV_Searchresults, " Bild Nr Titel", 300)
_GUICtrlListView_AddColumn($lV_Searchresults, "Dauer", 50, 1)
_GUICtrlListView_AddColumn($lV_Searchresults, "Schlüsselwörter", 350)
_GUICtrlListView_AddColumn($lV_Searchresults, "YTID", 0)
_GUICtrlListView_AddColumn($lV_Downloads,"Nr", 30)
_GUICtrlListView_AddColumn($lV_Downloads,"Youtube Video ID", 150)
_GUICtrlListView_AddColumn($lV_Downloads,"Status", 150)
Global $B_DESCENDING[_GUICtrlListView_GetColumnCount($lV_Searchresults)]
; Create an image list with images
$hImage = _GUIImageList_Create(120, 90, 5, 1)
;- _GUIImageList_AddBitmap($hImage, @ScriptDir & "\bilder\test\default.bmp")
;- _GUICtrlListView_SetImageList($lV_Searchresults, $hImage, 1)
EndIf
GUICtrlSetState($lb_MsgText, $GUI_HIDE)
GUICtrlSetState($hListBox, $GUI_HIDE)
ControlSend($Form1, "", $ef_Author, "{END}")
ControlFocus($Form1, "", $ef_Author)
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Dim $aRecords, $lV_Searchresults_values[50][7]
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
case $MenuItem1
MsgBox(0, "", "Download aktiviert")
Case $btn
if ControlGetText($Form1, "", $ef_Author) = "" AND _
ControlGetText($Form1, "", $ef_Keyword) = "" then
MsgBox(64, "Youtube Video Suche - Fehler", "Suchkriterium fehlt: " & @CRLF & @CRLF & _
"Entweder Nickname oder 1 Schlüsselwort" & @CRLF & "muß vorhanden sein")
ControlFocus($Form1, "", $ef_Author)
ContinueCase
ElseIf ControlGetText($Form1, "", $ef_Author) <> "" AND _
ControlGetText($Form1, "", $ef_Keyword) <> "" then
$YTQuery = "http://gdata.youtube.com/feeds/api/videos?max-results=50&start-index=1&q=" & ControlGetText($Form1, "", $ef_Keyword)& "&author=" & ControlGetText($Form1, "", $ef_Author)
ElseIf ControlGetText($Form1, "", $ef_Author) <> "" Then
$YTQuery = "http://gdata.youtube.com/feeds/api/videos?max-results=50&start-index=1&author=" & ControlGetText($Form1, "", $ef_Author)
Else
$YTQuery = "http://gdata.youtube.com/feeds/api/videos?max-results=50&start-index=1&q=" & ControlGetText($Form1, "", $ef_Keyword)
endif
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $YTQuery = ' & $YTQuery & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
GUICtrlSetState($hListBox, BitOR($GUI_enable, $GUI_HIDE))
GUICtrlSetState($lb_MsgText, BitOR($GUI_enable, $GUI_HIDE))
GUICtrlSetState($btn, $GUI_disable)
ControlSetText($Form1, "", $btn, "Hole Daten ...")
; MsgBox(64, "Info", "Author: " & ControlGetText($Form1, "", $ef_Author))
;Sleep(5000)
fnc_GetYTData($YTQuery)
ControlSetText($Form1, "", $btn, "Suche")
GUICtrlSetState($btn, $GUI_enable)
GUICtrlSetState($hListBox, BitOR($GUI_enable, $GUI_SHOW))
GUICtrlSetState($lb_MsgText, BitOR($GUI_enable, $GUI_SHOW))
EndSwitch
WEnd
GUIDelete($Form1)
[/autoit] [autoit][/autoit] [autoit]Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode, $hWndListBox
If Not IsHWnd($hListBox) Then $hWndListBox = GUICtrlGetHandle($hListBox)
; $hListView = $lV_Searchresults
If Not IsHWnd($lV_Searchresults) Then $hWndListView = GUICtrlGetHandle($lV_Searchresults)
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
$iCode = BitShift($iwParam, 16) ; Hi Word
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hWndFrom = ' & $hWnd & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
Switch $hWndFrom
Case $hListBox, $hWndListBox
Switch $iCode
Case $LBN_DBLCLK ; Sent when the user double-clicks a string in a list box
_DebugPrint("$LBN_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
$rc = _GUICtrlListBox_GetCount($hListBox)
;- _DebugPrint("Einträge: " & @TAB & $rc)
$aglbitems = _GUICtrlListBox_GetCurSel($hListBox)
;- _DebugPrint("Ausgewählt: " & @TAB & $aglbitems)
; Get indexes of selected items
$aItems = _GUICtrlListBox_GetText($hListBox, $aglbitems)
;- _DebugPrint("Items Selected: " & $aItems)
If $aItems = 1 then
$QueryStart = 1
else
$QueryStart = ($aItems - 1) * 50 + 1
EndIf
;- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $QueryStart = ' & $QueryStart & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$tmp = Stringreplace($YTQuery, "start-index=1", "start-index=" & $QueryStart)
;- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $tmp = ' & $tmp & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
fnc_GetYTData($tmp)
; no return value
Case $LBN_ERRSPACE ; Sent when a list box cannot allocate enough memory to meet a specific request
_DebugPrint("$LBN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $LBN_KILLFOCUS ; Sent when a list box loses the keyboard focus
_DebugPrint("$LBN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $LBN_SELCANCEL ; Sent when the user cancels the selection in a list box
_DebugPrint("$LBN_SELCANCEL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $LBN_SELCHANGE ; Sent when the selection in a list box has changed
_DebugPrint("$LBN_SELCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
Return _ListDblClick()
; no return value
Case $LBN_SETFOCUS ; Sent when a list box receives the keyboard focus
_DebugPrint("$LBN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
EndSwitch
EndSwitch
[/autoit] [autoit][/autoit] [autoit]; Proceed the default Autoit3 internal message commands.
; You also can complete let the line out.
; !!! But only 'Return' (without any value) will not proceed
; the default Autoit3-message in the future !!!
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$hWndListView = $lV_Searchresults
If Not IsHWnd($lV_Searchresults) Then $hWndListView = GUICtrlGetHandle($lV_Searchresults)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $LVN_COLUMNCLICK ; A column was clicked
$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
_DebugPrint("$LVN_COLUMNCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode & @LF & _
"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
; Kick off the sort callback
;_GUICtrlListView_SortItems($hWndFrom, DllStructGetData($tInfo, 2))
_GUICtrlListView_SimpleSort($hWndFrom, $B_DESCENDING, DllStructGetData($tInfo, "SubItem"))
; No return value
Case $LVN_KEYDOWN ; A key has been pressed
$tInfo = DllStructCreate($tagNMLVKEYDOWN, $ilParam)
_DebugPrint("$LVN_KEYDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode & @LF & _
"-->VKey:" & @TAB & DllStructGetData($tInfo, "VKey") & @LF & _
"-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags"))
; No return value
Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
_DebugPrint("$NM_CLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode & @LF & _
"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
;ListView_Click()
; No return value
Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
_DebugPrint("$NM_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode & @LF & _
"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
; No return value
Case $NM_KILLFOCUS ; The control has lost the input focus
_DebugPrint("$NM_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; No return value
Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
_DebugPrint("$NM_RCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode & @LF & _
"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
;Return 1 ; not to allow the default processing
;Return 0 ; allow the default processing
if _GUICtrlListView_GetItemCount($hWndFrom) = 0 then return 0
$ContextmenuCalledColumn = DllStructGetData($tInfo, "SubItem")
$arPos = MouseGetPos()
$x = $arPos[0]
$y = $arPos[1]
if $ContextmenuCalledColumn <> 2 then
$hMenu = GUICtrlGetHandle($ListView1context)
Else
$hMenu = -1
endif
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hMenu = ' & $hMenu & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hWndFrom = ' & $hWndFrom & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
; ClientToScreen($hWndFrom, $x, $y) --- funktioniert nicht!!!
TrackPopupMenu($hWndFrom, $hMenu, $x, $y)
Return 0 ; allow the default processing
[/autoit] [autoit][/autoit] [autoit]Case $NM_RDBLCLK ; Sent by a list-view control when the user double-clicks an item with the right mouse button
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
_DebugPrint("$NM_RDBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode & @LF & _
"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
; No return value
Case $NM_RETURN ; The control has the input focus and that the user has pressed the ENTER key
_DebugPrint("$NM_RETURN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; No return value
Case $NM_SETFOCUS ; The control has received the input focus
_DebugPrint("$NM_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; No return value
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func _DebugPrint($s_text)
$s_text = StringReplace($s_text, @LF, @LF & "-->")
ConsoleWrite("!===========================================================" & @LF & _
"+===========================================================" & @LF & _
"-->" & $s_text & @LF & _
"+===========================================================" & @LF)
EndFunc ;==>_DebugPrint
; shows actual page of all reports in listbox
Func _ListDblClick()
Local $indx = _GUICtrlListBox_GetCurSel($hListBox)
ControlSetText($Form1, "", $lb_MsgText, "Hole Seite " & _GUICtrlListBox_GetText($hListBox, $indx))
EndFunc
Func fnc_GetYTData($SearchArg)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$rc = FileDelete(@ScriptDir & "\update.dat")
_GUICtrlStatusBar_SetText ($hStatus, "Hole Kataloginformationen", 1)
; Local $hDownload = InetGet("http://gdata.youtube.com/feeds/api/users/7600celsius/uploads?max-results=50&start-index=1&lr=de", @ScriptDir & "\update.dat", 1, 1)
; Local $hDownload = InetGet("http://gdata.youtube.com/feeds/api/videos?max-results=50&start-index=1&q=relax&author=7600CELSIUS", @ScriptDir & "\update.dat", 1, 1)
Local $hDownload = InetGet($SearchArg, @ScriptDir & "\update.dat", 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $nBytes = InetGetInfo($hDownload, 0)
InetClose($hDownload) ; Close the handle to release resourcs.
;MsgBox(0, "", "Bytes read: " & $nBytes)
_GUICtrlStatusBar_SetText ($hStatus, "Lese Katalog ein", 1)
[/autoit] [autoit][/autoit] [autoit]$rcfo = FileOpen(@ScriptDir & "\update.dat")
$fileline = FileReadLine($rcfo, 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $fileline = ' & $fileline & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$newchars = StringReplace($fileline, "><", ">|<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $chars = ' & $newchars & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$rc = FileClose($rcfo)
_GUICtrlStatusBar_SetText ($hStatus, "Analysiere Katalog", 1)
$KatInfoStart = StringinStr($newchars,"|<openSearch:totalResults>") + 1
$KatInfoEnd = StringinStr($newchars,"</openSearch:itemsPerPage>") - 1
$KatInfo = StringMid($newchars, $KatInfoStart, ($KatInfoEnd-$KatInfoStart)+27)
$QueryInfo = _Stringbetween($KatInfo, ">", "<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $QueryInfo = ' & UBound($QueryInfo) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;_ArrayDisplay($QueryInfo,"QueryInfo",10)
$AnzVideos = Int($QueryInfo[0])
if $AnzVideos <= 50 then
$AnzSeiten = 1
else
$AnzSeiten = Int($QueryInfo[0] / 50)
if $AnzSeiten < 1 then $AnzSeiten = 1
$tmp = $QueryInfo[0] - (Int($QueryInfo[0] / 50) * 50)
if $tmp > 0 then $AnzSeiten = $AnzSeiten + 1
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $tmp = ' & $tmp & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
EndIf
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $AnzSeiten = ' & $AnzSeiten & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$AktSeite = int($QueryInfo[2]) / 50
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $QueryInfo[2] int($QueryInfo[2]) / 50 = ' & $QueryInfo[2] & ", " & int($QueryInfo[2]) / 50 & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
if $AktSeite < 1 then
$AktSeite = 1
Else
$AktSeite = int($AktSeite + 1)
EndIf
_GUICtrlStatusBar_SetText ($hStatus, "Anzahl Seiten: " & $AnzSeiten & ", Aktuelle Seite: " & $AktSeite, 0)
_GUICtrlStatusBar_SetText ($hStatus, "Anzahl Videos: " & $AnzVideos, 2)
; return
$aRecords = StringSplit($newchars, "|")
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $aRecords = ' & UBound($aRecords) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
; _ArrayDisplay($aRecords, "Results of searching for 0 in $avArray")
$chars = ""
$newchars = ""
_GUICtrlListView_BeginUpdate(GUICtrlGetHandle($lV_Searchresults))
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($lV_Searchresults))
_GUICtrlListView_EndUpdate(GUICtrlGetHandle($lV_Searchresults))
Local $astartiResult = _ArrayFindAll($aRecords, "<entry", 0, 0, 0, 1)
[/autoit] [autoit][/autoit] [autoit]; _ArrayDisplay($astartiResult, "Results of searching for 0 in $avArray")
[/autoit] [autoit][/autoit] [autoit]Local $aendiResult = _ArrayFindAll($aRecords, "</entry", 0, 0, 0, 1)
if UBound($astartiResult) = 0 and UBound($aendiResult) = 0 then
_GUICtrlStatusBar_SetText($hStatus, "Keine Daten gefunden", 1)
return
endif
; _ArrayDisplay($aendiResult, "Results of searching for 0 in $avArray")
if UBound($astartiResult) > UBound($aendiResult) then Exit
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : UBound($aendiResult) = ' & UBound($aendiResult) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : UBound($astartiResult) = ' & UBound($astartiResult) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
for $lv = 0 to UBound($astartiResult) - 1
_GUICtrlStatusBar_SetText ($hStatus, "Analysiere Link " & $lv & " von 50", 1)
;ConsoleWrite('@@ Debug ' & $lv &' =========================================================' & @CRLF)
for $mediagroup = $astartiResult[$lv] + 1 to $aendiResult[$lv] - 1
; ConsoleWrite('@@ Debug ' & $aRecords[$mediagroup] & @CRLF)
if StringInStr($aRecords[$mediagroup],"<media:keywords>") > 0 Then
$dataArea = StringStripWS($aRecords[$mediagroup], 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = _StringBetween($dataArea,">","<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;$tempvalue = _Stringbetween($aRecords[$mediagroup], ">", "<", -1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') $lv : $tempvalue = ' & $lv & "-" & $tempvalue & "-" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$lV_Searchresults_values[$lv][0] = $dataArea[0]
EndIf
[/autoit] [autoit][/autoit] [autoit]if StringInStr($aRecords[$mediagroup],"<id>") > 0 Then
$dataArea = StringStripWS($aRecords[$mediagroup], 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = _StringBetween($dataArea,">","<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;$tempvalue = _Stringbetween($aRecords[$mediagroup], ">", "<", -1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') $lv : $tempvalue = ' & $lv & "-" & $tempvalue & "-" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$lV_Searchresults_values[$lv][1] = StringReplace($dataArea[0], "http://gdata.youtube.com/feeds/api/videos/", "")
EndIf
[/autoit] [autoit][/autoit] [autoit]if StringInStr($aRecords[$mediagroup],"<media:title") > 0 Then
$dataArea = StringStripWS($aRecords[$mediagroup], 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = _StringBetween($dataArea,">","<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;$tempvalue = _Stringbetween($aRecords[$mediagroup], ">", "<", -1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') $lv : $tempvalue = ' & $lv & "-" & $tempvalue & "-" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$lV_Searchresults_values[$lv][2] = $dataArea[0]
EndIf
[/autoit] [autoit][/autoit] [autoit]if StringInStr($aRecords[$mediagroup],"<published>") > 0 Then
$dataArea = StringStripWS($aRecords[$mediagroup], 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = _StringBetween($dataArea,">","<")
$dataArea = _StringBetween($dataArea[0], "", "T")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = StringSplit($dataArea[0], "-")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & UBound($dataArea) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;$tempvalue = _Stringbetween($aRecords[$mediagroup], ">", "<", -1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') $lv : $tempvalue = ' & $lv & "-" & $tempvalue & "-" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$lV_Searchresults_values[$lv][3] = $dataArea[3] & "." & $dataArea[2] & "." & $dataArea[1]
EndIf
[/autoit] [autoit][/autoit] [autoit]if StringInStr($aRecords[$mediagroup],"<yt:duration") > 0 Then
$dataArea = StringStripWS($aRecords[$mediagroup], 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = _StringBetween($dataArea,"'","'")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;$tempvalue = _Stringbetween($aRecords[$mediagroup], ">", "<", -1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') $lv : $tempvalue = ' & $lv & "-" & $tempvalue & "-" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$tempMinuten = Int($dataArea[0] / 60)
$lV_Searchresults_values[$lv][4] = Int($dataArea[0] / 60) & ":" & StringFormat("%02d",$dataArea[0] - ($tempMinuten * 60))
$lV_Searchresults_values[$lv][5] = $dataArea[0]
;-- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea[0] = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$lV_Searchresults_values[$lv][6] = $dataArea[0] * 192 * 1000 ;/ (1024 * 1024 *
EndIf
[/autoit] [autoit][/autoit] [autoit]Next
[/autoit] [autoit][/autoit] [autoit]FileDelete(@ScriptDir & "\bilder\test\" & $lV_Searchresults_values[$lv][1] & ".jpg") ;avoid irvanview exiting if already exists
[/autoit] [autoit][/autoit] [autoit]$BildDownloadLink = "http://i.ytimg.com/vi/" & $lV_Searchresults_values[$lv][1] & "/default.jpg"
;ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $BildDownloadLink = ' & $BildDownloadLink & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
_GUICtrlStatusBar_SetText ($hStatus, "Lade Bild für " & $lV_Searchresults_values[$lv][1], 1)
Local $hBildDownload = InetGet($BildDownloadLink, @ScriptDir & "\bilder\test\" & $lV_Searchresults_values[$lv][1] & ".jpg", 1, 1)
Do
Sleep(250)
Local $nBytes = InetGetInfo($hBildDownload, 0)
_GUICtrlStatusBar_SetText ($hStatus, "Lade Bild für " & $lV_Searchresults_values[$lv][1] & ", Bytes geladen: " & $nBytes, 1)
Until InetGetInfo($hBildDownload, 2) ; Check if the download is complete.
InetClose($hBildDownload)
_GUICtrlStatusBar_SetText ($hStatus, "Konvertiere " & $lV_Searchresults_values[$lv][1] & ".jpg --> bmp", 1)
$sCmd = "C:\Programme\IrfanView\i_view32 " & $lV_Searchresults_values[$lv][1] & ".jpg /convert " & $lV_Searchresults_values[$lv][1] & ".bmp"
$iPid = Run($sCmd, @ScriptDir & "\bilder\test", @SW_HIDE, 0x4) ;StdErr
While ProcessExists($iPid)
$sStdOut = StderrRead($iPid)
WEnd
$NrNeuesBild = _GUIImageList_AddBitmap($hImage, @ScriptDir & "\bilder\test\" & $lV_Searchresults_values[$lv][1] & ".bmp")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $NrNeuesBild = ' & $NrNeuesBild & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
_GUICtrlListView_SetImageList($lV_Searchresults, $hImage, 1)
$NewItem = _GUICtrlListView_AddItem($lV_Searchresults, $lv+1, -1)
_GUICtrlListView_AddSubItem($lV_Searchresults, $NewItem, StringFormat("%4s", $lv+1) & ". " & $lV_Searchresults_values[$lv][2], 1, $NrNeuesBild)
_GUICtrlListView_AddSubItem($lV_Searchresults, $NewItem, $lV_Searchresults_values[$lv][4], 2, -1)
_GUICtrlListView_AddSubItem($lV_Searchresults, $NewItem, $lV_Searchresults_values[$lv][0], 3, -1)
_GUICtrlListView_AddSubItem($lV_Searchresults, $NewItem, $lV_Searchresults_values[$lv][1], 4, -1)
; _SetItemParam($lV_Searchresults, $NewItem, 3, -1, 0xFF0000)
Next
; _ArrayDisplay($lV_Searchresults_values, "Results of searching for 0 in $avArray")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $lV_Searchresults_values) = ' & UBound($lV_Searchresults_values) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
_GUICtrlListBox_ResetContent($hListBox)
[/autoit] [autoit][/autoit] [autoit]ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $AnzSeiten = ' & $AnzSeiten & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
[/autoit] [autoit][/autoit] [autoit]for $i = 1 to $AnzSeiten
_GUICtrlListBox_AddString(GUICtrlGetHandle($hListBox), StringFormat("%2s", $i))
Next
_GUICtrlStatusBar_SetText ($hStatus, "Fertig", 1)
_GUICtrlListBox_SetCurSel(GUICtrlGetHandle($hListBox), $AktSeite - 1)
GUICtrlSetState($lb_MsgText, $GUI_SHOW)
GUICtrlsetState(GUICtrlGetHandle($hListBox), $GUI_SHOW)
ControlFocus($Form1, "", GUICtrlGetHandle($hListBox))
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : GUICtrlgetState($hListBox, $GUI_SHOW) = ' & GUICtrlgetState($hListBox) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
SoundPlay(@ScriptDir & "\Sounds\transfer_data.mp3")
Sleep(600)
EndFunc
; Convert the client (GUI) coordinates to screen (desktop) coordinates
Func ClientToScreen($hWnd, ByRef $x, ByRef $y)
Local $stPoint = DllStructCreate("int;int")
DllStructSetData($stPoint, 1, $x)
DllStructSetData($stPoint, 2, $y)
DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))
[/autoit] [autoit][/autoit] [autoit]$x = DllStructGetData($stPoint, 1)
$y = DllStructGetData($stPoint, 2)
; release Struct not really needed as it is a local
$stPoint = 0
EndFunc ;==>ClientToScreen
; Show at the given coordinates (x, y) the popup menu (hMenu) which belongs to a given GUI window (hWnd)
Func TrackPopupMenu($hWnd, $hMenu, $x, $y)
;ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hWnd = ' & $hWnd & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : TrackPopupMenu = ' & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0)
EndFunc ;==>ZeigeContextMenu
Vielen Dank! LG fschaef
Hallo
Aha, das Problem sitzt mal wieder vorm PC.
Danke für den Tip und schönen Abend noch!
Halo und guten Abend,
ich möchte die Ergebnisse von 2 Controls in einer WM_Command abfangen.
Eine Listbox und einen Listview, Listbox funktioniert, Listview nicht!!!!
Hier die Funktion:
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode, $hWndListBox, $hWndListView
If Not IsHWnd($hListBox) Then $hWndListBox = GUICtrlGetHandle($hListBox)
$hListView = $lV_Searchresults
If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($lV_Searchresults)
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
$iCode = BitShift($iwParam, 16) ; Hi Word
Switch $hWndFrom
Case $hListBox, $hWndListBox
Switch $iCode
Case $LBN_DBLCLK ; Sent when the user double-clicks a string in a list box
_DebugPrint("$LBN_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
$rc = _GUICtrlListBox_GetCount($hListBox)
;- _DebugPrint("Einträge: " & @TAB & $rc)
$aglbitems = _GUICtrlListBox_GetCurSel($hListBox)
;- _DebugPrint("Ausgewählt: " & @TAB & $aglbitems)
; Get indexes of selected items
$aItems = _GUICtrlListBox_GetText($hListBox, $aglbitems)
;- _DebugPrint("Items Selected: " & $aItems)
If $aItems = 1 then
$QueryStart = 1
else
$QueryStart = ($aItems - 1) * 50 + 1
EndIf
;- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $QueryStart = ' & $QueryStart & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$tmp = Stringreplace($YTQuery, "start-index=1", "start-index=" & $QueryStart)
;- ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $tmp = ' & $tmp & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
fnc_GetYTData($tmp)
; no return value
Case $LBN_ERRSPACE ; Sent when a list box cannot allocate enough memory to meet a specific request
_DebugPrint("$LBN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $LBN_KILLFOCUS ; Sent when a list box loses the keyboard focus
_DebugPrint("$LBN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $LBN_SELCANCEL ; Sent when the user cancels the selection in a list box
_DebugPrint("$LBN_SELCANCEL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $LBN_SELCHANGE ; Sent when the selection in a list box has changed
_DebugPrint("$LBN_SELCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
Return _ListDblClick()
; no return value
Case $LBN_SETFOCUS ; Sent when a list box receives the keyboard focus
_DebugPrint("$LBN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
EndSwitch
Case $hListView, $hWndListView
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hListView = ' & $hListView & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
Switch $iCode
Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
_DebugPrint("$NM_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode & @LF & _
"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
; No return value
EndSwitch
EndSwitch
; Proceed the default Autoit3 internal message commands.
; You also can complete let the line out.
; !!! But only 'Return' (without any value) will not proceed
; the default Autoit3-message in the future !!!
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
Weiß jemand warum nicht?
MFG fschaef
N'Abend, das Problem saß mal wieder vor dem PC.
Lösung: Icon in Spalte 2 setzen und Spaltenbreite von Spalte 1 einfach auf 0 setzen.
Trotzdem Vielen Dank fürs mitlesen.
LG fschaef
Hallo Alle,
ich möchte in einem Listview nur in der Spalte 2 ein Icon/BMP anzeigen zzgl. Text. Ich habe mir ein Beispiel aus der Hilfe kopiert und entsprechend modifiziert. Der Erfolg bleibt jedoch leider aus. Ich brauche Hilfe.
#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
Opt('MustDeclareVars', 1)
[/autoit] [autoit][/autoit] [autoit]$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work
[/autoit] [autoit][/autoit] [autoit]_Main()
[/autoit] [autoit][/autoit] [autoit]Func _Main()
Local $hImage, $hListView
; Create GUI
GUICreate("ListView Add SubItem", 400, 300)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 268, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
_GUICtrlListView_SetUnicodeFormat($hListView, False)
GUISetState()
; Load images
$hImage = _GUIImageList_Create()
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($hListView), 0xFF0000, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($hListView), 0x00FF00, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($hListView), 0x0000FF, 16, 16))
_GUICtrlListView_SetImageList($hListView, $hImage, 1)
; Add columns
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)
; Add items
_GUICtrlListView_AddItem($hListView, "Row 1: Col 1")
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2, 2)
_GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1)
_GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1, 2)
_GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2)
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
Hier seht ihr das Ergebnis: Immer noch ein Icon in Spalte 1.
poste bitte dein script, dann kann ich dir bestimmt besser helfen.
In Kürze, was das Script bis jetzt tut:
Auruf der Youtube Search Api
Holen Liste aller Videos für einen Nicknamen/Schlagwort
Ein/Auslesen der Daten in eine temp. Datei
Datei in Listview
Listbox will ich zum auswählen der einzelnen Reportseiten verwenden.
Danke im voraus. Code ist z. T. unübersichtlich, ich weiß das selbst
#include <file.au3>
#include <array.au3>
#include <string.au3>
#Include <GuiListView.au3>
#include <GuiStatusBar.au3>
#Include <GuiListBox.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#include <GuiImageList.au3>
#include <Constants.au3>
#include <GDIPlus.au3>
#include "_GUIImageList_AddBitmapEx.au3"
#Include <Misc.au3>
#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]Local $aParts[3] = [250, 550, -1]
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$Form1 = GUICreate("Youtube Video Suche", 733, 547, 192, 124)
$hStatus = _GUICtrlStatusBar_Create ($Form1, $aParts)
$rc = ping("www.youtube.de")
If $rc = 0 Then
$lb_MsgText1 = GUICtrlCreateLabel("Keine aktive Internetverbindung vorhanden!", 40, 124, 540, 100)
GUICtrlSetFont(-1, 22, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
Else
$lV_Searchresults = GUICtrlCreateListView("", 40, 72, 661, 450)
GUICtrlSetFont(-1, 9, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000A0)
GUICtrlSetBkColor(-1, 0xBBCCEE)
$ListView1context = GUICtrlCreateContextMenu($lV_Searchresults)
$MenuItem1 = GUICtrlCreateMenuItem("Del", $ListView1context)
; Add columns
;_GUICtrlListView_AddColumn($lV_Searchresults, "", 25)
_GUICtrlListView_AddColumn($lV_Searchresults, "Nr", 95, 1)
_GUICtrlListView_AddColumn($lV_Searchresults, "Titel", 200)
_GUICtrlListView_AddColumn($lV_Searchresults, "Dauer", 50, 1)
_GUICtrlListView_AddColumn($lV_Searchresults, "Schlüsselwörter", 350)
_GUICtrlListView_AddColumn($lV_Searchresults, "YTID", 0)
; Create an image list with images
$hImage = _GUIImageList_Create(65, 55, 5, 1)
_GUIImageList_AddBitmapEx($hImage, @ScriptDir & "\Icons\default.jpg")
_GUICtrlListView_SetImageList($lV_Searchresults, $hImage, 1)
EndIf
$lb_Author = GUICtrlCreateLabel("Name/Nickname des Authors", 40, 24, 140, 17)
$ef_Author = GUICtrlCreateInput("7600Celsius", 40, 45, 140, 20)
$lb_Keyword = GUICtrlCreateLabel("Schlüsselwort", 185, 24, 140, 17)
$ef_Keyword = GUICtrlCreateInput("", 185, 45, 140, 20)
$btn = GUICtrlCreateButton("Suche starten", 330, 45, 90, 20)
[/autoit] [autoit][/autoit] [autoit]$lb_MsgText = GUICtrlCreateLabel("Hole Seite 1", 572, 24, 60, 17)
GUICtrlSetState($lb_MsgText, $GUI_HIDE)
$hListBox = GUICtrlCreateList("", 658, 22, 40, 55)
GUICtrlSetState($hListBox, $GUI_HIDE)
ControlSend($Form1, "", $ef_Author, "{END}")
ControlFocus($Form1, "", $ef_Author)
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Dim $aRecords, $lV_Searchresults_values[50][7]
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $btn
if ControlGetText($Form1, "", $ef_Author) = "" AND _
ControlGetText($Form1, "", $ef_Keyword) = "" then
MsgBox(64, "Youtube Video Suche - Fehler", "Suchkriterium fehlt: " & @CRLF & @CRLF & _
"Entweder Nickname oder 1 Schlüsselwort" & @CRLF & "muß vorhanden sein")
ControlFocus($Form1, "", $ef_Author)
ContinueCase
ElseIf ControlGetText($Form1, "", $ef_Author) <> "" AND _
ControlGetText($Form1, "", $ef_Keyword) <> "" then
$YTQuery = "http://gdata.youtube.com/feeds/api/videos?max-results=50&start-index=1&q=" & ControlGetText($Form1, "", $ef_Keyword)& "&author=" & ControlGetText($Form1, "", $ef_Author)
ElseIf ControlGetText($Form1, "", $ef_Author) <> "" Then
$YTQuery = "http://gdata.youtube.com/feeds/api/videos?max-results=50&start-index=1&author=" & ControlGetText($Form1, "", $ef_Author)
Else
$YTQuery = "http://gdata.youtube.com/feeds/api/videos?max-results=50&start-index=1&q=" & ControlGetText($Form1, "", $ef_Keyword)
endif
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $YTQuery = ' & $YTQuery & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
GUICtrlSetState($hListBox, BitOR($GUI_enable, $GUI_HIDE))
GUICtrlSetState($lb_MsgText, BitOR($GUI_enable, $GUI_HIDE))
GUICtrlSetState($btn, $GUI_disable)
ControlSetText($Form1, "", $btn, "Hole Daten ...")
; MsgBox(64, "Info", "Autkor: " & ControlGetText($Form1, "", $ef_Author))
;Sleep(5000)
fnc_GetYTData($YTQuery)
ControlSetText($Form1, "", $btn, "Suche")
GUICtrlSetState($btn, $GUI_enable)
GUICtrlSetState($hListBox, BitOR($GUI_enable, $GUI_SHOW))
GUICtrlSetState($lb_MsgText, BitOR($GUI_enable, $GUI_SHOW))
case $hListBox
if _IsPressed("0D") then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Enter in Listbox')
EndSwitch
WEnd
GUIDelete($Form1)
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode, $hWndListBox
If Not IsHWnd($hListBox) Then $hWndListBox = GUICtrlGetHandle($hListBox)
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
$iCode = BitShift($iwParam, 16) ; Hi Word
Switch $hWndFrom
Case $hListBox, $hWndListBox
Switch $iCode
Case $LBN_DBLCLK ; Sent when the user double-clicks a string in a list box
_DebugPrint("$LBN_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
$rc = _GUICtrlListBox_GetCount($hListBox)
_DebugPrint("Einträge: " & @TAB & $rc)
$aglbitems = _GUICtrlListBox_GetCurSel($hListBox)
_DebugPrint("Ausgewählt: " & @TAB & $aglbitems)
; no return value
Case $LBN_ERRSPACE ; Sent when a list box cannot allocate enough memory to meet a specific request
_DebugPrint("$LBN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $LBN_KILLFOCUS ; Sent when a list box loses the keyboard focus
_DebugPrint("$LBN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $LBN_SELCANCEL ; Sent when the user cancels the selection in a list box
_DebugPrint("$LBN_SELCANCEL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $LBN_SELCHANGE ; Sent when the selection in a list box has changed
_DebugPrint("$LBN_SELCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
Return _ListDblClick()
; no return value
Case $LBN_SETFOCUS ; Sent when a list box receives the keyboard focus
_DebugPrint("$LBN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
EndSwitch
EndSwitch
; Proceed the default Autoit3 internal message commands.
; You also can complete let the line out.
; !!! But only 'Return' (without any value) will not proceed
; the default Autoit3-message in the future !!!
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
Func _DebugPrint($s_text)
$s_text = StringReplace($s_text, @LF, @LF & "-->")
ConsoleWrite("!===========================================================" & @LF & _
"+===========================================================" & @LF & _
"-->" & $s_text & @LF & _
"+===========================================================" & @LF)
EndFunc ;==>_DebugPrint
Func _ListDblClick()
Local $indx = _GUICtrlListBox_GetCurSel($hListBox)
ControlSetText($Form1, "", $lb_MsgText, "Hole Seite " & _GUICtrlListBox_GetText($hListBox, $indx))
EndFunc
Func fnc_GetYTData($SearchArg)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$rc = FileDelete(@ScriptDir & "\update.dat")
_GUICtrlStatusBar_SetText ($hStatus, "Hole Kataloginformationen", 1)
; Local $hDownload = InetGet("http://gdata.youtube.com/feeds/api/users/7600celsius/uploads?max-results=50&start-index=1&lr=de", @ScriptDir & "\update.dat", 1, 1)
; Local $hDownload = InetGet("http://gdata.youtube.com/feeds/api/videos?max-results=50&start-index=1&q=relax&author=7600CELSIUS", @ScriptDir & "\update.dat", 1, 1)
Local $hDownload = InetGet($SearchArg, @ScriptDir & "\update.dat", 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $nBytes = InetGetInfo($hDownload, 0)
InetClose($hDownload) ; Close the handle to release resourcs.
;MsgBox(0, "", "Bytes read: " & $nBytes)
_GUICtrlStatusBar_SetText ($hStatus, "Bereite auf ...", 1)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$rcfo = FileOpen(@ScriptDir & "\update.dat")
$fileline = FileReadLine($rcfo, 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $fileline = ' & $fileline & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$newchars = StringReplace($fileline, "><", ">|<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $chars = ' & $newchars & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$rc = FileClose($rcfo)
_GUICtrlStatusBar_SetText ($hStatus, "Lade...", 1)
$aRecords = StringSplit($newchars, "|")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $aRecords = ' & UBound($aRecords) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$chars = ""
$newchars = ""
_GUICtrlListView_BeginUpdate(GUICtrlGetHandle($lV_Searchresults))
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($lV_Searchresults))
_GUICtrlListView_EndUpdate(GUICtrlGetHandle($lV_Searchresults))
Local $astartiResult = _ArrayFindAll($aRecords, "<entry", 0, 0, 0, 1)
[/autoit] [autoit][/autoit] [autoit];_ArrayDisplay($astartiResult, "Results of searching for 0 in $avArray")
[/autoit] [autoit][/autoit] [autoit]Local $aendiResult = _ArrayFindAll($aRecords, "</entry", 0, 0, 0, 1)
[/autoit] [autoit][/autoit] [autoit];_ArrayDisplay($aendiResult, "Results of searching for 0 in $avArray")
if UBound($astartiResult) > UBound($aendiResult) then Exit
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : UBound($aendiResult) = ' & UBound($aendiResult) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : UBound($astartiResult) = ' & UBound($astartiResult) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
for $lv = 0 to UBound($astartiResult) - 1
if StringInStr($aRecords[$lv],"<openSearch:totalResults>") > 0 Then
$dataArea = StringReplace($aRecords[$lv],">",">|")
$dataArea = StringReplace($dataArea,"<","|<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Katinfo gefunden ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = StringSplit($dataArea,"|")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Anzahl Einträge ' & $dataArea[3] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$AnzSeiten = Int($dataArea[3] / 50)
;_GUICtrlStatusBar_SetText ($hStatus, "Anzahl Seiten: " & $AnzSeiten & ", Aktuelle Seite: " & $dataArea[2], 0)
EndIf
[/autoit] [autoit][/autoit] [autoit]if StringInStr($aRecords[$lv],"<openSearch:startIndex>") > 0 Then
$dataArea = StringReplace($aRecords[$lv],">",">|")
$dataArea = StringReplace($dataArea,"<","|<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Katinfo gefunden ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = StringSplit($dataArea,"|")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Anzahl Einträge ' & $dataArea[3] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$AktSeite = Int($dataArea[3] / 50)
if $AktSeite < 1 then $AktSeite = 1
_GUICtrlStatusBar_SetText ($hStatus, "Anzahl Seiten: " & $AnzSeiten & ", Aktuelle Seite: " & $AktSeite, 0)
EndIf
;ConsoleWrite('@@ Debug ' & $lv &' =========================================================' & @CRLF)
for $mediagroup = $astartiResult[$lv] + 1 to $aendiResult[$lv] - 1
; ConsoleWrite('@@ Debug ' & $aRecords[$mediagroup] & @CRLF)
if StringInStr($aRecords[$mediagroup],"<media:keywords>") > 0 Then
$dataArea = StringStripWS($aRecords[$mediagroup], 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = _StringBetween($dataArea,">","<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;$tempvalue = _Stringbetween($aRecords[$mediagroup], ">", "<", -1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') $lv : $tempvalue = ' & $lv & "-" & $tempvalue & "-" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$lV_Searchresults_values[$lv][0] = $dataArea[0]
EndIf
[/autoit] [autoit][/autoit] [autoit]if StringInStr($aRecords[$mediagroup],"<id>") > 0 Then
$dataArea = StringStripWS($aRecords[$mediagroup], 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = _StringBetween($dataArea,">","<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;$tempvalue = _Stringbetween($aRecords[$mediagroup], ">", "<", -1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') $lv : $tempvalue = ' & $lv & "-" & $tempvalue & "-" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$lV_Searchresults_values[$lv][1] = StringReplace($dataArea[0], "http://gdata.youtube.com/feeds/api/videos/", "")
EndIf
[/autoit] [autoit][/autoit] [autoit]if StringInStr($aRecords[$mediagroup],"<media:title") > 0 Then
$dataArea = StringStripWS($aRecords[$mediagroup], 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = _StringBetween($dataArea,">","<")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;$tempvalue = _Stringbetween($aRecords[$mediagroup], ">", "<", -1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') $lv : $tempvalue = ' & $lv & "-" & $tempvalue & "-" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$lV_Searchresults_values[$lv][2] = $dataArea[0]
EndIf
[/autoit] [autoit][/autoit] [autoit]if StringInStr($aRecords[$mediagroup],"<published>") > 0 Then
$dataArea = StringStripWS($aRecords[$mediagroup], 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = _StringBetween($dataArea,">","<")
$dataArea = _StringBetween($dataArea[0], "", "T")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = StringSplit($dataArea[0], "-")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & UBound($dataArea) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;$tempvalue = _Stringbetween($aRecords[$mediagroup], ">", "<", -1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') $lv : $tempvalue = ' & $lv & "-" & $tempvalue & "-" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$lV_Searchresults_values[$lv][3] = $dataArea[3] & "." & $dataArea[2] & "." & $dataArea[1]
EndIf
[/autoit] [autoit][/autoit] [autoit]if StringInStr($aRecords[$mediagroup],"<yt:duration") > 0 Then
$dataArea = StringStripWS($aRecords[$mediagroup], 1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$dataArea = _StringBetween($dataArea,"'","'")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dataArea = ' & $dataArea[0] & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;$tempvalue = _Stringbetween($aRecords[$mediagroup], ">", "<", -1)
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') $lv : $tempvalue = ' & $lv & "-" & $tempvalue & "-" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$tempMinuten = Int($dataArea[0] / 60)
$lV_Searchresults_values[$lv][4] = Int($dataArea[0] / 60) & ":" & StringFormat("%02d",$dataArea[0] - ($tempMinuten * 60))
$lV_Searchresults_values[$lv][5] = $dataArea[0]
$lV_Searchresults_values[$lv][6] = $dataArea[0] * 192 * 1000 ;/ (1024 * 1024 *
EndIf
Next
$NewItem = _GUICtrlListView_AddItem($lV_Searchresults, $lv+1)
_GUICtrlListView_AddSubItem($lV_Searchresults, $NewItem, $lV_Searchresults_values[$lv][2], 1, 1)
_GUICtrlListView_AddSubItem($lV_Searchresults, $NewItem, $lV_Searchresults_values[$lv][4], 2, 1)
_GUICtrlListView_AddSubItem($lV_Searchresults, $NewItem, $lV_Searchresults_values[$lv][0], 3, 1)
_GUICtrlListView_AddSubItem($lV_Searchresults, $NewItem, $lV_Searchresults_values[$lv][1], 4, 1)
Next
; _ArrayDisplay($lV_Searchresults_values, "Results of searching for 0 in $avArray")
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $lV_Searchresults_values) = ' & UBound($lV_Searchresults_values) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
for $i = 0 to _GUICtrlListBox_GetCount(GUICtrlGetHandle($hListBox)) + 1
_GUICtrlListBox_DeleteString(GUICtrlGetHandle($hListBox), $i)
Next
for $i = 1 to $AnzSeiten
_GUICtrlListBox_AddString(GUICtrlGetHandle($hListBox), $i)
Next
_GUICtrlListBox_SetCurSel(GUICtrlGetHandle($hListBox), 0)
_GUICtrlStatusBar_SetText ($hStatus, "Fertig", 1)
GUICtrlSetState($lb_MsgText, $GUI_SHOW)
GUICtrlsetState(GUICtrlGetHandle($hListBox), $GUI_SHOW)
ControlFocus($Form1, "", GUICtrlGetHandle($hListBox))
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : GUICtrlgetState($hListBox, $GUI_SHOW) = ' & GUICtrlgetState($hListBox) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
EndFunc
Alles anzeigenSpoiler anzeigen
[autoit]#include
[/autoit] [autoit][/autoit] [autoit]
#include
#include
#includeGlobal Const $VK_RETURN = 0x0D
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate("", 200, 200)
[/autoit] [autoit][/autoit] [autoit]
$hListView = _GUICtrlListView_Create($hGUI, "Spalte 1", 10, 10)
For $i = 1 To 10
_GUICtrlListView_AddItem($hListView, Random(1,1000,1))
Next
GUISetState(@SW_SHOW)$wProcHandle = DllCallbackRegister("_WindowProc", "int", "hwnd;uint;wparam;lparam")
[/autoit] [autoit][/autoit] [autoit]
$wProcOld = _WinAPI_SetWindowLong($hListView, $GWL_WNDPROC, DllCallbackGetPtr($wProcHandle))While 1
[/autoit] [autoit][/autoit] [autoit]
$msg = GUIGetMsg()
Switch $msg
case $GUI_EVENT_CLOSE
_WinAPI_SetWindowLong($hListView, $GWL_WNDPROC, $wProcOld)
DllCallbackFree($wProcHandle)
Exit
EndSwitch
WendFunc _WindowProc($hWnd, $Msg, $wParam, $lParam)
[/autoit]
Switch $hWnd
Case $hListView
Switch $Msg
Case $WM_GETDLGCODE
Switch $wParam
Case $VK_RETURN
MsgBox(0,0, _GUICtrlListView_GetItemText($hListview,_GUICtrlListView_GetSelectedIndices($hListview)))
Return 0
EndSwitch
EndSwitch
EndSwitch
Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $Msg, $wParam, $lParam)
EndFunc
Danke, funktioniert soweit.
guck dir mal den befehl
[autoit]_IsPressed()
[/autoit]
an, ich glaube das ist das, was du suchstmfg
hauke
Und wie komme ich dabei an das gerade aktive Control?
Hallo Alle,
kann man in einer Listbox auf die ENTER-Taste reagieren? Wahrscheinlich über das registrieren einer WM_Command, aber wie geht das genau?
Danke!
Hallo Alle,
ich möchte in einem Listview JPG's anzeigen. Geht sowas?
Danke!
[Edit] Ok, dann machs ich halt per Workarround mit irfanview JPG -> BMP
Danke für Eure Antworten.
Dubios, Dubios ... oder ich sehe die Bäume vor lauter Wald nicht mehr
Hallo Alle,
ich ein Script welches ein Listview anzeigt. Beim Laden des Scripts werden alle Items inklusive der Subitems richtig erzeugt. Wil ich später einen neuen Eintrag hinzufügen, klappt es nicht mehr.
Kann jemand mal schauen. Es betrifft den Zeilenblock 37-44 (funktioniert) sowie den Block 60-69.
Danke im voraus.
EDIT: Hat sich soeben erledigt!
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
Global Const $SW_HIDE = 0
Global Const $SW_SHOW = 5
;Opt('MustDeclareVars', 1)
[/autoit] [autoit][/autoit] [autoit]_Main()
[/autoit] [autoit][/autoit] [autoit]Func _Main()
Local $listview
Local $exStyles = BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES)
GUICreate("ImageList Add", 461, 300)
$listview = GUICtrlCreateListView("", 2, 2, 460, 268, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT))
_GUICtrlListView_SetExtendedListViewStyle($listview, $exStyles)
$PB_NewItem = GUICtrlCreateButton("Neuer Eintrag", 2, 275, 75, 20)
GUISetState()
; Load images
[/autoit] [autoit][/autoit] [autoit]; Add columns
_GUICtrlListView_AddColumn($listview, "", 25)
_GUICtrlListView_AddColumn($listview, "Nr", 35)
_GUICtrlListView_AddColumn($listview, "Titel", 200)
_GUICtrlListView_AddColumn($listview, "Fortschritt", 250)
; Add items
for $z = 0 to Random(5,10,1)
_GUICtrlListView_AddItem($listview, "")
_GUICtrlListView_AddSubItem($ListView, $z, $z+1, 1, 1)
_GUICtrlListView_AddSubItem($ListView, $z, "Seite " & $z+1 & " holen", 2, 2)
_GUICtrlListView_AddSubItem($ListView, $z, "Warte auf Start!", 3, 2)
Next
[/autoit] [autoit][/autoit] [autoit]dim $downloaded_nr = 0
[/autoit] [autoit][/autoit] [autoit]dim $querystring = "http://gdata.youtube.com/feeds/api/videos?max-results=50&start-index=*author=7600CELSIUS"
#cs
Local $hProgress = _ListView_InsertProgressBar($listview, 0, 3)
_Progress_SetBarColor($hProgress, 0x0000FF)
_Progress_SetBkColor($hProgress,0x00FFFF)
#ce
; Loop until user exits
Local $i, $listitemctr = 0
Do
[/autoit] [autoit][/autoit] [autoit]if GUIGetMsg() = $PB_NewItem then
[/autoit] [autoit][/autoit] [autoit]$z = _GUICtrlListView_GetItemCount($ListView) + 1
ConsoleWrite("$pb_newitem: " & $z & @crlf)
_GUICtrlListView_AddItem($listview, "")
_GUICtrlListView_AddSubItem($ListView, $z, $z+1, 1, 1)
_GUICtrlListView_AddSubItem($ListView, $z, "Seite " & $z+1 & " holen", 2, 2)
_GUICtrlListView_AddSubItem($ListView, $z, "Warte auf Start!", 3, 2)
EndIf
[/autoit] [autoit][/autoit] [autoit]for $i = 0 to _GUICtrlListView_GetItemCount($ListView)
if $listitemctr = _GUICtrlListView_GetItemCount($ListView) then ExitLoop
Local $hDownload = InetGet("http://gdata.youtube.com/feeds/api/videos?max-results=50&start-index=" & $i + 1 & "&author=7600CELSIUS", @ScriptDir & "\update" & $i + 1 & ".dat", 1, 1)
Do
Sleep(50)
Local $nBytes = InetGetInfo($hDownload, 0)
_GUICtrlListView_SetItemText($ListView, $i, "Runterläding: " & $nBytes, 3)
if GUIGetMsg() = $GUI_EVENT_CLOSE then
InetClose($hDownload) ; Close the handle to release resourcs.
GUIDelete()
Exit
EndIf
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $nBytes = ' & $nBytes & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
Until InetGetInfo($hDownload, 2); Check if the download is complete.
Local $nBytes = InetGetInfo($hDownload, 0)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $nBytes ' & $i & ' = ' & $nBytes & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
InetClose($hDownload) ; Close the handle to release resourcs.
$olditem = _GUICtrlListView_GetItemText($ListView, $i, 3)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $olditem = ' & $olditem & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
If $olditem = "Runterläding: 0" Then
_GUICtrlListView_SetItemText($ListView, $i, "Fehler: Keine Internetverbindung!", 3)
Else
_GUICtrlListView_SetItemText($ListView, $i, "Fertig!", 3)
EndIf
$listitemctr = $listitemctr + 1
Next
; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : GUIGetMsg = ' & GUIGetMsg() & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit];Sleep(50)
Until GUIGetMsg() = $GUI_EVENT_CLOSE ;Or $i = 101
GUIDelete()
EndFunc ;==>_Main
; #FUNCTION# ======================================================================================
; Function Name:_ListView_InsertProgressBar()
; Description: Inserts a progressbar control in the ListView control.
; Syntax.........: _ListView_InsertProgressBar($sHwnd, $sItemIndex[, $sSubItemIndex])
; Parameter(s): $sHwnd - Handle to the ListView control.
; $sItemIndex - Zero based index of the item at which the progressbar should be inserted.
; $sSubItemIndex - [Optional] One based index of the subitem where progressbar should be placed, default is 1.
;
; Return Value(s): Returns the identifier (controlID) of the new progressbar control.
; Requirement(s): AutoIt 3.2.10.0 and above
; Note(s): Optimal amount of progressbar controls is 5-10. Don`t abuse with many amount of progressbar controls.
;
; Author(s): R.Gilman (a.k.a rasim), arcker
;==================================================================================================
Func _ListView_InsertProgressBar($sHwnd, $sItemIndex, $sSubItemIndex = 0)
Local $hRet
If Not IsHWnd($sHwnd) Then $sHwnd = GUICtrlGetHandle($sHwnd)
Local $iStyle = _WinAPI_GetWindowLong($sHwnd, $GWL_STYLE)
[/autoit] [autoit][/autoit] [autoit]If BitAND($iStyle, $WS_CLIPCHILDREN) <> $WS_CLIPCHILDREN Then
_WinAPI_SetWindowLong($sHwnd, $GWL_STYLE, BitOR($iStyle, $WS_CLIPCHILDREN))
EndIf
Local $aRect
[/autoit] [autoit][/autoit] [autoit]If $sSubItemIndex = 0 Then
$aRect = _GUICtrlListView_GetItemRect($sHwnd, $sItemIndex, 2)
Else
$aRect = _GUICtrlListView_GetSubItemRect($sHwnd, $sItemIndex, $sSubItemIndex)
EndIf
DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 0)
$hRet = _Progress_Create($sHwnd, $aRect[0], $aRect[1], $aRect[2] - $aRect[0], $aRect[3] - $aRect[1])
DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 7)
Return $hRet
EndFunc ;==>_ListView_InsertProgressBar
Func _Progress_Create($hWnd, $iX, $iY, $iWidth = -1, $iHeight = -1, $iStyle = 0, $iExStyle = 0)
$iStyle = BitOR($iStyle, $WS_CHILD, $WS_VISIBLE)
Return _WinAPI_CreateWindowEx($iExStyle, "msctls_progress32", "", $iStyle, $iX, $iY, $iWidth, $iHeight, $hWnd)
EndFunc ;==>_Progress_Create
Func _MoveProgress($hListView, $hProgress, $sItemIndex, $sSubItemIndex)
Local $aRect
If $sSubItemIndex = 0 Then
$aRect = _GUICtrlListView_GetItemRect($hListView, $sItemIndex, 2)
Else
$aRect = _GUICtrlListView_GetSubItemRect($hListView, $sItemIndex, $sSubItemIndex)
EndIf
If $aRect[1] < 10 Then
_WinAPI_ShowWindow($hProgress, $SW_HIDE)
ElseIf $aRect[1] >= 10 Then
_WinAPI_ShowWindow($hProgress, $SW_SHOW)
EndIf
_WinAPI_MoveWindow($hProgress, $aRect[0], $aRect[1], $aRect[2] - $aRect[0], $aRect[3] - $aRect[1], True)
EndFunc ;==>_MoveProgress
; #FUNCTION# ====================================================================================================
; Description ...: Sets the color of the indicator bar
; Parameters ....: $hWnd - Handle to the control
; $iColor - The new progress indicator bar color. Specify the CLR_DEFAULT value to cause the progress bar
; +to use its default progress indicator bar color.
; Return values .: Success - The previous progress indicator bar color, or CLR_DEFAULT if the progress indicator bar color
; +is the default color.
; Author ........: Paul Campbell (PaulIA), Updated By Arcker
; Remarks .......: This message is supported only in the Windows Classic theme
; Related .......:
; ====================================================================================================
Func _Progress_SetBarColor($hWnd, $iColor)
Return _SendMessage($hWnd, $PBM_SETBARCOLOR, 0, $iColor)
EndFunc ;==>_Progress_SetBarColor
; #FUNCTION# ====================================================================================================
; Description ...: Sets the current position
; Parameters ....: $hWnd - Handle to the control
; $iPos - The new position
; Return values .: Success - The previous position
; Author ........: Paul Campbell (PaulIA), Updated By Arcker
; Remarks .......:
; Related .......: _Progress_GetPos
; ====================================================================================================
Func _Progress_SetPos($hWnd, $iPos)
Return _SendMessage($hWnd, $PBM_SETPOS, $iPos, 0)
EndFunc ;==>_Progress_SetPos
; #FUNCTION# ====================================================================================================
; Description ...: Sets the background color in the progress bar
; Parameters ....: $hWnd - Handle to the control
; $iColor - The new background color. Specify the CLR_DEFAULT value to cause the progress bar to use its
; +default background color.
; Return values .: Success - The previous background color, or CLR_DEFAULT if the background color is the default color.
; Author ........: Paul Campbell (PaulIA), Updated By Arcker
; Remarks .......: This message is supported only in the Windows Classic theme
; Related .......:
; ====================================================================================================
Func _Progress_SetBkColor($hWnd, $iColor)
Return _SendMessage($hWnd, $PBM_SETBKCOLOR, 0, $iColor)
EndFunc ;==>_Progress_SetBkColor
; #FUNCTION# ====================================================================================================
[/autoit] [autoit][/autoit] [autoit]; Description ...: Specifies the step increment
; Parameters ....: $hWnd - Handle to the control
; $iStep - Step increment.
; Return values .: Success - The previous step increment
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The step increment is the amount by which the progress bar increases its current position whenever you use the
; _Progress_StepIt function. By default, the step increment is set to 10.
; Related .......: _Progress_StepIt
; ====================================================================================================
Func _Progress_SetStep($hWnd, $iStep = 10)
Return _SendMessage($hWnd, $PBM_SETSTEP, $iStep, 0)
EndFunc ;==>_Progress_SetStep
; #FUNCTION# ====================================================================================================
; Description ...: Advances the current position by the step increment
; Parameters ....: $hWnd - Handle to the control
; Return values .: Success - The previous position
; Author ........: Paul Campbell (PaulIA), Updated By Arcker
; Remarks .......:
; Related .......: _Progress_SetStep
; ====================================================================================================
Func _Progress_StepIt($hWnd)
Return _SendMessage($hWnd, $PBM_STEPIT, 0, 0)
EndFunc ;==>_Progress_StepIt
; #FUNCTION# ====================================================================================================
; Description ...: Delete the progressbar control
; Parameters ....: $hWnd - Handle to the control
; Return values .: Success - True
; Failure - False
; Author ........: G. Sandler (MrCreatoR), Updated by rasim
; Remarks .......:
; Related .......: _Progress_SetStep
; ====================================================================================================
Func _Progress_Delete($hWnd)
Local $aResult = DllCall("User32.dll", "int", "DestroyWindow", "hwnd", $hWnd)
If @error Then Return SetError(1, 0, 0)
Return $aResult[0] <> 0
EndFunc ;==>_Progress_Delete
Ok, danke schön. Ich werde Deine Hinweise beherzigen.