| |
|
|
| Hello people...
it's about [...] . here standing the following:
The fix added a checked to see if the address specified in the WM_TIMER message what registered as a call-back before taking the branch.
in a, whether I in the item something wrong understood or überlesen have, but for me is the the following: The Callback becomes through SetTimer registered. at that appeal of SetTimer observes itself the Aufrufende Process The address the Callbackfunktion. meets a Timmermessage one, becomes now simply nahgesehen, whether the Process the whom Callback perform should itself before The address Pinned has - is this not the case, comes The Timernachricht of a others Process. Why functions then but not? CompileMarkSeparationDef @SetTimer(4) !USER32,SetTimer
Def @KillTimer(2) !USER32,KillTimer
DEF @GetDlgCtrlID(1) !USER32,GetDlgCtrlID
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
Declare Button&,TIMER_ID&,Zähler&
Clear TIMER_ID&
Windowstyle 31+512
WindowTitle Timer empfangen
Window 0,0-640,440
Usermessages $10
Let Button&=@CreateButton(%HWND,Timer setzen,20,200,200,30)
Print Handle des Hauptfensters: +@STR$(%HWND)
Print Adresse der Prozedur: +@STR$(@ProcAddr(TimerProc,4))
While %UMESSAGE<>$10
Waitinput
IF @ButtonClicked(Button&)
Enablewindow Button&,0
LET TIMER_ID&=999
@SetTimer(%HWND,TIMER_ID&,60000,@ProcAddr(TimerProc,4))
endif
wend
IF TIMER_ID&<>0
@KillTimer(%HWND,TIMER_ID&)
endif
End
Proc TimerProc
Parameters FensterHandle&,T_Message&,T_ID&,SYS_TIME&
Color 12,15
Locate 3,0
LET Zähler&=Zähler&+1
Print Timer angekommen: +@STR$(T_ID&)+ +@STR$(SYS_TIME&)+ +@STR$(Zähler&)+@Space$(20)
Endproc
CompileMarkSeparationDef @SetTimer(4) !USER32,SetTimer
Def @KillTimer(2) !USER32,KillTimer
DEF @GetDlgCtrlID(1) !USER32,GetDlgCtrlID
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
Def @GetLastError(0) !KERNEL32,GetLastError
Def @SetLastError(1) !KERNEL32,SetLastError
DEF @AHFormatMessage(7) !KERNEL32,FormatMessageA
Declare Button&,TIMER_ID&,Button2&,Fenster&,Window$,PR_ADDR&,PR_ADDR$,Rück&,FH&
Declare AHRückgabe&,AHGETERROR_Buffer#,AHGETERROR_Buffer$,Zähler&
Clear TIMER_ID&
Windowstyle 31+512
Window Title Timer Send
Window 0,0-640,440
User Messages $10
Let Button&=@CreateButton(%HWND,Timer settle,20,200,200,30)
Let Button2&=@CreateButton(%HWND,Timer post,20,250,200,30)
LET FH&=@FindWindow(Timer receive)
Let Window$=@Input$(Fensterhandle prompt:,lever one Fensters?,@STR$(FH&))
LEt Fenster&=@VAL(Window$)
IF Window$<>
LET PR_ADDR$=@Input$(Prozeduradresse prompt:,address the TimerProc?,@STR$(@ProcAddr(TimerProc,4)))
IF PR_ADDR$<>
LET PR_ADDR&=@VAL(PR_ADDR$)
While %UMESSAGE<>$10
Waitinput
LET TIMER_ID&=999
IF @ButtonClicked(Button&)
CLS
Locate 0,0
@SetLastError(0)
LET RÜCK&=@SetTimer(%HWND,TIMER_ID&,60000,PR_ADDR&)
Let AHRückgabe&=@GetLastError()
Fehlercode_bestimmen
Print AHGETERROR_Buffer$
@SetLastError(0)
LET RÜCK&=@SetTimer(Fenster&,TIMER_ID&,1000,PR_ADDR&)
Let AHRückgabe&=@GetLastError()
Fehlercode_bestimmen
Print AHGETERROR_Buffer$
Elseif @ButtonClicked(Button&)
@PostMessage(Fenster&,$113,TIMER_ID&,PR_ADDR&)
endif
wend
IF TIMER_ID&<>0
@KillTimer(Fenster&,TIMER_ID&)
@KillTimer(%HWND,TIMER_ID&)
endif
Endif
endif
End
Proc TimerProc
Parameters FensterHandle&,T_Message&,T_ID&,SYS_TIME&
LET T_ID&=TIMER_ID&
Color 12,15
Locate 3,0
LET Zähler&=Zähler&+1
Print Timer arrived: +@STR$(FensterHandle&)+ +@STR$(T_ID&)+ +@STR$(SYS_TIME&)+ +@STR$(Zähler&)+@Space$(20)
Endproc
Proc Fehlercode_bestimmen
DIM AHGETERROR_Buffer#,32000
@AHFormatMessage($1000,0,AHRückgabe&,0,AHGETERROR_Buffer#,32000,0) Wandelt Error Code in Landesspezifische Message circa.
Let AHGETERROR_Buffer$=@TRIM$(@STRING$(AHGETERROR_Buffer#,0))
Dispose AHGETERROR_Buffer#
Endproc
Verschweigt there Microsoft what? (counts for WindowsXP SP2, windows2000 SP4) |
|
|
| |
|
|