注册 登录
编程论坛 VFP论坛

请教win7打开软件命令这样为什么不能打开来

laibinhua 发布于 2023-12-15 13:30, 415 次点击
请教win7打开软件命令这样为什么不能打开来
run("C:\Windows\System32\osk.exe")
6 回复
#2
吹水佬2023-12-15 13:40
run是什么函数?

#3
laibinhua2023-12-15 14:13
回复 2楼 吹水佬
请问,有什么好方法可以调出软键盘吗?
RUN  "C:\Windows\System32\osk.exe" 也调不出来,怪事

[此贴子已经被作者于2023-12-15 14:15编辑过]

#4
nbwww2023-12-15 19:14
试一下 这样打开

DECLARE INTEGER ShellExecute IN shell32 INTEGER hWindow, STRING lpOperation, STRING lpFile, STRING lpParameters, STRING lpDirectory, INTEGER nShowCmd
  = ShellExecute(0, "open", "osk.exe", "", "", 1)
  CLEAR DLLS
#5
laibinhua2023-12-15 23:11
回复 4楼 nbwww
你好,试了下也不行
#6
foxfans2023-12-16 00:20
CLEAR
Declare long ShellExecute IN "shell32" LONG,STRING,STRING,STRING,STRING,LONG
Declare long Wow64DisableWow64FsRedirection IN "kernel32" long @
Declare long Wow64RevertWow64FsRedirection IN "kernel32" long
Declare long LoadLibrary IN "kernel32" string
Declare long FreeLibrary IN "kernel32" long
Declare long GetProcAddress IN "kernel32" long,string
*!*  32位进程在64位系统中shell要预判断,64位进程不用考虑
IF is64()==1
   LOCAL fsRedirect
   STORE 0 TO m.fsRedirect
   m.fsRedirect=Wow64DisableWow64FsRedirection(@m.fsRedirect)
   IF m.fsRedirect>0  
      ShellExecute(0,"open","osk.exe","","c:\windows\system32",1)
      Wow64RevertWow64FsRedirection(m.fsRedirect)
   ENDIF
ENDIF

FUNCTION is64() as long
    LOCAL hMod,lPA1,lPA2
    STORE 0 TO m.hMod,m.lPA1,m.lPA2
    m.hMod = LoadLibrary("Kernel32")
    If m.hMod >0
        m.lPA1 = GetProcAddress(m.hMod, "Wow64DisableWow64FsRedirection")
        m.lPA2 = GetProcAddress(m.hMod, "Wow64RevertWow64FsRedirection")
        FreeLibrary(m.hMod)
    ENDIF
    IF m.lPA1>0 AND m.lPA2>0
       RETURN 1
    ELSE
       RETURN 0
    ENDIF
ENDFUNC

[此贴子已经被作者于2023-12-16 00:33编辑过]

#7
asdf_1230002023-12-19 14:28
学习学习!
1