Possible, to hide a DOS-Box running a BAT- or SCRIPT-file ?

Post Reply
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Possible, to hide a DOS-Box running a BAT- or SCRIPT-file ?

Post by ukoenig »

Hello,

When running a batch- or script-file, you will see a DOS-window on screen.
Is it possible to hide this ?

Regards
Uwe :lol:
Last edited by ukoenig on Thu Nov 20, 2008 9:24 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Uwe,

Maybe this will help.

James

Code: Select all

#include "Fivewin.ch"


#define SW_HIDE		    0
#define SW_SHOWNORMAL	    1
#define SW_NORMAL	    1
#define SW_SHOWMINIMIZED    2
#define SW_SHOWMAXIMIZED    3
#define SW_MAXIMIZE	    3
#define SW_SHOWNOACTIVATE   4
#define SW_SHOW		    5
#define SW_MINIMIZE	    6
#define SW_SHOWMINNOACTIVE  7
#define SW_SHOWNA	    8
#define SW_RESTORE          9


FUNCTION MAIN()

  SHELLEXECUTE( 0, "open", "http://www.mysite.com", 0, 0, SW_NORMAL )

RETURN NIL
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Uwe,

You can also use:

WinExec( "mybat.bat", SW_HIDE )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Hide DOS-window

Post by ukoenig »

Thank You very much Antonio, James

I changed the source this way :

Save a JPG-file to BMP with new size :
(2)->EXTENSION) is the desired destination-format.
The format of the original file is automatic detected.

Code: Select all

newFORMAT := c_Path +"\image\" + cIMAGE 

cCONVERT := "NCONVERT -quiet -out " + ALLTRIM( (2)->EXTENSION) + " -resize " + ;
ALLTRIM(str(nWidth)) + " " + ALLTRIM(str(nHeight)) + " &newFORMAT "

WINEXEC ( "&cCONVERT", 0 )
It works great. The DOS-box is hidden !

The next step will be a script-editor, because i don't know,
what the user wants to do with the selected image.

1. select the image from the project-database.
2. open the convert-dialog and choose the export-format and size.
3. open the script-browser to choose what to do with the image.

To convert and resize is just a small selection of the things
are possible. Adjust Brightness, flip and rotate, changing colors ...
everything is possible.

All what we need to do is : WINEXEC ( "&cCONVERT", 0 )
cCONVERT will be the script we choose from the database.

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

Post by Rochinha »

Friend,

Use my solution:

Code: Select all

/*
 *
 * TOLEAuto and Activex
 * Jose Carlos da Rocha
 *
 */
#include "FiveWin.ch"

function Main()

   local fn := Array(5)
   oCopyImage := TOleAuto():New( "CopyImage.CopyImage.1" )

   ep := cFilePath( GetModuleFileName( GetInstance() ) )
   
   fn[1] = "wmf"
   fn[2] = "bmp"
   fn[3] = "png"
   fn[4] = "jpeg"
   fn[5] = "wbmp"
   
   For i = 1 To 5
      oCopyImage:Type := i
      oCopyImage:CopyFile(ep + "coins.gif" , ep + "coins75." + fn[i], 50, 50)
      oCopyImage:CopyFile(ep + "eckler.bmp", ep + "eckler120." + fn[i], 120, 120)
   Next

   return nil
http://www.5volution.com/forum/CopyImage.zip
Post Reply