is it possible to show all exe files in the folder on menubar ?
Professional Software Development Tools
is it possible to show all exe files in the folder on menubar ?
Last edited by GoOgLe; 03-18-2008 at 01:30 PM.
at design time or runtime?
I don't have ams -- but reading the docs; it looks like something like this might work:
100% untested, I don't have ams -- and suf7 doesn't have a menubar.Code:local cFolder = Dialog.FolderBrowse("Which folder to fill from?",_SourceFolder); if Folder.DoesExist( cFolder ) then local tFiles = File.Find(cFolder,"*.exe"); if Table.Count( tFiles ) > 0 then local x = 0; local tMenu= Application.GetMenu(); tMenu.ID=200; tMenu.Text="Available EXE's"; tMenu.Enabled = true; tMenu.Checked = false; tMenu.SubMenu={}; for x=1,Table.Count(tFiles) do tMenu.SubMenu[x]={}; tMenu.SubMenu[x].Text= tFiles[x]; tMenu.SubMenu[x].ID = 200+x; tMenu.SubMenu[x].Checked = false; tMenu.SubMenu[x].Enabled=true; end Application.SetLastError(0); Application.SetMenu( tMenu ); local nErr = Application.GetLastError(); if nErr > 0 then Dialog.Message("Error",_tblErrorMessages[ nErr ] ); end else Dialog.Message("Oops","No files found"); end end
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
thanks for reply jassing
on preload but i got error
![]()
Looks like this line is erroring out:
local tMenu= Application.GetMenu();
Try changing it to
local tMenu={};
or better; find out why GetMenu is failing...
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
when i choose desktop i get error but when i choose my documents no error but no item on menu bar...
What error do you get? I would think that no exe's would be in the desktop or my documents...
Like I said; 100% untested; I just did that from reading the documents. I'll request a demo download and try it -- I probably won't get the download until today; but I'm leaving for the weekend early tomorrow... so might not be until monday or tuesday.
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
thanks alot jassin
i think eroor i get on desktop is because i have no exe file but in my documents i have exe file but i cant write to menubar
What error are you getting?
The fact that it doesn't work doesn't suprise me since I've never worked with menu bars; but errors? I can't find anything that would generate an error...
My repairs just took a turn for the worst, and I have to head off island to pick up some materials. This will push back when I can get to this -- I will put in for a eval donwload request before I leave.
-josh
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
this didnt work... !!!
Code:local cFolder = Dialog.FolderBrowse("Which folder to fill from?",_SourceFolder); if Folder.DoesExist( cFolder ) then local tFiles = File.Find(cFolder,"*.exe"); if Table.Count( tFiles ) > 0 then local x = 0; local tMenu={}; tMenu.ID=200; tMenu.Text="Available EXE's"; tMenu.Enabled = true; tMenu.Checked = false; tMenu.SubMenu={}; for x=1,Table.Count(tFiles) do tMenu.SubMenu[x]={}; tMenu.SubMenu[x].Text= tFiles[x]; tMenu.SubMenu[x].ID = 200+x; tMenu.SubMenu[x].Checked = false; tMenu.SubMenu[x].Enabled=true; end Application.SetLastError(0); Application.SetMenu( tMenu ); local nErr = Application.GetLastError(); if nErr > 0 then Dialog.Message("Error",_tblErrorMessages[ nErr ] ); end else Dialog.Message("Oops","No files found"); end end
Yes you've said that; which line is giving you an ERROR and what is the error?
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
i dont get error but i dont files listed either !!!
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
You're lucky, I had to pay for it; but there was wifi at the place I'm at...
This works for me... hope it does for you.
Code:tblMenu = Application.GetMenu(); local nNewitem = Table.Count(tblMenu)+1; tblMenu[nNewitem] ={}; tblMenu[nNewitem].Text = "&Available Files"; tblMenu[nNewitem].ID = 1000; tblMenu[nNewitem].Checked = false; tblMenu[nNewitem].Enabled = true; tblMenu[nNewitem].SubMenu = {}; local tFiles = File.Find( _SystemFolder, "*.exe"); local x = 0; for x = 1,Table.Count(tFiles) do tblMenu[nNewitem].SubMenu[x] = {}; tblMenu[nNewitem].SubMenu[x].Text = tFiles[x]; tblMenu[nNewitem].SubMenu[x].ID = 1000+x; tblMenu[nNewitem].SubMenu[x].Checked = false; tblMenu[nNewitem].SubMenu[x].Enabled = true; end Application.SetMenu(tblMenu);
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
jassing thanks alot alot for answering
but i have one more problem with it... if i the folder doesnt include any exe file i get that error !!!
![]()
thanks jassing
@jackdaniels
i would say the same thing;
perfect code but if no exe in folder u get error