Options

Running a shell application minimized

GetteGette Member Posts: 19
I have extracted xml files from navision to a specific folder.
A form based timer runs the SHELL function which calls a .NET console application and gives 2 parameters which are filled in dynamically.

I've got 2 problems with this solution:

1. When the shell executes the console application I see the DOS box. The user may not see this. Is there a possibility to hide this.

2. Because the parameters of the application are dynamically filled in, each time the shell executes it askes if the application can be trusted or not. Also this I want to hide from the user.

I don't know if it is possible to solve these 2 issues but any comments are welcome.

Kind regards,

Geert

Comments

  • Options
    pdjpdj Member Posts: 643
    Regarding no. 2 you should take a look at the Navision 4.0 late changes document. You can find it in the updated release document on Partnerguide.
    In short: You need to store the path and filename to the .exe file in a text constant to avoid the warning...
    Regards
    Peter
  • Options
    g_dreyerg_dreyer Member Posts: 123
    Not the ideal solution, but give it a go...

    You can try calling your console from a batch file and add the following to the batch file....
    @ECHO OFF
    <<execute your call to the console here>>
    cls

    So by the way you can either dynamically create your batch file and delete it after you have executed it, or call it with parameters.

    Regards,
    Gus
  • Options
    Joe_LittleJoe_Little Member Posts: 45
    You can use (VB6 or your favorite) to create the following and compile it as a dll. You can then use the dll as an ocx type control in Navision to get a shell command that doesn't have the black window flash. It's kind of hokey, but it is the only way that I know around this.

    Public Function ShellCmd(CmdStr As String) As Integer

    ShellCmd = Shell(CmdStr)

    End Function
  • Options
    toluatolua Member Posts: 1
    Hi

    I had the same problem, and the solution for me, was to move the code to a GUI project, and substitute the first line in the Main method with my origional startup line. I see no box, frame or task at the bottom with this hack.
Sign In or Register to comment.