PDA

View Full Version : what is wrong with this code ? help plz



jack
04-02-2009, 10:08 AM
hi there


tbl_reg = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
for j,k in tbl_reg do
ListBox.AddItem("ListBox1", k, "");
end

this code is working , but the problem is , if there is no application in startup it will appear

a window error

i want to make this code with no window error if there is no application on startup

i should write something ...can you correct it for me please

thank you

the picture is attached

jackdaniels
04-02-2009, 10:15 AM
Try like that


tbl_reg = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
if tbl_reg ~= "" then
for j,k in tbl_reg do
ListBox.AddItem("ListBox1", k, "");
end
end

jack
04-02-2009, 10:20 AM
thank you jackdaniels ...you are the best