Jump to content

Calling Func


Madza91
 Share

Recommended Posts

Hello, We all know that when call some Function and you try to move window, Func will be stoped... Example:

Start script and try to move window, numbers will be stoped when you drag window...

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 633, 447, 193, 125)
$Label1 = GUICtrlCreateLabel("Label1", 72, 40, 36, 17)
GUISetState(@SW_SHOW)
AdlibEnable("_Func", 500)

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

Func _func()
    GUICtrlSetData($Label1, Random(0,99999,1))
EndFunc

And, there is solution for calling Function without stopping Func on dragging, but when you call 1 Function, and then 2nd Function, 1st Function will be stopped, but I want to call 2 or more functions... Example script:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$hGui = GUICreate("Form1", 633, 447, 193, 125)
$Label1 = GUICtrlCreateLabel("Label1", 72, 40, 36, 17)
$Label2 = GUICtrlCreateLabel("Label1", 172, 40, 36, 17)
GUISetState(@SW_SHOW)

 TimerEnable("_Func", $hGui, 500)
 
 Sleep(2000)
  TimerEnable("_Func2", $hGui, 500)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _Func()
    GUICtrlSetData($Label1, Random(0,99999,1))
EndFunc

Func _Func2()
    GUICtrlSetData($Label2, Random(0,99999,1))
EndFunc

Func TimerEnable($sFunction, $hWnd, $sTime = 100)
    GUIRegisterMsg($WM_TIMER, $sFunction)
    DllCall("User32.dll", "int", "SetTimer", "hwnd", $hWnd, "int", 50, "int", $sTime, "int", 0)
EndFunc

Func TimerDisable($hWnd)
    GUIRegisterMsg($WM_TIMER, "")
    DllCall("user32.dll", "int", "KillTimer", "hwnd", $hWnd, "int*", 50)
EndFunc

Question is: How to call 2 or more functions at once, or if isn't possible, how to call 2nd Function after when is 1st Function finished (but when drag window, Function doesn't stop?

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...