| |
|
|
| no eigener Thread, nevertheless runs independent - how does that? Genutzt becomes here, that Profan in the compilierten EXE to eachone 20.row (uncompiliert to eachone row) first once eintreffende Messages processing: 1.) Timer becomes initialized - 1500 Millisekunden later meets The WM_TIMER Message of Betriebsystem one. 2.) Profan power yet maximum 20 Lines moreover, then becomes The Message processing. Verweist The Timermessage on a Prozeduradresse, becomes the there stehende View source ausgeführt; the in the moment ongoing Quelltextabschnit becomes interrupted and the procedure becomes complete carryed out. 3.) is The procedure exits lead Profan whom View source ex the interrupted row again from.
These story is on none drop with a Thread To confuse, there not between whom individual Quelltextzeilen geswitched becomes, separate The procedure first complete worn out becomes, before it with the middle-aged View source weitergeht. Zugriffsrechte there here naturally ditto no own, and the whole can itself neither on eachone beliebigen place stop, How with one right Thread! CompileMarkSeparationDef @GetCurrentThreadId(0) !KERNEL32,GetCurrentThreadId
DEF @GetDlgCtrlID(1) !USER32,GetDlgCtrlID
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
Def @SetTimer(4) !USER32,SetTimer
Def @KillTimer(2) !USER32,KillTimer
Declare Timer_WIN&,Text$[3],Button&,Zähler%,TIMER_ID&,PRO_ID&,TH_ID&
Windowstyle 31+512
Windowtitle Selbständig laufende Programmschleife
Window 0,0-640,440
Usermessages $10
LET TIMER_WIN&=@Control(Static,TIMER_WIN,$8000000,0,0,0,0,%Desktop,9998,%HINSTANCE,$4)
Let Button&=@createbutton(%HWND,,20,100,300,30)
LET TEXT$[0]=Hier klicken...
LET TEXT$[1]=...für die...
LET TEXT$[2]=...Messagebox!
LET TIMER_ID&=@SetTimer(TIMER_WIN&,9999,1500,@ProcAddr(TimerProc,4))
While %UMESSAGE<>$10
Waitinput
Locate 0,0
Print @GetCurrentThreadId(),TH_ID&
IF @ButtonClicked(Button&)
@messagebox(Der Text auf dem Button ändert sich weiterhin!,Ein Wunder...?,64)
endif
wend
@KiLLTIMER(TIMER_WIN&,9999)
end
Proc TimerProc
Parameters ahhwnd&,ahuMsg&,ahidEvent&,ahdwTime&
Settext Button&,Text$[Zähler%]
INC Zähler%
Case Zähler%=4 : LET Zähler%=0
LET TH_ID&=@GetCurrentThreadId()
Endproc
|
|
|
| |
|
|