English
Source / code snippets

real ongoing Threads Zeitanzeige

 
over ands over again demand: The ongoing Zeitanzeige in the cover or status or or ...

demand Specifically becomes really too after a display, which independent of Hauptprogramm self-employed updated, even if the Hauptprogramm operates.

this behaviour is with Präkompilern erzielbar, xpse bid to The pseudo-class "Thread" [...]  , circa basichaften Use with real Threads herzubilden.

an simple Zeitanzeige in the Hauptfenstertitel can accordingly so beautiful short formulieren:
CompileMarkSeparation
 {$cleq}
cls
var thread&=thread.start(procaddr(meinThread),0,"")

while 1

    waitinput
    //... programm // break

wend

thread.close(thread&)
end

nProc meinThread

    Parameters thread&,dataLong&,dataString$

    WhileNot thread.message(thread&)=wm_close

        setText(%hWnd,"Mein FensterTitel - ["+time$(0)+"."+substr$(time$(1),1,".")+"]")
        sleep(1000)

    wend

    return 0

endProc

, or.
CompileMarkSeparation
 {$cleq}
cls
var thread&=thread.start(procaddr(meinThread),0,"")

while 1

    waitinput
    //... Program // break

wend

showWindow(%hWnd,0)
thread.stop(thread&)

while thread.is(thread&)

wend

thread.close(thread&)
end

nProc meinThread

    Parameters thread&,dataLong&,dataString$

    WhileNot thread.message(thread&)=wm_close

        setText(%hWnd,"Mein FensterTitel - ["+time$(0)+"."+substr$(time$(1),1,".")+"]")
        sleep(1000)

    wend

    return 0

endProc

sauberer program would, because the Thread not stalls becomes separate waited becomes, To this correctly exits is.

another Possibility bid The SetTimer-Api.

there it in XProfan The command KillTimer and SetTimer gives, by ~ on The Apis show, z.B. ~SetTimer(... :
CompileMarkSeparation
 {$cleq}
Window Style 520
cls
var zeitAnzeige.timer&=~setTimer(0,0,1000,procAddr(zeitAnzeige.timerProc))

While 1

    WaitInput
    Case %key=2: BREAK

EndWhile

~killTimer(0,zeitAnzeige.timer&)
end

nProc zeitAnzeige.timerProc

    Parameters wnd&,msg&,id&,tme&
    setText(%hWnd,date$(1)+" - "+time$(0)+" watch - "+time$(2)+" ["+st$(&getTickCount)+"]")

ENDPROC


who further mutants knows, here's a good Space for - lying in Application-Templates and Codesnippets.

terms are no FastMode (for best Integration in normal Applications) and no unsure application of ProcAddr, means nothing with absehbarer Absturzgefahr.

who means further Examples has or needed, Please post.

Beispielexen in the attachment.

560 kB
Hochgeladen:03/15/10
Downloadcounter117
Download
561 kB
Hochgeladen:03/15/10
Downloadcounter100
Download
 
03/15/10  
 



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

3.805 Views

Untitledvor 0 min.
Erfurt08/04/20
AndreasS12/17/18
Member 389165709/22/18
iF06/20/18
More...

Themeninformationen

this Topic has 1 subscriber:

iF (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