当前位置: 代码迷 >> PB >> 小弟我在按键中调用一个WORD不成功
  详细解决方案

小弟我在按键中调用一个WORD不成功

热度:36   发布时间:2016-04-29 06:41:13.0
我在按键中调用一个WORD不成功
long ll_result
string ls_operation,ls_Parameters,ls_file


ls_Operation = "open"
ls_Parameters = ""
ls_file ="aa.doc"



ll_result = ShellExecute("",ls_Operation,ls_file, ls_Parameters,"d:\",9)

ShellExecute("0","open","calc.exe","","",0)


我在按键中调用一个WORD不成功

------解决方案--------------------
方法写的不对吧,请参考以下代码

string    ls_oper, ls_path, ls_parm
integer  li_value, li_style

SetNull(ls_Parm)
ls_oper = "Open"
ls_path = 'c:\1.txt'
li_style= 1 //Normal = 1, Minimize = 2, Maximize =3
li_value = ShellExecuteA(Handle(This), ls_oper, ls_path, ls_parm, ls_parm, li_style)

//PB10声明
Function ulong ShellExecuteA(ulong hwnd, ref string lpOperation, ref string lpFile, ref string lpParameters, ref string lpDirectory, int iShowCmd) Library "Shell32.DLL" ALIAS FOR "ShellExecuteA;ANSI"

//PB7,8,9声明
Function ulong ShellExecuteA(ulong hwnd, ref string lpOperation, ref string lpFile, ref string lpParameters, ref string lpDirectory, int iShowCmd) Library "Shell32.DLL" ALIAS FOR "ShellExecuteA"
  相关解决方案