English
Source / code snippets

Cancel Button Erweitert Messagebox Thread Timer count

 
MessageBox Thread Button Change Cancel Timer Erweitert count

Related: asyncmsgbox.inc (  [...]  )

iF (29.06.12)
Hihi,

schauma: Download
external Download



 {$cleq}
const 	asyncMessageBox.Message=1025
declare	asyncMessageBox.C&
decimals 0

proc asyncMessageBox

    parameters wnd&,s$,tit$,mode&
    add asyncMessageBox.C&,1
    var h&=globalAlloc(gPTR,24)
    long h&,0=addr(s$),addr(tit$),mode&,wnd&,create("text",hWnd,"",0,0,0,0),asyncMessageBox.C&
    setWindowLong(long(h&,16),gwl_userdata,setWindowLong(long(h&,16),gwl_wndProc,procaddr(asyncMessageBox.wndProc,4)))
    asyncMessageBox.createThread(h&)

    while long(h&,0)

        sleep 10

    wend

    whileloop 100

    wend

    var msg&=long(h&,16)
    userMessages asyncMessageBox.Message
    globalFree(h&)
    var msgboxWnd&=findWindow("."+st$(hWnd)+"."+st$(asyncMessageBox.C&))
    settext msgboxWnd&,tit$
    return msgboxWnd&

endproc

nProc asyncMessageBox.createThread

    parameters h&
    createThread(0,0,procAddr(asyncMessageBox.thread,1),h&,0,0)

endproc

nProc asyncMessageBox.wndProc

    Parameters wnd&,msg&,wp&,lp&

    if msg&=asyncMessageBox.Message

        sendMessage(hWnd,asyncMessageBox.Message,wnd&,lp&)
        destroyWindow(wnd&)
        return 0

    endif

    return callWindowProc(getWindowLong(wnd&,gwl_userData),wnd&,msg&,wp&,lp&)

endproc

nproc asyncMessageBox.thread

    parameters h&
    var s$=string $(long(h&,0),0)
    var tit$=string $(long(h&,4),0)
    var mode&=long(h&,8)
    var wnd&=long(h&,12)
    var trd&=long(h&,16)
    long h&,0=0
    sendMessage(trd&,asyncMessageBox.Message,0,messageBox(wnd&,s$,"."+st$(hWnd)+"."+st$(long(h&,20)),mode&))
    return 0

endproc

cls
var myMsgBoxWnd&=asyncMessageBox(desktop,"Huhu","Titel",mb_ok)
settext findWindowEx(myMsgBoxWnd&,0,"BUTTON","OK"),"&Abbrechen"

while 1

    waitinput

wend

end

or herewith zählts pretty down and closes itself self-employed:
cls
var myMsgBoxWnd&=asyncMessageBox(desktop,"Huhu","Titel",mb_ok)
var btn&=findWindowEx(myMsgBoxWnd&,0,"BUTTON","OK")
var c&=10

while (c&+2) and isWindow(myMsgBoxWnd&)

    waitinput 1000
    settext btn&,"&Abbrechen ["+st$(c&)+"]"
    sub c&,1

wend

case isWindow(myMsgBoxWnd&) : sendMessage(myMsgBoxWnd&,wm_close,0,0)
print "fertsch"

while 1

    waitinput

wend

end



iF (29.06.12)
and here time mere by External:
'{$cleq}
decimals 0
cls
var myTimer&=external("user32","SetTimer",0,0,100,procAddr(myMessageBoxAPCProc,4))
print messageBox("Text","."+st$(%hWnd)+".Hello World!",0)
waitinput
end

proc myMessageBoxAPCProc

    parameters wnd&,msg&,id&,tme&
    var s$="."+st$(%hWnd)+"."
    var msgboxWnd&=findWindow(s$)
    casenot msgboxWnd& : return
    external("user32","KillTimer",0,myTimer&)
    settext msgboxWnd&,del$(getText$(msgboxWnd&),1,len(s$))
    var btn&=external("user32","FindWindowExA",msgboxWnd&,0,"BUTTON","OK")
    casenot btn& : return
    setText btn&,"&Abbrechen"

endProc


so the so written but against 100%ig (instead of 99%ig) "absturzsicher" is,
should something like Roland nativ install because one APC on a interpretierte XProfan-
Proc can always crash particularly so komplexer and larger the program is.
 
07/04/12  
 



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

7.650 Views

Untitledvor 0 min.
ecki07/29/23
Walter12/30/22
RudiB.04/14/22
p.specht11/21/21
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