FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Possible, to hide a DOS-Box running a BAT- or SCRIPT-file ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Possible, to hide a DOS-Box running a BAT- or SCRIPT-file ?
Posted: Thu Nov 20, 2008 04: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:

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.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Possible, to hide a DOS-Box running a BAT- or SCRIPT-file ?
Posted: Thu Nov 20, 2008 05:05 PM
Uwe,

Maybe this will help.

James

#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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Possible, to hide a DOS-Box running a BAT- or SCRIPT-file ?
Posted: Thu Nov 20, 2008 07:21 PM

Uwe,

You can also use:

WinExec( "mybat.bat", SW_HIDE )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Hide DOS-window
Posted: Thu Nov 20, 2008 07: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.

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 :-)
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.
Posts: 310
Joined: Sun Jan 08, 2006 10:09 PM
Possible, to hide a DOS-Box running a BAT- or SCRIPT-file ?
Posted: Fri Nov 21, 2008 01:48 PM
Friend,

Use my solution:
/*
 *
 * 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

Continue the discussion