Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Frage zu Loop


  • Please log in to reply
17 replies to this topic
fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012
Auten Abend liebe Community,

es geht darum in einem Order nachzuschauen wieviele unterordner vorhanden sind bzw. deren Namen in einer Variablen zu speichern um sie anschließend in einem Listview darzustellen.

Wenn ich die Hilfe richtig verstehe müsste es doch so klappen oder?

PicChatHome:= A_ScriptDir "\" "PWMPicShare" "\"
Loop, %PicChatHome%, 2, 1
Dateiliste = %Dateiliste%%A_LoopFileName%`n
Sort, Dateiliste, R  ; Die R-Option sortiert in umgekehrter Richtung. Siehe Sort für weitere Optionen.
msgbox %Dateiliste%
Loop, parse, Dateiliste, `n
{
    If A_LoopField =  ; Ignoriert das leere Element am Ende der Liste.
	    continue
    MsgBox, 4,, Dateinummer %A_Index% ist %A_LoopField%.  Weiter?
    IfMsgBox, No
	    break
}

Da passiert aber nix... Dateiliste bleibt leer... Warum?

Ragnar
  • Members
  • 68 posts
  • Last active: Aug 26 2015 12:18 PM
  • Joined: 02 Oct 2006
PicChatHome := A_ScriptDir "\PWMPicShare\*.*"

fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012
Danke Ragnar,

wie bekommt man den Inhalt von Dateiliste dann anschließend in ein Listview?

Mit LV_Insert?

Der inhalt von Dateliste sind jetzt z.B. 4 Namen. Wie holt man diese einzeln aus der Variabel raus?

lasso
  • Members
  • 111 posts
  • Last active: May 19 2013 04:19 PM
  • Joined: 02 Nov 2012
hi fump
ich hatte im alten Forum mal eine Funktion gezeigt die das listen von Dateien und Ordnern erheblich vereinfacht

eventuell ist das was für dich

SetBatchLines,-1
#SingleInstance, Force

Gui,Add,ListView, X40 Y40 W520 h360 HWNDHLV_1
,Name|FullPath|LongPath|ShortPath|ShortName|Dir|Modified|Created|Accessed|Attrib|Size|SizeKB|SizeMB

LV_SetImageList(ILID2 := DllCall("comctl32.dll\ImageList_Create","Int",16,"Int",16,"UInt",(32|0x1),"Int",500,"Int",500))

Loop, % GetDirectoryList(var:="var", "C:\" ,1, ILID2) {
	 (A_Index=1 ? LV_Delete() : "")
LV_Add(var["Icon"	 A_Index]
	 , var["Name"	 A_Index]
	 , var["FullPath" A_Index]
	 , var["LongPath" A_Index]
	 , var["ShortPath" A_Index]
	 , var["ShortName" A_Index]
	 , var["Dir"	 A_Index]
	 , var["Modified" A_Index]
	 , var["Created" A_Index]
	 , var["Accessed" A_Index]
	 , var["Attrib" A_Index]
	 , var["Size"	 A_Index]
	 , var["SizeKB" A_Index]
	 , var["SizeMB" A_Index])
}
Gui, Show, h440 W600 Center,
return



GetDirectoryList(Di,SFPath="",FoF="",ByRef himl=""){ ;-------------->"GetDirectoryList.ahk"<------------------------------------------------------------------------------------------------------------------------------------;
GLOBAL
IconNumber := "" ;-------------------------------------->testet on 32-bit Windows_XP Pro SP2 AHK_L unicode<---------------------------------------------------------------------------------------------------------------------;
SFPath:=((InStr(FileExist(SFPath),"D")>0)! ? SFPath : ((SubStr(SFPath,(StrLen(SFPath),1)) = "\") ? SFPath : (SFPath:=(SFPath . "\")))),IN:=""4,%Di% := Object(),View := "Thumbnails" , L:=""
If !(SFPath="") {
If !FileExist(SFPath) {
While ((3=A_Index) ? 1 : KF[SFPath]!) {
If (((WIN_VISTA=A_OSVersion)||(WIN_7=A_OSVersion)) ? ((IN = 0) ? 0 : 1) : ((IN = 0) ? 1 : 0))
KF:= Object("AdminTools","{724EF170A42D4FEF9F26B60E846FBA4F}","CDBurning","{9E52AB10F80D49DFACB84330F5687855}","CommonAdminTools","{D0384E7DBAC347978F14CBA229B392B5}","CommonOEMLinks","{C1BAE2D010DF4334BEDD7AA20B227A9D}"
,"CommonPrograms","{0139D44E6AFE49F286903DAFCAE6FFB8}","CommonstartMenu","{A4115719D62E491DAA7CE74B8BE3B067}","Commonstartup","{82A5EA35D9CD47C59629E15D2F714E6E}","CommonTemplates","{B94237E757AC43479151B08C6C32D1F7}"
,"Contacts","{56784854C6CB462b816988E350ACB882}","Cookies","{2B0F765DC0E94171908E08A611B84FF6}","Desktop","{B4BFCC3ADB2C424CB0297FE99A87C641}","DeviceMetadataStore","{5CE4A5E9E4EB479DB89F130C02886155}"
,"DocumentsLibrary","{7B0DB17D9CD24A93973346CC89022E7C}","Downloads","{374DE290123F4565916439C4925E467B}","Favorites","{1777F76168AD4D8A87BD30B759FA33DD}","Fonts","{FD228CB7AE114AE3864C16F3910AB8FE}"
,"GameTasks","{054FAE614DD8478780B6090220C4B700}","History","{D9DC8A3BB784432EA7815A1130A75963}","ImplicitAppShortcuts","{BCB5256F79F64CEEB725DC34E402FD46}","InternetCache","{352481E833BE4251BA856007CAEDCF9D}"
,"Libraries","{1B3EA5DCB5874786B4EFBD1DC332AEAE}","Links","{bfb9d5e0c6a9404cb2b2ae6db6af4968}","LocalAppData","{F1B327856FBA4FCF9D557B8E7F157091}","LocalAppDataLow","{A520A1A417804FF6BD18167343C5AF16}"
,"LocalizedResourcesDir","{2A00375E224C49DEB8D1440DF7EF3DDC}","Music","{4BD8D5716D1948D3BE97422220080E43}","MusicLibrary","{2112AB0AC86A4FFEA3680DE96E47012E}","NetHood","{C5ABBF53E17F4121890086626FC2C973}"
,"OriginalImages","{2C36C0AA58124b87BFD04CD0DFB19B39}","PhotoAlbums","{69D2CF90FC334FB79A0CEBB0F0FCB43C}","Pictures","{33E281304E1E4676835A98395C3BC3BB}","PicturesLibrary","{A990AE9FA03B4E8094BC9912D7504104}"
,"Playlists","{DE92C1C7837F4F69A3BB86E631204A23}","PrintHood","{9274BD8DCFD141C3B35EB13F55A758F4}","Profile","{5E6C858F0E2247609AFEEA3317B67173}","ProgramData","{62AB5D82FDC14DC3A9DD070D1D495D97}"
,"ProgramFiles","{905e63b6c1bf494eb29c65b732d3d21a}","ProgramFilesCommon","{F7F1ED059F6D47A2AAAE29D317C6F066}","ProgramFilesCommonX64","{6365D5A70F0D45E587F60DA56B6A4F7D}","ProgramFilesCommonX86","{DE974D24D9C64D3EBF91F4455120B917}"
,"ProgramFilesX64","{6D8093776AF0444b8957A3773F02200E}","ProgramFilesX86","{7C5A40EFA0FB4BFC874AC0F2E0B9FA8E}","Programs","{A77F5D772E2B44C3A6A2ABA601054A51}","Public","{DFDF76A2C82A4D63906A5644AC457385}"
,"PublicDesktop","{C4AA340DF20F4863AFEFF87EF2E6BA25}","PublicDocuments","{ED4824AFDCE445A881E2FC7965083634}","PublicDownloads","{3D644C9B1FB84f309B45F670235F79C0}","PublicGameTasks","{DEBF2536E1A84c59B6A2414586476AEA}"
,"PublicLibraries","{48DAF80BE6CF4F4EB8000E69D84EE384}","PublicMusic","{3214FAB597574298BB6192A9DEAA44FF}","PublicPictures","{B6EBFB866907413C9AF74FC2ABF07CC5}","PublicRingtones","{E555AB60153B4D179F04A5FE99FC15EC}"
,"PublicVideos","{2400183A618549FBA2D84A392A602BA3}","QuickLaunch","{52a4f0217b7548a99f6b4b87a210bc8f}","Recent","{AE50C081EBD2438A86558A092E34987A}","RecordedTVLibrary","{1A6FDBA2F42D4358A798B74D745926C5}"
,"ResourceDir","{8AD10C312ADB4296A8F7E4701232C972}","Ringtones","{C870044BF49E4126A9C3B52A1FF411E8}","RoamingAppData","{3EB685DB65F94CF6A03AE3EF65729F3D}","SampleMusic","{B250C668F57D4EE1A63C290EE7D1AA1F}"
,"SamplePictures","{C490054023794C75844B64E6FAF8716B}","SamplePlaylists","{15CA69B330EE49C1ACE16B5EC372AFB5}","SampleVideos","{859EAD942E8548ADA71A0969CB56A6CD}","SavedGames","{4C5C32FFBB9D43b0B5B42D72E54EAAA4}"
,"SavedSearches","{7d1d3a04debb411595cf2f29da2920da}","SendTo","{8983036C27C0404B8F08102D10DCFD74}","SidebarDefaultParts","{7B396E549EC54300BE0A2482EBAE1A26}","SidebarParts","{A75D362E50FC4fb7AC2CA8BEAA314493}"
,"StartMenu","{625B53C3AB484EC1BA1FA1EF4146FC19}","Startup","{B97D20BBF46A4C97BA105E3608430854}","System","{1AC14E7702E74E5DB7442EB1AE5198B7}","SystemX86","{D65231B0B2F14857A4CEA8E7C6EA7D27}"
,"Templates","{A63293E8664E48DBA079DF759E0509F7}","UserPinned","{9E3995AB1F9C4F13B82748B24B6C7174}","UserProfiles","{0762D272C50A4BB0A382697DCD729B80}","UserProgramFiles","{5CD7AEE222194A67B85D6C9CE15660CB}"
,"UserProgramFilesCommon","{BCBD3057CA5C4622B42DBC56DB0AE516}","Videos","{18989B1D99B5455B841CAB7C74E4DDFC}","VideosLibrary","{491E922F56434AF4A7EB4E7A138D8174}","Windows","{F38BF4041D4342F2930567DE0B28FC23}")
Else KF:= Object("AdminTools",48,"CDBurning",59,"CommonAdminTools",47,"CommonOEMLinks",58,"CommonPrograms",23,"CommonstartMenu",22,"Commonstartup",24,"CommonTemplates",45,"Cookies",33,"Desktop",0,"Favorites",6,"Fonts",20
,"History",34,"InternetCache",32,"LocalAppData",28,"LocalizedResourcesDir",57,"NetHood",19,"Pictures",39,"PrintHood",27,"Profile",40,"ProgramData",35,"ProgramFiles",38,"ProgramFilesCommon",43,"ProgramFilesCommonX86",44,"ProgramFilesX86",42
,"Programs",2,"PublicDesktop",25,"PublicDocuments",46,"PublicMusic",53,"PublicPictures",54,"PublicVideos",55,"Recent",8,"ResourceDir",56,"RoamingAppData",26,"SendTo",9,"StartMenu",11,"Startup",7,"System",37,"SystemX86",41,"Templates",21
,"Windows",36,"ALTSTARTUP",29,"COMMON_ALTSTARTUP",30,"COMMON_FAVORITES",31,"COMPUTERSNEARME",61,"DESKTOPDIRECTORY",16,"PERSONAL",5)
If (KF[SFPath]!)
For Key, val in KF {
} Until IN:=(SFPath = val ? (SFPath:=Key) : 0)
} VarSetCapacity(Npath,(A_IsUnicode ? 520 : 260))
If A_OSVersion in WIN_VISTA,WIN_7
{VarSetCapacity(GUID,16,0),NumPut("0x" . SubStr(KF[SFPath],2,8),GUID,0,"UInt"),NumPut("0x" . SubStr(KF[SFPath],10,4),GUID,4,"UShort"),NumPut("0x" . SubStr(KF[SFPath],14,4),GUID,6,"UShort")
Loop, 8
NumPut("0x" . SubStr(KF[SFPath],16+(A_Index*2),2),GUID,7+A_Index,"UChar")
DllCall("Shell32\SHGetKnownFolderPath","UInt",&GUID,"UInt",0,"UInt",0,"UIntP",Npath),SFPath:=StrGet(Npath)
} Else DllCall("Shell32\SHGetFolderPath"(A_IsUnicode ? "W":"A"),"int",0,"int",KF[SFPath],"int",0,"int",0,"str",Npath),SFPath:=Npath
} VarSetCapacity(sfi, (A_PtrSize + 8 + (A_IsUnicode ? 680 : 340))) , DllCall("LoadLibrary", "str", "Comctl32") , DllCall("ImageList_GetIconSize",UInt,himl,IntP,wlv_icon_size,IntP,hlv_icon_size)
,HShell32 := DllCall("GetModuleHandle", "str", "shell32.dll") , icon_size := ((wlv_icon_size > 16)||(hlv_icon_size > 16) ? "0x100" : "0x101") , PtrS := (A_PtrSize + 8 + (A_IsUnicode ? 680 : 340))
(DllCall("GetModuleHandle", "str", "gdiplus") ? "" : DllCall("LoadLibrary", "str", "gdiplus")) , VarSetCapacity(si, 16, 0), si := Chr(1) , DllCall("gdiplus\GdiplusStartup", "uint*", pToken, "uint", &si, "uint", 0) , L:=0
VarSetCapacity(AG,8),NumPut(DllCall("comctl32.dll\ImageList_GetBkColor",UInt,himl),AG,"int64"),DllCall("msvcrt\_vsnwprintf","wstr",buf,"ptr",VarSetCapacity(buf,14)//2,"wstr","`%X","ptr",&AG),background .="0x" . SubStr(buf,5,2) . SubStr(buf,3,2) . SubStr(buf,1,2)
DllCall("comctl32.dll\ImageList_SetBkColor",UInt,himl,UInt,0x800000)icon_size , DllCall("comctl32.dll\ImageList_Remove", "uint",himl,int,-1)
Loop %SFPath%*,%FoF%
{L++ , %Di%.Insert("Name" L,A_LoopFileName),%Di%.Insert("FullPath" L,A_LoopFileFullPath),%Di%.Insert("LongPath" L,A_LoopFileLongPath),%Di%.Insert("ShortPath" L,A_LoopFileShortPath),%Di%.Insert("ShortName" L,A_LoopFileShortName)
,%Di%.Insert("Dir" L,A_LoopFileDir),%Di%.Insert("Modified" L,A_LoopFileTimeModified),%Di%.Insert("Created" L,A_LoopFileTimeCreated),%Di%.Insert("Accessed" L,A_LoopFileTimeAccessed),%Di%.Insert("Attrib" L,A_LoopFileAttrib)
,%Di%.Insert("Size" L,A_LoopFileSize),%Di%.Insert("SizeKB" L,A_LoopFileSizeKB),%Di%.Insert("SizeMB" L,A_LoopFileSizeMB),%Di%.Insert("Ext" L,A_LoopFileExt)
if !(A_LoopFileExt="jpg"||A_LoopFileExt="bmp"||A_LoopFileExt="png"||A_LoopFileExt="gif"||A_LoopFileExt="jpeg"||A_LoopFileExt="tiff")&&(View="Thumbnails")
{hIcon := (DllCall("Shell32\SHGetFileInfo" . (A_IsUnicode ? "W":"A"),"str",A_LoopFileFullPath,"uint",0,"str",sfi,"uint",PtrS,"uint",icon_size) ? NumGet(sfi, 0) : DllCall("LoadImage","Uint",HShell32,"Uint",1,"Uint",1,"int",96,"int",96,"Uint",0x8000))
IconNumber := DllCall("ImageList_ReplaceIcon", "ptr", himl, "int",-1, "ptr", hIcon)
} Else IconNumber := makebmp(A_loopfilefullpath,himl,wlv_icon_size,hlv_icon_size,Background)
DllCall("DestroyIcon", "ptr", hIcon)
%Di%.Insert("Icon" L-1,"Icon" . IconNumber)
} DllCall("gdiplus\GdiplusShutdown", "uint", pToken)
if hModule := DllCall("GetModuleHandle", "str", "gdiplus")
	 DllCall("FreeLibrary", "uint", hModule)
return, L
} DriveGet,L,list
Loop,Parse,L
{LPi:=A_Index,%Di%%A_Index%1:=A_LoopField,Dc:=["Cap","FS","Label","Serial","Type","Status","StatusCD",1]
while Dc[A_Index],wI:=(A_Index+1)
DriveGet,%Di%%LPi%%WI%, % Dc[A_Index] , % A_LoopField ":\"
DriveSpaceFree,%Di%%A_Index%9, % A_LoopField ":\"
DriveGet, DT%A_Index%, type, % SubStr(L,A_Index,1) . ":"
LI%A_Index%:=((DT%A_Index% = "FIXED") || (DT%A_Index% = "UNKNOWN") ? 9 : ((DT%A_Index% = "CDROM") ? 12 : ((DT%A_Index% = "REMOVABLE") ? 8 : ((DT%A_Index% = "RAMDISK") ? 13 : ((DT%A_Index% = "NETWORK") ? 10 : "" ))))) , DL:=SubStr(L,A_Index,1)
if (DL <> "A") && (DL <> "B")
DriveGet, %Di%%A_Index%0, label, % DL . ":"
RegRead, LM%A_Index% , HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\%DL%\DefaultIcon,
RegRead, II%A_Index% , HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\%DL%\DefaultLabel,
RegRead, LML%A_Index% , HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\%DL%\DefaultComment,
RegExMAtch(LM%A_Index%,((InStr(LM%A_Index%,".dll")) ? "i)(..*\....)`,\d*\d*\d*\d" : ((InStr(LM%A_Index%,".ico")) ? "i)(..*\....)" : "" )), IconF ,1)
%Di%%A_Index%c:=LML%A_Index%,%Di%%A_Index%d:=LM%A_Index%,%Di%%A_Index%b:=II%A_Index%,%Di%%A_Index%a:=DL
x:=(IsByRef(himl) ? ((IconF1 <> "") ? ( ! FileExist(A_WinDir . "system32\" . IconF1) ? IL_Add(himl, IconF1 ,(SubStr(IconF,StrLen(IconF1)+2)+1)) : IL_Add(himl,"shell32.dll",LI%A_Index%)) : IL_Add(himl,"shell32.dll",LI%A_Index%)) : 0)
} return,StrLen(L)
}
MAKEBMP(file,ByRef hIml,wsize=32,hsize=32,Background=0x00ffffff){
if !(A_IsUnicode){
VarSetCapacity(wFile, 1023) , DllCall("kernel32\MultiByteToWideChar", "uint", 0, "uint", 0, "uint", &file, "int", -1, "uint", &wFile, "int", 512)
DllCall("gdiplus\GdipCreateBitmapFromFile", "uint", &wFile, "uint*", pBitmap)
}Else DllCall("gdiplus\GdipCreateBitmapFromFile", "uint", &file, "uint*", pBitmap)
DllCall("gdiplus\GdipCreateBitmapFromScan0","int",wsize,"int",hsize,"int",0,"int",0x26200A,"uint",0,"uint*",pBitmapResized),DllCall("gdiplus\GdipGetImageGraphicsContext", "uint",pBitmapResized, "uint*", G),DllCall("gdiplus\GdipSetInterpolationMode", "uint",G, "int",5)
pBrush := Gdip_BrushCreateSolid(backgound),Gdip_FillRectangle(G, pBrush, 0, 0, wsize, hsize),DllCall("gdiplus\GdipGetImageWidth", "uint", pBitmap, "uint*", sw),DllCall("gdiplus\GdipGetImageHeight", "uint", pBitmap, "uint*", sh),DllCall("gdiplus\GdipDrawImageRectRect"
,"uint",G,"uint",pBitmap,"float",0,"float",0,"float",(sw<sh ? Floor(hsize*(sw/sh)) : wsize),"float",(sw>sh ? Floor(wsize*(sh/sw)) : hsize),"float",0,"float",0,"float",sw,"float",sh,"int",2,"uint",IAtt,"uint",0,"uint",0)
DllCall("gdiplus\GdipCreateHICONFromBitmap", "uint",pBitmapResized, "uint*", hIcon),IconNumber:= DllCall("ImageList_ReplaceIcon", "ptr", himl, "int",-1, "ptr", hIcon),Gdip_DeleteGraphics(G),Gdip_DisposeImage(pBitmapResized),Gdip_DisposeImage(pBitmap),DeleteObject(hBitmap)
return IconNumber
}


nnnik
  • Members
  • 1625 posts
  • Last active: Jan 24 2019 02:19 PM
  • Joined: 28 Jul 2012
Hast du doch schon mit A_Loopfield
und du solltest dir die Deutsche Hilfe Runterladen dann würden fragen wie

wie bekommt man den Inhalt von Dateiliste dann anschließend in ein Listview?

Mit LV_Insert?

überflüssig werden
BTW LV.Insert(A_LoopField)

Visit the new forum ahkscript.org.

http://ahkscript.org


fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012
nnnik ich habe die Hilfe momentan geöffnet und die Frage erst geschrieben nachdem ich diesen Teil der Hilfe gelesen hatte...

Wenn Fragen dieser Art nicht erlaubt sind... dann schreibt das irgendwo hin... ansonsten stelle ich weiterhin Fragen wenn ich nicht weiter komme, dachte dazu sei ein Forum da. War auch bisher nie ein Problem. Sorry wenn es dich nervt.

Danke für deine Antwort!

@lasso:
Danke dafür, hatte das im alten Forum schon entdeckt und werds mir anschauen, vllt. kann ich es wirklich verwenden.

fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012
Das steht in der Hilfe:
LV_Insert(Reihennummer [, Optionen, Spalte1, Spalte2, ...]): Verhält sich genauso wie LV_Add(), aber mit dem Unterschied, dass der erste Parameter die neue Position bestimmt, auf der eine neue Reihe eingefügt wird. Jede Reihe, auf oder unterhalb der Reihennummer, wird nach unten verschoben, um Platz für die neue Reihe zu schaffen. Falls die Reihennummer größer als die Anzahl der Reihen in der Liste ist (sogar so hoch wie 2147483647), wird die neue Reihe ans untere Ende der Liste gesetzt. Siehe Reihe-Optionen (oben) für weitere Optionen.

Wie soll dadurch auf deine Lösung kommen?

fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012
^r::
Gui, PicChat:New, +LastFound +ToolWindow -MaximizeBox +AlwaysOnTop, Bildversand
Gui, PicChat:Color, 3366CC
Gui, PicChat:Default
Gui, PicChat:Add, Text, x0 y10 w170 h40 +Center, Wähle einen User aus und starte den Vorgang.
Gui, PicChat:Add, CheckBox, x2 y50 w80 h20 , Autorefresh
Gui, PicChat:Add, Button, x88 y50 w80 h20 , Refresh
Gui, PicChat:Add, ListView, x2 y79 w166 h340 vEigenesListView gEigenesListView,Name
Dateiliste :=
PicChatHome := A_ScriptDir "\PWMPicShare\*.*"
Loop, %PicChatHome%, 2, 1
Dateiliste = %Dateiliste%%A_LoopFileName%`n
GuiControl, -Redraw, EigenesListView
Loop, parse, Dateiliste, `n
{
LV_Insert(A_LoopField)
If A_LoopField = ; Ignoriert das leere Element am Ende der Liste.
break
msgbox %A_LoopField%
}
GuiControl, +Redraw, EigenesListView
SysGet, PicMon, MonitorWorkArea, 1
PicChatX:=PicMonRight-190
PicChatY:=PicMonBottom-450
PicChatW:=170
PicChatH:=410
Gui, PicChat:Show, % "x" PicChatX "y" PicChatY "w" PicChatW "h" PicChatH, Bildversand
Return

Warum bleibt das Listview leer?
In der Msgbox stehen die Namen jeweils korrekt drin.

lasso
  • Members
  • 111 posts
  • Last active: May 19 2013 04:19 PM
  • Joined: 02 Nov 2012
welches listview
hier ist keins
Posted Image
ListBox, x2 y79 w166 h340 vEigenesListView gEigenesListView

box view egal list steht ja da
junge mach feierabend und fump n bier auf

fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012
Ja habs gesehen und geändert... aber es bleibt dennoch leer...

lasso
  • Members
  • 111 posts
  • Last active: May 19 2013 04:19 PM
  • Joined: 02 Nov 2012
da fehlt doch was ???
LV_Insert(A_LoopField)

Ragnar
  • Members
  • 68 posts
  • Last active: Aug 26 2015 12:18 PM
  • Joined: 02 Oct 2006
...

Loop, parse, Dateiliste, `n
{
If A_LoopField = ; Ignoriert das leere Element am Ende der Liste.
break
LV_Add("", A_LoopField)
}

...


fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012
Danke Ragnar!

fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012
Klicke ich in der GUI auf Refresh dann springt er das Label an, es kommen auch die msgboxen die zur Kontrolle da stehen auch die Befehle werden umgesetzt.

Aktiviere ich aber den Autorefresh und gebe den Intervall ein, dann zeigt er mir auch die msgboxen aber die Befehle werden nicht durchgeführt. Das Listview wird nicht aktualisiert.

Kann mir einer sagen warum?

Spoiler


Danke im voraus!

MfG
fump

Ragnar
  • Members
  • 68 posts
  • Last active: Aug 26 2015 12:18 PM
  • Joined: 02 Oct 2006
Gui, PicChat:New, +LastFound +ToolWindow -MaximizeBox +AlwaysOnTop, Bildversand
Gui, PicChat:Color, 3366CC
Gui, PicChat:Default
Gui, PicChat:Add, Text, x0 y10 w170 h40 +Center cWhite, Wähle einen User aus und starte den Vorgang durch Doppelklick.
Gui, PicChat:Add, CheckBox, x2 y50 w80 h20 vAutoRefresh gAutoRefreshClick cWhite, Autorefresh
Gui, PicChat:Add, Button, x88 y50 w80 h20 gClickRefresh, Refresh
Gui, PicChat:Add, ListView, x2 y79 w166 h330 NoSortHdr Sort vUserList gUserList BackgroundA6D2FF, Name
SysGet, PicMon, MonitorWorkArea, 1
PicChatX:=PicMonRight-190
PicChatY:=PicMonBottom-450
PicChatW:=170
PicChatH:=410
Gui, PicChat:Show, % "x" PicChatX "y" PicChatY "w" PicChatW "h" PicChatH, Bildversand
Gosub, Refresh
Return

UserList:
If A_GuiEvent = Doubleclick
{
If Not RowNumber := LV_GetNext("Selected")
{
MsgBox, Bitte einen User auswählen!
Return
}
else
{
LV_GetText(PicToUser, RowNumber)
}
}
Return

ClickRefresh:
GoSub Refresh
Return

AutoRefreshClick:
InputX:=PicChatX-142
InputY:=PicChatY
GuiControlGet, AutoRefresh
if AutoRefresh = 1
{
Inputbox,time,Intervall,Gebe einen Zeitintervall von 1-300 Sekunden an.,,145,160,%InputX%,%InputY%,,,60
If ErrorLevel
GuiControl, PicChat:, AutoRefresh, 0
else
{
if time < 1
time = 60
if time > 300
time = 300
time := time*1000
time := Round(time)
settimer, Refresh, %time%
}
}
else
{
settimer, Refresh, Off
}
Return

Refresh:
Gui, PicChat:Default
GuiControl, -Redraw, UserList
Dateiliste :=
PicChatHome := A_ScriptDir "\PWMPicShare\*.*"
Loop, %PicChatHome%, 2, 1
Dateiliste = %Dateiliste%%A_LoopFileName%`n
LV_Delete()
Loop, parse, Dateiliste, `n
{
If A_LoopField = ; Ignoriert das leere Element am Ende der Liste.
break
LV_Add("", A_LoopField)
}
GuiControl, +Redraw, UserList
Return