半芯竹 发表于 2012-2-6 14:29:59

本帖最后由 半芯竹 于 2012-2-6 14:35 编辑

回复 15# kemyliu


    Case $Button1
                        _CoProc(test1(),$arry)
                                                _CoProc(test2(),$arry)
你不也是这样调用的吗?为什么你还是这么嘴硬。。你第一次调用的,你自己看看吧。什么人嘛。。

你看你发的贴,1# _CoProc("test")

如果按照你所说的,你所谓的方法
_CoProc("test1",$arry)
                                                _CoProc("test2",$arry)
你看能运行吗??

kemyliu 发表于 2012-2-6 20:53:24

本帖最后由 kemyliu 于 2012-2-6 20:55 编辑

回复 16# 半芯竹
呵呵,不管怎样还是非常感谢你的热心帮助!
今天试了很多也认真看了_CoProc函数的介绍,现在终于搞定了,具体代码如下:#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include "CoProc.au3"
#Region ### START Koda GUI section ### Form=
Global $Label1,$Label2,$arry
$Form1 = GUICreate("Form1", 623, 444, 192, 124)
$Button1 = GUICtrlCreateButton("OK", 168, 248, 249, 73)
$Label1 = GUICtrlCreateLabel("This is for test 1!", 10, 60, 230, 81)
GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$Label2 = GUICtrlCreateLabel("This is for test 2!", 350, 60, 230, 81)
GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$Label3 = GUICtrlCreateLabel("This is for test 3!", 10, 150, 250, 81)
GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$Label4 = GUICtrlCreateLabel("This is for test 4!", 350, 150, 250, 81)
GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
      $nMsg = GUIGetMsg()
      Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                         _CoProc("test1",$Label1&"|"&$Label2)
                         _CoProc("test2",$Label3&"|"&$Label4)
      EndSwitch
WEnd
      
Func Test1($tt)
        Local $aa
        $aa=StringSplit($tt,"|")
        ControlSetText("Form1","",Number($aa),"Hi,one change!")
        ControlSetText("Form1","",Number($aa),"Hi,two change!")
        MsgBox(0,"message1",$tt)
EndFunc

      
Func Test2($ss)
        Local $bb
        $bb=StringSplit($ss,"|")
        ControlSetText("Form1","",Number($bb),"Hi,third change!")
        ControlSetText("Form1","",Number($bb),"Hi,four change!")
        MsgBox(0,"message2",$ss)
EndFunc

liuxiaokia 发表于 2012-3-1 00:22:09

无限膜拜中啊

liyi-softs 发表于 2012-6-6 16:04:35

谢谢了.这也是我正在需要的.

拉风晓晓 发表于 2014-7-28 17:19:14

留脚印,以后用得到的
页: 1 [2]
查看完整版本: 【已解决】多进程子进程无法使用主进程的变量