English
Source / code snippets

ongoing Programmteile Pseudothread self-contained XProfan8

 
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!
CompileMarkSeparation
Def @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


 
04/24/06  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.244 Views

Untitledvor 0 min.
Julian Schmidt01/07/12

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie