Jump to content

Listboxdan Program Exe Si Çalıştırmak


kapucu1971
 Share

Recommended Posts

listboxun on double-click evresi bu şekilde


tSecilen = ListBox.GetSelected(this)
if tSecilen then
sData = ListBox.GetItemData("Programlar", tSecilen[1])
result = File.Run("programlar" ......
end

listboxda seçili program exe sini çalıştırmak istiyorum veri listboxa geliyor tıkladığımda exe çalışmıyor kodumda eksik olan yeri tamamlayabilirmisiniz Edited by kapucu1971
Link to comment
Share on other sites

Page On Show kodları:

[code]ListBox.DeleteItem("ListBox1", -1) -- listboxı sıfırla

-- docs klasorundeki exe leri listele, dosya yollarını ListBox ItemData'ya depola, dosya isimlerini ListBox'a yazdır
tDosyalar = File.Find("AutoPlay\\Docs", "*.exe", false, false, nil, nil) -- exe dosyalarını bul
if tDosyalar then -- eğer klasör boş değilse
for i,v in pairs(tDosyalar) do
sDosyaIsmi = String.SplitPath(v).Filename
sDosyaYolu = v
ListBox.AddItem("ListBox1", sDosyaIsmi, sDosyaYolu)
end
end[/code]

ListBox On DoubleClick kodları:

[code]tSecilen = ListBox.GetSelected("ListBox1")
if tSecilen ~= nil then
sDosyaYolu = ListBox.GetItemData("ListBox1", tSecilen[1])
File.Run(sDosyaYolu, "", "AutoPlay\\Docs", SW_SHOWNORMAL, false)
end[/code]

Link to comment
Share on other sites

  • 4 ay sonra...

[quote name='KintaRo' timestamp='1341392995' post='1218478']
Page On Show kodları:

[code]ListBox.DeleteItem("ListBox1", -1) -- listboxı sıfırla

-- docs klasorundeki exe leri listele, dosya yollarını ListBox ItemData'ya depola, dosya isimlerini ListBox'a yazdır
tDosyalar = File.Find("AutoPlay\\Docs", "*.exe", false, false, nil, nil) -- exe dosyalarını bul
if tDosyalar then -- eğer klasör boş değilse
for i,v in pairs(tDosyalar) do
sDosyaIsmi = String.SplitPath(v).Filename
sDosyaYolu = v
ListBox.AddItem("ListBox1", sDosyaIsmi, sDosyaYolu)
end
end[/code]

ListBox On DoubleClick kodları:

[code]tSecilen = ListBox.GetSelected("ListBox1")
if tSecilen ~= nil then
sDosyaYolu = ListBox.GetItemData("ListBox1", tSecilen[1])
File.Run(sDosyaYolu, "", "AutoPlay\\Docs", SW_SHOWNORMAL, false)
end[/code]
[/quote]

peki, Treelist e göre nasıl uyarlarız ?

Link to comment
Share on other sites

Page On Show:

[CODE]
TreeList.AddColumn("Plugin1", "program adı", 200)
TreeList.ClearRows("Plugin1")
-- docs klasorundeki exe leri listele, dosya yollarını ListBox ItemData'ya depola, dosya isimlerini ListBox'a yazdır
tDosyalar = File.Find("AutoPlay\\Docs", "*.exe", false, false, nil, nil) -- exe dosyalarını bul
if tDosyalar then -- eğer klasör boş değilse
for i,v in pairs(tDosyalar) do
sDosyaIsmi = String.SplitPath(v).Filename
TreeList.AddRow("Plugin1", sDosyaIsmi, nil, 0, nil)
end
end
[/CODE]

Treelist OnDoubleClick

[CODE]nSecilen = TreeList.GetSelected("Plugin1")
if nSecilen ~= -1 then
sDosyaYolu = _SourceFolder .. "\\Autoplay\\Docs\\" .. TreeList.GetCellText("Plugin1", nSecilen, 0)
File.Run(sDosyaYolu, "", "AutoPlay\\Docs", SW_SHOWNORMAL, false)
end
[/CODE]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...