Navision doesn't seem to wait WshShell.Run to end

mariacafemariacafe Member Posts: 7
Hi,

When I execute from Navision 4.00
OK:=SHELL(MyApplication,Param1,Param2);
Navision waits 'till MyApplication ends and that's ok for me.

Otherwise, when I execute from Navision 4.00
OK:="Windows Script Host Object".WshShell.Run(myApplicationwithParameters)
I don't have the same behaviour because, during MyApplication execution, I'm able to use Navision... it doesn't seem to wait for MyApplication to end and I don't want this. :-k

Thanks in advance
:wink:
Maria

Comments

  • ArhontisArhontis Member Posts: 667
    More params available...
    Syntax 
          WshShell.Run (strCommand, [intWindowStyle], [bWaitOnReturn]) 
    
    Settings for intWindowStyle. 
    
    0 Hide the window and activate another window. 
    1 Activate and display the window. (restore size and position) Specify this flag when displaying a window for the first time. 
    2 Activate & minimize. 
    3 Activate & maximize. 
    4 Restore. The active window remains active. 
    5 Activate & Restore. 
    6 Minimize & activate the next top-level window in the Z order. 
    7 Minimize. The active window remains active. 
    8 Display the window in its current state. The active window remains active. 
    9 Restore & Activate. Specify this flag when restoring a minimized window. 
    10 Sets the show-state based on the state of the program that started the application.
    
  • mariacafemariacafe Member Posts: 7
    Hi Arhontis and thank you.

    I've just tried with the third parameter and Navision seems to wait, but I'm able to Navigate though the Navigation Pane at the same time.

    I try to explain better:

    I call My External Function from a menuitem, and the code in the "OnPush" Event just works fine: Navision waits My Application to end before execute next statement.
    But meanwhile, I'm free to choose new forms from, for example, the Navigation pane.
    This does'n happen with Navision Shell.

    Thank you
    Maria
  • krikikriki Member, Moderator Posts: 9,118
    mariacafe wrote:
    I try to explain better:

    I call My External Function from a menuitem, and the code in the "OnPush" Event just works fine: Navision waits My Application to end before execute next statement.
    But meanwhile, I'm free to choose new forms from, for example, the Navigation pane.
    This does'n happen with Navision Shell.
    Correct, I also use the function to avoid that Navision asks me a confirmation all the time. And I also noticed that behaviour.
    I didn't find a method yet to block Navision while he is waiting for the Shell.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.