Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

Window order problem

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Window order problem

    when I lounch a program (file run) after a few seconds the window containing that program goes behind AMS window (I use Kiosk - but not "always in top option")??????

  • #2
    can you post your project so that we can have a look and try to help you?

    Yossi

    Comment


    • #3
      Originally posted by yosik
      can you post your project so that we can have a look and try to help you?

      Yossi
      sorry, no
      other solution????

      Comment


      • #4
        does it do the same if you don't use kiosk..just to check it is not something else,perhaps something the launched program is doing..

        Comment


        • #5
          Originally posted by Eagle
          does it do the same if you don't use kiosk..just to check it is not something else,perhaps something the launched program is doing..
          yes and even if I open a html page with File.OpenURL after the page is loaded the AMS window goes on top...
          Last edited by adivin; 10-30-2005, 09:27 AM.

          Comment


          • #6
            what window mode paramater are you setting for file.run(also waitforreturn true\false) and window mode for file.open. Does seem strange it would be doing this when Not running in kiosk mode. You are of course not doing any
            z order coding yourself anywhere ? Any Window 'set mask' stuff ?

            Comment


            • #7
              Originally posted by Eagle
              what window mode paramater are you setting for file.run(also waitforreturn true\false) and window mode for file.open. Does seem strange it would be doing this when Not running in kiosk mode. You are of course not doing any
              z order coding yourself anywhere ? Any Window 'set mask' stuff ?
              no 'set mask' , waitforreturn true\false - I tryed both, window mode paramater - Itryed all

              Comment


              • #8
                This may help... I am using the .dll I recently compiled, and shared here, to achieve what I believe you need to have done in your project.

                Here are the files:


                Project (.apz)
                http://www.amsuser.com/ams/examples/...-Intrigued.apz

                Example (.exe)
                http://www.amsuser.com/ams/examples/...-Intrigued.exe

                Here is the code chunks from the On Show and On Timer event areas:

                On Show
                Code:
                File.Run(_SystemFolder.."\\notepad.exe", "", "", SW_SHOWNORMAL)
                
                Application.Sleep(1000)
                
                dll_ActiveWinHandle = DLL.CallFunction("AutoPlay\\Docs\\DLLActiveWindow.dll", "ACTIVEWINDOWHANDLE", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
                
                Page.StartTimer(500)

                On Timer

                Code:
                Window.SetOrder(dll_ActiveWinHandle,  HWND_TOPMOST)
                Intrigued

                Comment


                • #9
                  Originally posted by Intrigued
                  This may help... I am using the .dll I recently compiled, and shared here, to achieve what I believe you need to have done in your project.

                  Here are the files:


                  Project (.apz)
                  http://www.amsuser.com/ams/examples/...-Intrigued.apz

                  Example (.exe)
                  http://www.amsuser.com/ams/examples/...-Intrigued.exe

                  Here is the code chunks from the On Show and On Timer event areas:

                  On Show
                  Code:
                  File.Run(_SystemFolder.."\\notepad.exe", "", "", SW_SHOWNORMAL)
                  
                  Application.Sleep(1000)
                  
                  dll_ActiveWinHandle = DLL.CallFunction("AutoPlay\\Docs\\DLLActiveWindow.dll", "ACTIVEWINDOWHANDLE", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
                  
                  Page.StartTimer(500)

                  On Timer

                  Code:
                  Window.SetOrder(dll_ActiveWinHandle,  HWND_TOPMOST)
                  it doesn't work! (only the .exe) but not the .apz: abnormal program termination
                  and I want to lounch the program by clicking on a Button on page and not on Page.On Show

                  Comment


                  • #10
                    I just downloaded the file I posted (.apz) and opened it and it works for me. I'm not sure in your case, other than you need to have AMS 6 (not 5) to open such. You may want to reinstalled AMS 6 if you do have it. Just a thought.

                    And as for the Button... just copy and past the On Show code into the On Click event (area) of said Button object.

                    :yes
                    Last edited by Intrigued; 10-31-2005, 05:20 PM.
                    Intrigued

                    Comment


                    • #11
                      This might solve my problem too, but...??


                      Ok - I too have an issue with the AMS Kiosk application popping back in front of the other applications that I am running - but in my case, it is usually because the touch screen has just a scrap of the kiosk menu showing and the user hits it in a moving ambulance (our kiosk program runs on a toughbook in our ambulances).

                      What I need is a way to get the Kiosk Application to recognize the fact that an application is already running, and simply revert back to that 'open' incidence of the application if the button is pressed again.

                      Can you help with that?

                      Comment


                      • #12
                        Have you tryed useing:
                        Code:
                        Window.SetOrder(Application.GetWndHandle(), HWND_BOTTOM);
                        after your filerun command


                        just a tought

                        What I need is a way to get the Kiosk Application to recognize the fact that an application is already running, and simply revert back to that 'open' incidence of the application if the button is pressed again.

                        try this: (example useing notepad)

                        Code:
                        IsRun = File.IsInUse(_WindowsFolder.."\\NOTEPAD.exe");
                        if IsRun then
                        	windows = Window.EnumerateTitles();
                        	window_name = "Notepad";
                        	for handle, title in windows do
                        	    result = String.Find(title, window_name, 1, false);
                        	    if (result ~= -1) then
                        	        Window.SetOrder(handle,  HWND_TOP);
                        	    end
                        	end
                        else
                        	result = File.Run(_WindowsFolder.."\\NOTEPAD.exe", "", "", SW_SHOWNORMAL, false);
                        end
                        Last edited by RizlaUK; 06-22-2007, 03:05 PM.
                        Embrace change in your life, you never know, it could all work out for the best

                        Comment


                        • #13
                          heres the same code in function form (for ease of use)


                          place this in global functions
                          Code:
                          function CheckRunningApp(Path, Title)
                          	IsRun = File.IsInUse(Path);
                          	if IsRun then
                          		windows = Window.EnumerateTitles();
                          		for handle, title in windows do
                          		    result = String.Find(title, Title, 1, false);
                          		    if (result ~= -1) then
                          		        Window.SetOrder(handle,  HWND_TOP);
                          		    end
                          		end
                          	else
                          		result = File.Run(Path, "", "", SW_SHOWNORMAL, false);
                          	end
                          end
                          and call the function from your button with the path as the 1st argument and the title as the 2nd, this way if you have more than one app to run you can use the same function
                          Code:
                          CheckRunningApp(_WindowsFolder.."\\NOTEPAD.exe", "Notepad")
                          Embrace change in your life, you never know, it could all work out for the best

                          Comment


                          • #14
                            Perfect!!! (almost!)

                            Seems to work, but I need to add command line arguments to the executable to enable the GPS option... where do I fit them in? My former button command looked like this:

                            result = File.Run("C:\\Program Files\\MOH Locator Application\\MOH_Locator.exe", "gps", "", SW_MAXIMIZE, false);

                            I placed the global variable script on the application and then changed the button to this:

                            result = CheckRunningApp(_ProgramFilesFolder.."\\MOH Locator Application\\MOH_Locator.exe", "MOH Locator Application")

                            But I need it to have the "gps" command line argument?

                            Comment


                            • #15
                              Also see if you can confirm this on multiple systems. I have had cases like this where it is totally system specific to your development machine.

                              Just a thought

                              Adam.

                              Comment

                              Working...
                              X