从澄清隐藏cmd窗口 [英] Hide cmd window from clarion
问题描述
有没有隐藏在Clarion 8的cmd窗口?
我运行xcopy来复制在应用程序的字段中定义的文件,看起来像这样: p>
Run('Xcopy'& Clip(Loc:Pathfrom)&''& loc:Pathto')
IE运行('C:\Temp\Temp.tps c:\Bakup \')
也许有一个cmd或clarion命令不显示黑色
p>我明白你为什么不想使用内置的COPY命令,因为你应该需要找到您要复制的文件夹下的每个文件(也可能是文件夹)。如果我是你,我将使用正确的工具来完成它:Windows API和隐藏窗口。
PROGRAM
SW_HIDE EQUATE(0)
SW_SHOW EQUATE(5)
MAP
MODULE('SHELL')
ShellExecute(hWnd,|
* CSTRING操作,|
* CSTRING PathAndFileName,|
* CSTRING CommandLineParameters,|
* CSTRING DefaultDirectory,|
LONG ShowCommandCode)
hInstance,|
PASCAL,RAW,NAME('ShellExecuteA')
END
END
LOC:OPN CSTRING(50)
LOC:NSTR CSTRING b $ b LOC:CMD CSTRING(255)
LOC:DD CSTRING(255)
CODE
LOC:OPN ='open'
LOC:NSTR = C:\Temp\Temp.tps c:\Bakup \'
LOC:DD ='C:\ Temp'
LOC:Cmd ='XCOPY'
ShellExecute 0 {PROP:Handle},LOC:OPN,LOC:CMD,LOC:NSTR,LOC:DD,SW_HIDE)
$ b b
此代码尚未经过测试。
Is there anyway to hide a cmd window in Clarion 8?
I run xcopy to copy files defined in fields an application so it looks something like this:
Run('Xcopy '&Clip(Loc:Pathfrom)&' '&loc:Pathto')
I.E. Run(' C:\Temp\Temp.tps c:\Bakup\')
Maybe there is a cmd or clarion command not to show the black window but only do the copying?
Thank you very much.
I understand why you don't want to use the builtin COPY command as you should need to find every single file (and possibly folder too) under that folder you want to copy. If I were you I'll use the proper tools to do it: Windows API and hide the window.
PROGRAM
SW_HIDE EQUATE(0)
SW_SHOW EQUATE(5)
MAP
MODULE('SHELL')
ShellExecute(hWnd,|
*CSTRING Operation,|
*CSTRING PathAndFileName,|
*CSTRING CommandLineParameters,|
*CSTRING DefaultDirectory,|
LONG ShowCommandCode),|
hInstance,|
PASCAL,RAW,NAME('ShellExecuteA')
END
END
LOC:OPN CSTRING(50)
LOC:NSTR CSTRING(100
LOC:CMD CSTRING(255)
LOC:DD CSTRING(255)
CODE
LOC:OPN = 'open'
LOC:NSTR = 'C:\Temp\Temp.tps c:\Bakup\'
LOC:DD = 'C:\Temp'
LOC:Cmd = 'XCOPY'
ShellExecute(0{PROP:Handle},LOC:OPN,LOC:CMD,LOC:NSTR,LOC:DD,SW_HIDE)
This code has not been tested.
这篇关于从澄清隐藏cmd窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!