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

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

Postby ukoenig » Thu Nov 20, 2008 4:06 pm

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby James Bott » Thu Nov 20, 2008 5:05 pm

Uwe,

Maybe this will help.

James

Code: Select all  Expand view
#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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » Thu Nov 20, 2008 7:21 pm

Uwe,

You can also use:

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Hide DOS-window

Postby ukoenig » Thu Nov 20, 2008 7:41 pm

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  Expand view
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Rochinha » Fri Nov 21, 2008 1:48 pm

Friend,

Use my solution:
Code: Select all  Expand view
/*
*
* 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
Rochinha
 
Posts: 310
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests