找回密码
 加入
搜索
查看: 1711|回复: 4

[AU3基础] Au3自身是什么对象(CreateThread)?

[复制链接]
发表于 2010-8-6 08:37:05 | 显示全部楼层 |阅读模式
以下代码14行处究竟应该怎么填?
好像官网也没有Me对象的说明, Au3自身创建的对象究竟是什么?
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 519, 133, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 272, 32, 75, 25)
$Label1 = GUICtrlCreateLabel("Label1", 32, 40, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$TestThread=ObjCreate("MT32.Thread")
;~ MsgBox(0,"",ObjName($TestThread))
$TestThread.CreateThread($TestThread,"_Test","")


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

Func _Test()
        $i=0
        Do 
                $i += 1
                GUICtrlSetData($Label1,$i)
                Sleep(500)
        Until $i >=1000
EndFunc
附说明:
CreateThread
功能:    创建线程
参数: ThreadObject 拥有线程函数的对象
    ThreadProc 线程函数名称
    Params 线程函数的参数
    ReturnObject 线程函数返回的是否为对象类型
    Suspending 线程创建后是否挂起
返回:    线程句柄

guland 老说Au3在没有被证明是无法多线程之前,是肯定可以多线程的,但对于以下的表述,Au3应该是不能做出来的:
$TestThread.ThreadObject.Label1.Text=1

所以,至少在VB层面上是不可能的。
发表于 2010-8-6 09:06:54 | 显示全部楼层
没用的 createthread要求提供一个对象,VB6的Me是指当前窗体对象
 楼主| 发表于 2010-8-6 09:37:10 | 显示全部楼层
me不是指窗体对象,me既可以是窗体也可以是类。
发表于 2010-8-8 15:22:26 | 显示全部楼层
$Ret = DllCall('kernel32.dll', 'dword', 'ResumeThread', 'ptr', $hThread)

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

 楼主| 发表于 2010-8-8 17:11:40 | 显示全部楼层
很感谢4楼,只是这样子任然无法创建,$Ret[0]的意义我还是不太明白。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-22 01:25 , Processed in 0.107867 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表