PDA

View Full Version : Stuck on the easiest thing



CtrlAltDel
02-18-2004, 12:37 AM
Hi all,
I know this is really a stupid question but i've been try reading everywhere and trying it but it doesnt seem to work.

I am creating a start of application so I can include my often used programs and sort of get away with the cluttered shortcuts I have on desktop.

So, I am having trouble opening applications.
For instance I am trying to open my ZoneAlarm Firewall.
The path to it is:
C:\Program Files\Zone Labs\ZoneAlarm\zonealarm.exe

The code I am using on the action of the button is:
File.Run("AutoPlay\\Docs\\zonealarm.exe", "C:\\Program Files\\Zone Labs\\Zone Labs\\ZoneAlarm\\zonealarm.exe", "", SW_SHOWNORMAL, false);

But nothing happens, initially I had tried

File.Run( "C:\\Program Files\\Zone Labs\\Zone Labs\\ZoneAlarm\\zonealarm.exe", "", "", SW_SHOWNORMAL, false);

None of them work. :wah

Any help is greatly appreciated.

CWRIGHT
02-18-2004, 02:15 AM
Hi CtrlAltDel,

The initial way you were trying to do this was correct. Perhaps there should be just one \\Zone Labs in the path?

If you put the following code under your File.Run action, it will give you a better indication of why this is failing:


error = Application.GetLastError();
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error]);
end



Hope that helps.

CtrlAltDel
02-18-2004, 03:51 PM
Thanks for replying:)

I mistyped here, its only one Zone Labs. The difference between second and first one is as you can see that i gave the working folder in the first one and not the second one.
The error i get is "File execution failed." But I am sure the path is fine. I tried other stand alone executables as well. None worked :wah

Thanks for any help,
CtrlAltDel

Brett
02-18-2004, 04:05 PM
Instead of:


File.Run( "C:\\Program Files\\Zone Labs\\Zone Labs\\ZoneAlarm\\zonealarm.exe", "", "", SW_SHOWNORMAL, false);

Use:


File.Open( "C:\\Program Files\\Zone Labs\\Zone Labs\\ZoneAlarm\\zonealarm.exe);

or, if you need a working folder:


File.Run( "C:\\Program Files\\Zone Labs\\Zone Labs\\ZoneAlarm\\zonealarm.exe", "C:\\Program Files\\Zone Labs\\Zone Labs\\ZoneAlarm\\", "", SW_SHOWNORMAL, false);

CtrlAltDel
02-18-2004, 08:06 PM
Thanks for replying Brett, but it still doesnt work. You forgot the quotes in the second code.

I still get File Execution failed error :wah

I even had just zonealarm.exe or zonealarm as file name and full path in working folder. No luck same error.

I thought this was the easiest thing to do :confused:

CtrlAltDel
02-18-2004, 08:37 PM
Edit: Nevermind fixed it::D Dont laugh but i had the wrong file name. ::D :D
Its zlclient.exe not zonealarm.exe. Zonealarm.exe is not the firewall interface.

THANKS A LOT EVERYONE! You've been great!
-
CtrlAltDel

Corey
02-18-2004, 08:40 PM
::;

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

TJ_Tigger
02-18-2004, 10:30 PM
D':oh

CtrlAltDel
02-19-2004, 05:40 PM
I am stuck on one more thing. I am creating a Listbox so that I have few programs in it so when I double click the program opens. I was trying to use someone's else's template to learn first.

This is OnSelect Code:

tSelected = ListBox.GetSelected("LB_Files");

if Table.Count(tSelected) == 1 then
sFilePath = "C:\\Program Files\\Nattyware\\Pixie\\pixie.exe";
sText = ListBox.GetItemText("LB_Files", tSelected[1]);
sData = ListBox.GetItemData("LB_Files", tSelected[1]);
Paragraph.SetText("P_Status", "Text: " ..
sText .. "\r\n" .. "Data: " .. sData);
else if Table.Count(tSelected) == 2 then
sFilePath = "C:\\Program Files\\Microsoft Image Composer\\IMGCOMP.exe";
sText = ListBox.GetItemText("LB_Files", tSelected[2]);
sData = ListBox.GetItemData("LB_Files", tSelected[2]);
Paragraph.SetText("P_Status", "Text: " .. sText .. "\r\n" .. "Data: " .. sData);


else if Table.Count(tSelected) == 3 then
sFilePath = "C:\\Program Files\\Microangelo\\studio.exe";
-- Get the selected item's 'text'
sText = ListBox.GetItemText("LB_Files", tSelected[3]);
-- Get the selected item's 'data'
sData = ListBox.GetItemData("LB_Files", tSelected[3]);
-- Output retrieved information to our 'status' paragraph
Paragraph.SetText("P_Status", "Text: " .. sText .. "\r\n" .. "Data: " .. sData);
-- There are more than one items selected, display message
--else
Paragraph.SetText("P_Status", "Multiple Items Selected");

else if Table.Count(tSelected) == 4 then
sFilePath = "C:\\Program Files\\FirmTools\\Album Creator\\ac.exe";
-- Get the selected item's 'text'
sText = ListBox.GetItemText("LB_Files", tSelected[4]);
-- Get the selected item's 'data'
sData = ListBox.GetItemData("LB_Files", tSelected[4]);
-- Output retrieved information to our 'status' paragraph
Paragraph.SetText("P_Status", "Text: " .. sText .. "\r\n" .. "Data: " .. sData);

-- There are more than one items selected, display message
else
Paragraph.SetText("P_Status", "Multiple Items Selected");
end
end
end
end
-----------------
Now Double click code:

tSelected = ListBox.GetSelected("LB_Files");

if tSelected then
for nTableIndex, nListBoxIndex in tSelected do
-- Open the selected file in the default application/viewer
File.Open(sFilePath, "", SW_SHOWNORMAL);
end
end


---------------

Whats happening is, if i select something, the data associated with it is being displayed. But if i double click it my sFilePath has the same value as the first one basically showing pixie application for each selection.
Any help will be appreciated!

Thanks

CtrlAltDel
02-20-2004, 03:54 PM
Any help would be appreciated :wah