(SOLVED) - Need a simple example of UserMain pop-up window

I need a simple working example of using UserMain.OnDisplayWindow and UserMain.OnCloseWindow without user interaction…

In other words, I would like to “popup” a window that has an animated SEARCHING.gif image and then close this window automatically using OnCloseWindow function when the search is complete.

I can not figure out the exo_runhescriptcom attributes correctly for this…

exo_runhescriptcom ("UserMain.OnDisplayWindow", "search: searching.html");
exo_runhescriptcom ("UserMain.OnDisplayWindow", "searching.html");  

None of the above works for me…

I have a file called searching.html that is copied to the HEPubTempPath perfectly, but do not know how to execute it in a pop-up using runhescriptcom???

Anybody got a working example of OnDisplayWindow and OnCloseWindow?

SysAdm

exo_runhescriptcom ("UserMain.OnDisplayWindow", "search: searching.html");

This will not work because you are calling an “event” that is normally triggered by the application itself.
http://www.exeoutput.com/help/popupwindows.htm contains several examples that you could use.
For instance, copy/paste this code in your UserMain script:

procedure ShowFirstPopup;
begin
 ShowPopup("mypopup", "popup1.htm", 400, 300, 50, 25, false, false);
end; 

and

exo_runhescriptcom ("UserMain.ShowFirstPopup", "");

should then work.
Create another procedure to close the popup window.

Thank you for the link… that worked perfectly… :stuck_out_tongue:

SysAdm