View Full Version : Child Windows
goukilord10
01-13-2008, 06:09 PM
having the ability to create multipes windows for one project in AMS greatly simplifie the work , rather than having to code each window in a separete project.
Darryl
01-14-2008, 09:26 AM
Thank you, this one is currently in our suggestions database for consideration.
clueless
01-14-2008, 03:23 PM
You can allways get the program to run itself with a command line to open up a new window ;)
FoxLeader
01-14-2008, 03:28 PM
You can allways get the program to run itself with a command line to open up a new window ;)
Could you elaborate a bit more?
You can allways get the program to run itself with a command line to open up a new window ;)
Yes, but what about the loading time of the APMS runtime each time you open up this kind of a 'child window'?
clueless
01-14-2008, 06:09 PM
Yeah it wouldnt be suitable for big projects but sometimes having that extra window is worth the 1-2 second wait while it opens.
clueless
01-14-2008, 06:50 PM
Once you work out the orig program location you can get the program to 'run' itself. When you run an AMS program (single exe) the programs location gets passed as the first command line argument. So this code will allways find it.
local ProgramLocation = String.Replace(_CommandLineArgs[Table.Count(_CommandLineArgs)], "SFXSOURCE:", "", false);
(i havent got a clue what the SFXSOURCE is all about.lol).
Then if you wanted to open a second window with a picture in it for example you could write something like this;
local Apicture = "C:\\APic.bmp"
local ProgramLocation = String.Replace(_CommandLineArgs[Table.Count(_CommandLineArgs)], "SFXSOURCE:", "", false);
File.Run(ProgramLocation, Apicture, "", SW_SHOWNORMAL, true);
Then you want to create a blank page at the start of your project and in the 'OnPreload' section in the page code have something like this;
local ComLineLength = Table.Count(_CommandLineArgs);
if ComLineLength == 1 then
Page.Jump("NomalStart");
elseif if ComLineLength == 2 and File.DoesExist(_CommandLineArgs[1]) == true then
DisplayPicture = _CommandLineArgs[1];
Page.Jump("SpecialPage4DisplayingThePicture");
end
goukilord10
01-15-2008, 05:34 PM
its great to hear that this feature may (and hope) is coming to ams :)
Yeah it wouldnt be suitable for big projects but sometimes having that extra window is worth the 1-2 second wait while it opens.
not forgetting the problems if you need constantly passing information from one window to another.
Synchronizing Multiple AMS project is possible but far from simple.
clueless
01-16-2008, 08:09 PM
Yeah i havent found any direct way of passing any info back to the main window. What i tend to do is when i call the child window with the File.Run() command i set it to wait until the program finish's. That way the main window is frozen until the child is shut down. Any info i want to pass back to the main window i dump into a text file that gets read when the main window gains control again. For a while i was using the registry until someone pointed out that not everyone has access.
This method of doing things is a work around and not an ideal sollution.But saying that, i do tend to use it quite a lot.
Have you taken a look at this example?
http://www.indigorose.com/forums/showthread.php?t=15551
clueless
01-17-2008, 02:15 AM
that looks like it will do the job thanx :yes
clueless
01-17-2008, 06:42 PM
Can you only send text commands with this method or could you refference the movie object directly?
can send only the text. But you can use the text you send as a condition to do whatever you want
clueless
01-18-2008, 09:56 AM
Would it be possible to send commands from a VisualBasic program back to AMS in this way if the input handle was passed to it when it was opened?
sure, all you need to do is pass the handle of the input object to the VB app.
clueless
01-18-2008, 11:05 AM
:wow Now that certainly opens up a lot of possibilities. Using this method you could create a kinda pseudo DLL using visual basic without having to resort to using C++. Obviously it wouldnt be anywhere near then speed off a dll writen in C++ and isnt as convenient to setup/use but im still very excited about this, thanks. :yes
clueless
01-18-2008, 01:52 PM
So in answer to goukilord10's original question, heres a small example of using multiple windows from a single program which is based on Worms remote control code.
Note: you will have to compile this to run it.
clueless
01-18-2008, 02:14 PM
Wish there was a delete when posting.lol
Intrigued
05-24-2008, 11:41 AM
Bringing this suggestion back up to the top... as it would really be appreciated.
Just about everyone of my projects would greatly benefit from innate support for a child window or multiples of such.
I now there must be 3,000 suggestions in that database by now.. but if you could look to move that one towards the top... I believe you will see many-a-folk clap there hands here, sob in a moment of joy.
:D
Dermot
05-24-2008, 02:03 PM
This should definetly be top of the list. I am working on two large apps right now that would be so so much easier if we had child windows. I really hope this will be added soon. If this was the only new feature with got for a year, I would be very happy.
RizlaUK
05-24-2008, 08:53 PM
http://blog.spokanetogo.com/blogs/wired/begging.gif
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.