Forum | | | | - Page 1 - |
| | Hello IF...
I habs time tested and hope nothing wrong made to have: CompileMarkSeparation $U thread.pcu = thread.
DEF @GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
Testprogramm Timer
Profan Version 9
$H Windows.ph
-Main----------------------------------------------------------------
Declare Timer_Busy%,Ende%
Declare TimerID&,Create%,T_Text&,Test#
WindowStyle 26
WindowTitle "Timertest PHU-60"
Window 100,100 - 370,200
cls
Let T_TEXT&=@CREATETEXT(%HWND,"",30,30,300,30)
-Menue---------------------------------------------------------------
PopUp "&Programm"
AppendMenu 108,"&Einstellungen"
AppendMenu 109,"&Ende"
Ende% = 0
Timer setzen (4x pro Sekunde, 250ms)
thread.start 1,1
WhileNot Ende%
WaitInput
If @MenuItem(108)
Einstellungen
Endif
If @MenuItem(109)
thread.stopall
Ende% = 1
Endif
Wend
End
-Proc Einstellungen
Proc Einstellungen
Declare hD%, hA%, hB%, OK%, hTime%
Declare hF1%, hT1%
Clear OK%
Dialogfenster erzeugen
hD% = @Create("Dialog",%hWnd,"Einstellungen",%WinLeft+80,%WinTop+155,230,190)
hF1% = @Create("Font","Arial",16,0,0,0,0)
hT1% = @Create("Text",hD%,"Einstellungen...",10,10,220,20)
SetFont hT1%,hF1%
hTime% = @Create("TimeEdit", hD%, "00:00:00", 10, 35, 70, 24)
hB% = @Create("Button",hD%,"&Nachstellen",10,120,100,28)
hA% = @Create("Button",hD%,"&Abbrechen",120,120,100,28)
WhileNot Ok%
WaitInput
If @ButtonClicked(hB%) Nachstellen
Ok% = 1
Aktionen hier
ElseIf @ButtonClicked(hA%) Abbrechen
Ok% = 1
ElseIf (%Key = 2) ALT+F4 bzw. schließen
Ok% = 1
EndIf
EndWhile
DeleteObject hF1%
@DestroyWindow(hD%)
EndProc
-Prozedur die in bestimmten Zeitintervallen ausgefuehrt wird (4x pro Sekunde)
Proc thread.do
parameters n&
Dim Test#,1000000
Inc Timer_Busy%
Locate 5,5
Print "Timer:" + @str$(Timer_Busy%) + " Durchläufe"
Settext T_Text&,"Timer:" + @str$(Timer_Busy%) + " Durchläufe"
ENDPROC
too here becomes the window not correctly. displayed! what means the? go in the Hauptprogramm during one Thread carryed out, überschreibt Profan intern gespeicherte variables to that Call of API. depending on, which Profanfunktionen in the Hauptprogramm uses go, is the menace time More and times less given, she's but too (loudly Roland) at direct Call of APIs present. when and whether a Error appears, depends of chosen Zeitintervall, of computer and from the Programmbedienung by the User ex. what means the very?
One example: at that one computer under windows2000 becomes when calling the API RegUnloadKey one such Crash causes and the API becomes therefore not correctly carryed out. thereupon becomes the Registryhive the User not How planned entladen and is at next Start not any more available => one ganzes Userprofile is unwiederbringlich lost.
One differently example: the Hauptprogramm writes during one Callback runs into Registry. there everything unfavourable zusammentrifft, becomes in a others Key written and Datenj in the Registry weg lost!
further ask and Notes? |
| | | | |
| | | | - Page 3 - |
| | | wrong understood, my I. Roland has already long ago answered - in its Forum . Probiers still from - schreib whom Callback in a DLL and promise it of Profan over SetTimer on - the lasts still only few minutes what about me kanns not. |
| | | | |
| | | I know now unfortunately Rolands Posting moreover not - schreib whom Callback in a DLL and promise it of Profan over SetTimer on can I not umsetzen, The Task understand I do not.
If it helps the Problematik something entgegenzuwirken then only out so... |
| | | | |
| | | As I said - schreib irgendeine function in a DLL and reputation whom Callback in a Profanprogramm with SetTimer on - means from this View source CompileMarkSeparationDEF @GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
Testprogramm Timer
Profan Version 9
$H Windows.ph
-Main----------------------------------------------------------------
Declare Timer_Busy%,Ende%
Declare TimerID&,Create%,T_Text&,Test#
WindowStyle 26
WindowTitle "Timertest PHU-60"
Window 100,100 - 370,200
cls
Let T_TEXT&=@CREATETEXT(%HWND,"",30,30,300,30)
-Menue---------------------------------------------------------------
PopUp "&Programm"
AppendMenu 108,"&Einstellungen"
AppendMenu 109,"&Ende"
Ende% = 0
Timer setzen (4x pro Sekunde, 250ms)
TimerID& = ~SetTimer(%HWND,333,25,@ProcAddr("Timer",4))
WhileNot Ende%
WaitInput
If @MenuItem(108)
Einstellungen
Endif
If @MenuItem(109)
~KillTimer(%HWND,333)
Ende% = 1
Endif
Wend
End
-Proc Einstellungen
Proc Einstellungen
Declare hD%, hA%, hB%, OK%, hTime%
Declare hF1%, hT1%
Clear OK%
Dialogfenster erzeugen
hD% = @Create("Dialog",%hWnd,"Einstellungen",%WinLeft+80,%WinTop+155,230,190)
hF1% = @Create("Font","Arial",16,0,0,0,0)
hT1% = @Create("Text",hD%,"Einstellungen...",10,10,220,20)
SetFont hT1%,hF1%
hTime% = @Create("TimeEdit", hD%, "00:00:00", 10, 35, 70, 24)
hB% = @Create("Button",hD%,"&Nachstellen",10,120,100,28)
hA% = @Create("Button",hD%,"&Abbrechen",120,120,100,28)
WhileNot Ok%
WaitInput
If @ButtonClicked(hB%) Nachstellen
Ok% = 1
Aktionen hier
ElseIf @ButtonClicked(hA%) Abbrechen
Ok% = 1
ElseIf (%Key = 2) ALT+F4 bzw. schließen
Ok% = 1
EndIf
EndWhile
DeleteObject hF1%
@DestroyWindow(hD%)
EndProc
-Prozedur die in bestimmten Zeitintervallen ausgefuehrt wird (4x pro Sekunde)
Proc Timer
Parameters P1&,P2&,P3&,P4&
Dim Test#,1000000
Inc Timer_Busy%
Locate 5,5
Print "Timer:" + @str$(Timer_Busy%) + " Durchläufe"
Settext T_Text&,"Timer:" + @str$(Timer_Busy%) + " Durchläufe"
se Test#
ENDPROC
sol the CompileMarkSeparation In a function of/ one DLL untergeracht go.
here standing [...] to the trouble, and here standing [...] . |
| | | | |
| | | I see I have The for me entscheidene testimony of Roland time extract:
[quote:a314d200ca] The Callbacks in XPofan have I indeed sooner for Cases installed, where a API-function a CallBack-Prozdur needed and first zurückkehrt, after these carryed out watts. [/quote:a314d200ca] These testimony begründet that I integrally and not at all moreover lie when i say the The Grundproblematik with procaddr lying if a Proc of outer called becomes. whom Roland self means with obiger testimony indeed, the it rather is if the XProfanprogramm wait.
accordingly is it alike whether The XProfanProc from the Api SetTimer, or by Call a others DLL triggered becomes. If the XProfanprogramm not grade in the mode the wartens on one Funktionsende is - then Gibts powerful trouble.
the against ists about which I are procaddr grüble - what but too means - the Roland Perhaps The Aufzurufenden functions behind the Procaddr-address kapseln ought to - as an Wartehalle - which then through Roland abgebaut becomes if XProfan means the it nothing To do has. |
| | | | |
| | | As I said: Please testing! interested me brennend. building times the Callback in a DLL - lasts Yes not long... |
| | | | |
| | | Jaja no trouble - but I understand The task still not!
The Callback in a DLL building
Schreib still simply NEN XProfan10 Zeiler for the XProfanprogramm, and a other for the I in the DLL manage should! I mean these Syntax lying me More... ;D |
| | | | |
| | | ...because here seem You The Half überlesen to have: [quote:ce4ddc094d] your analysis meets the trouble right very: with Create is the chance, that the Timer to Unzeit (means during the Abarbeitung the Befehles) triggered becomes, explicit higher as with one Control and there something higher, as with one direct API-appeal, but too there can not 100%ig impossible go. [/quote:ce4ddc094d] this is very the I my. and these [quote:ce4ddc094d] The Callbacks in XPofan have I indeed sooner for Cases installed, where a API-function a CallBack-Prozdur needed and first zurückkehrt, after these carryed out watts. [/quote:ce4ddc094d] contradict your testimony, the any Callbacks problematically are. As I said, Test!
over again To your View source: is a good Workaround, still could one then not same a Loop with a Wartebefehl the after a input abbricht install? Zeitgerecht becomes there still quite nothing more carryed out, or? |
| | | | |
| | | Ne Andreas, I habs not überlesen - but we talk on different Leveln - I mine not angry. I durchschaue The thing - therefore goes it already long not any more.
I observe but the You me not so integrally understand - therefore your opinion the itself my Posting with the Quote contradict - what But in my Gedankenraum even untermalt.
Grunsatzdiskussion aside - red us tommorrow on the DLL feilen - my Frauchen calls...
good night! |
| | | | |
| | | | | | | |
| | Frank Abbing | [quote:5cd369ff12]As I said: Please testing! interested me brennend. building times the Callback in a DLL - lasts Yes not long...[/quote:5cd369ff12] I had the already made. my Dll has a Thread created and this has a profansche Callbackroutine called. After several Call broke Profan with the sonderlichsten Fehlermeldungen ex. apiece kürzer The spread the Aufrufe, so faster came The Error. |
| | | | |
| | | Hello IF...
i think time, we see The Problematik really on different to put. here the proof, the the nothing with ProcAddr To do has: CompileMarkSeparationDEF @GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
Testprogramm Timer
Profan Version 9
$H Windows.ph
-Main----------------------------------------------------------------
Declare Timer_Busy%,Ende%
Declare TimerID&,Create%,T_Text&,Test#
WindowStyle 26
WindowTitle "Timertest PHU-60"
Window 100,100 - 370,200
cls
Let T_TEXT&=@CREATETEXT(%HWND,"",30,30,300,30)
-Menue---------------------------------------------------------------
PopUp "&Programm"
AppendMenu 108,"&Einstellungen"
AppendMenu 109,"&Ende"
Ende% = 0
Timer setzen (4x pro Sekunde, 250ms)
TimerID& = ~SetTimer(%HWND,333,25,@ProcAddr("Timer",4))
WhileNot Ende%
WaitInput
If @MenuItem(108)
Einstellungen
Endif
If @MenuItem(109)
~KillTimer(%HWND,333)
Ende% = 1
Endif
Wend
End
-Proc Einstellungen
Proc Einstellungen
Declare hD%, hA%, hB%, OK%, hTime%
Declare hF1%, hT1%
Clear OK%
Dialogfenster erzeugen
Set("FastMode",1)
hD% = @Create("Dialog",%hWnd,"Einstellungen",%WinLeft+80,%WinTop+155,230,190)
hF1% = @Create("Font","Arial",16,0,0,0,0)
hT1% = @Create("Text",hD%,"Einstellungen...",10,10,220,20)
SetFont hT1%,hF1%
hTime% = @Create("TimeEdit", hD%, "00:00:00", 10, 35, 70, 24)
hB% = @Create("Button",hD%,"&Nachstellen",10,120,100,28)
hA% = @Create("Button",hD%,"&Abbrechen",120,120,100,28)
Set("FastMode",0)
WhileNot Ok%
WaitInput
If @ButtonClicked(hB%) Nachstellen
Ok% = 1
Aktionen hier
ElseIf @ButtonClicked(hA%) Abbrechen
Ok% = 1
ElseIf (%Key = 2) ALT+F4 bzw. schließen
Ok% = 1
EndIf
EndWhile
DeleteObject hF1%
@DestroyWindow(hD%)
EndProc
-Prozedur die in bestimmten Zeitintervallen ausgefuehrt wird (4x pro Sekunde)
Proc Timer
Parameters P1&,P2&,P3&,P4&
Dim Test#,1000000
Inc Timer_Busy%
Locate 5,5
Print "Timer:" + @str$(Timer_Busy%) + " Durchläufe"
Settext T_Text&,"Timer:" + @str$(Timer_Busy%) + " Durchläufe"
ENDPROC
How you see, the goes - means there too with Subclassing in the principle no Problems, alike Why it lying ought to. I have here just the Message Handling shorted - what well too a cause the Problematik is.
here something to that Timer: CompileMarkSeparation $H windows.ph
$H Messages.ph
Declare end%, OldWndProc&, hButton%
Declare P_A$,P_A&,TIMERID&
Proc Timer_Sub
Parameters hWnd&,Message&,wParam&,lParam&
If Message& = ~WM_TIMER
Locate 0,0
Print "Timermessage in WndProc receive: "+@STR$(wParam&)
Else
Return ~CallWindowProc(OldWndProc&,hWnd&,Message&,wParam&,lParam&)
EndIf
ENDPROC
Set("FastMode", 1)
Window 0,0 -640,440
LET P_A$=@INPUT$("Adresse the TimerProc:","Funktionsadresse",@STR$(@ProcAddr("TimerProc",4)))
IF P_a$=""
END
else
LET P_A&=@VAL(P_A$)
endif
OldWndProc& = ~GetWindowLong(%hWnd,~GWL_WNDPROC)
~SetWindowLong(%hWnd,~GWL_WNDPROC,@ProcAddr("Timer_Sub",4))
LET hButton%=@Create("Button",%hWnd,"Ende",10,100,100,24)
TimerID& = ~SetTimer(%HWND,333,20000,P_A&)
Clear end%
WhileNot end%
WaitInput
If %Key = 2
end% = 1
ElseIf @Clicked(hButton%)
end% = 1
EndIf
EndWhile
~KillTimer(%HWND,333)
~SetWindowLong(%hWnd,~GWL_WNDPROC,OldWndProc&)
End
Proc TimerProc
Parameters 1&,2&,3&,4&
Locate 2,0
Print "TimerProc over address called: "+@STR$(3&)
endproc
How one sees, access the Timer The WndProc none. Gib time in the Edit 0 one, instead of the address - then siehts differently from.
here once more with external DLL (so How I the meant): The DLL CompileMarkSeparation and here the Hauptprogramm CompileMarkSeparationDEF @GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
DEF @GetProcAddress(2) !"KERNEL32","GetProcAddress"
Testprogramm Timer
Profan Version 9
$H windows.ph
-Main----------------------------------------------------------------
Declare end%,DLL&,P_A&
Declare TimerID&,Create%,T_Text&,Test#
LET DLL&=@Usedll("Thread.DLL")
Window Style 26+512
Window Title "Timertest PHU-60"
Window 100,100 - 370,200
cls
User Messages $10
LET P_A&=@GetProcAddress(DLL&,"_timer@16")
Print P_A&,DLL&
Let T_TEXT&=@CREATETEXT(%HWND,"",30,30,300,30)
-Menue---------------------------------------------------------------
PopUp "&Programm"
AppendMenu 108,"&Einstellungen"
AppendMenu 109,"&Ende"
Ende% = 0
Timer settle (4x per second, 250ms)
TimerID& = ~SetTimer(%HWND,T_TEXT&,25,P_A&)
WhileNot end%
WaitInput
IF %UMESSAGE=$10
LET ENDE%=1
endif
If @MenuItem(108)
Settings
Endif
If @MenuItem(109)
~KillTimer(%HWND,T_TEXT&)
end% = 1
Endif
Wend
~KillTimer(%HWND,T_TEXT&)
FreeDLL DLL&
End
-Proc Settings
Proc Settings
Declare hD%, hA%, hB%, OK%, hTime%
Declare hF1%, hT1%
Clear OK%
Dialog-Window produce
hD% = @Create("Dialog",%hWnd,"Einstellungen",%WinLeft+80,%WinTop+155,230,190)
hF1% = @Create("Font","Arial",16,0,0,0,0)
hT1% = @Create("Text",hD%,"Einstellungen...",10,10,220,20)
SetFont hT1%,hF1%
hTime% = @Create("TimeEdit", hD%, "00:00:00", 10, 35, 70, 24)
hB% = @Create("Button",hD%,"&Nachstellen",10,120,100,28)
hA% = @Create("Button",hD%,"&Abbrechen",120,120,100,28)
WhileNot OK%
WaitInput
If @ButtonClicked(hB%) Nachstellen
OK% = 1
activities here
ElseIf @ButtonClicked(hA%) Cancel
OK% = 1
ElseIf (%Key = 2) ALT+F4 or. close
OK% = 1
EndIf
EndWhile
DeleteObject hF1%
@DestroyWindow(hD%)
ENDPROC
-procedure The in designed Zeitintervallen ausgefuehrt becomes (4x per second)
Proc Timer
Parameters P1&,P2&,P3&,P4&
Dim Test#,1000000
Inc Timer_Busy%
Settext P3&,"Timer:" + @st$(Timer_Busy%) + " Durchläufe"
Dispose Test#
ENDPROC
functions ditto. and here to that comparison without DLL: CompileMarkSeparationDEF @GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
DEF @GetProcAddress(2) !"KERNEL32","GetProcAddress"
Testprogramm Timer
Profan Version 9
$H windows.ph
-Main----------------------------------------------------------------
Declare Timer_Busy%,end%
Declare TimerID&,Create%,T_Text&,Test#
Window Style 26+512
Window Title "Timertest PHU-60"
Window 100,100 - 370,200
cls
User Messages $10
Let T_TEXT&=@CREATETEXT(%HWND,"",30,30,300,30)
-Menue---------------------------------------------------------------
PopUp "&Programm"
AppendMenu 108,"&Einstellungen"
AppendMenu 109,"&Ende"
Ende% = 0
Timer settle (4x per second, 250ms)
TimerID& = ~SetTimer(%HWND,T_TEXT&,25,@ProcAddr("Timer",4))
WhileNot end%
WaitInput
IF %UMESSAGE=$10
LET ENDE%=1
endif
If @MenuItem(108)
Settings
Endif
If @MenuItem(109)
~KillTimer(%HWND,T_TEXT&)
end% = 1
Endif
Wend
End
-Proc Settings
Proc Settings
Declare hD%, hA%, hB%, OK%, hTime%
Declare hF1%, hT1%
Clear OK%
Dialog-Window produce
hD% = @Create("Dialog",%hWnd,"Einstellungen",%WinLeft+80,%WinTop+155,230,190)
hF1% = @Create("Font","Arial",16,0,0,0,0)
hT1% = @Create("Text",hD%,"Einstellungen...",10,10,220,20)
SetFont hT1%,hF1%
hTime% = @Create("TimeEdit", hD%, "00:00:00", 10, 35, 70, 24)
hB% = @Create("Button",hD%,"&Nachstellen",10,120,100,28)
hA% = @Create("Button",hD%,"&Abbrechen",120,120,100,28)
WhileNot OK%
WaitInput
If @ButtonClicked(hB%) Nachstellen
OK% = 1
activities here
ElseIf @ButtonClicked(hA%) Cancel
OK% = 1
ElseIf (%Key = 2) ALT+F4 or. close
OK% = 1
EndIf
EndWhile
DeleteObject hF1%
@DestroyWindow(hD%)
ENDPROC
-procedure The in designed Zeitintervallen ausgefuehrt becomes (4x per second)
Proc Timer
Parameters P1&,P2&,P3&,P4&
Dim Test#,1000000
Inc Timer_Busy%
Settext P3&,"Timer:" + @st$(Timer_Busy%) + " Durchläufe"
Dispose Test#
ENDPROC
what again whom Error causes. of my opinion to lying this Special trouble really on WM_TIMER - but I at best sake no expert and let me too gladly (on the dearest through beweisfähige Source) of contrary convincing. |
| | | | |
| | | and these three Source wären there among other things too yet interestingly: CompileMarkSeparationDEF @GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
DEF @GetProcAddress(2) !"KERNEL32","GetProcAddress"
Testprogramm Timer
Profan Version 9
$H Windows.ph
-Main----------------------------------------------------------------
Declare Timer_Busy%,Ende%
Declare TimerID&,Create%,T_Text&,Test#,T_TEXT2&
Declare OldWndProc&,DLL&,P_A&
LET DLL&=@Usedll("Send.DLL")
WindowStyle 26+512
WindowTitle "Subclassingtest"
Window 100,100 - 370,200
Let T_TEXT&=@CREATEButton(%HWND,"",30,80,300,30)
Let T_TEXT2&=@CREATEButton(%HWND,"Ende",30,120,300,30)
Waitinput
Set("FastMode", 1)
OldWndProc& = ~GetWindowLong(%hWnd,~GWL_WNDPROC)
LET P_A&=@GetProcAddress(DLL&,"_timer@16")
~SetWindowLong(%hWnd,~GWL_WNDPROC,@ProcAddr("Sub",4))
Ende%=0
TimerID&=~SetTimer(%HWND,333,20,P_A&)
Print TimerID&
WhileNot Ende%
WaitInput
If @Buttonclicked(T_TEXT&)
Einstellungen
Endif
If @Buttonclicked(T_TEXT2&)
~KillTimer(%HWND,333)
Ende%=1
Freedll DLL&
Endif
Wend
End
-Proc Einstellungen
Proc Einstellungen
Declare hD%, hA%, hB%, OK%, hTime%
Declare hF1%, hT1%
Clear OK%
Dialogfenster erzeugen
hD% = @Create("Dialog",%hWnd,"Einstellungen",%WinLeft+80,%WinTop+155,230,190)
hD% = @Control("Dialog","Einstellungen",$14C80084,%WinLeft+80,%WinTop+155,230,190,%HWND,0,%HINSTANCE,$101)
hF1% = @Create("Font","Arial",16,0,0,0,0)
hT1% = @Create("Text",hD%,"Einstellungen...",10,10,220,20)
SetFont hT1%,hF1%
hTime% = @Create("TimeEdit", hD%, "00:00:00", 10, 35, 70, 24)
hB% = @Create("Button",hD%,"&Nachstellen",10,120,100,28)
hA% = @Create("Button",hD%,"&Abbrechen",120,120,100,28)
WhileNot Ok%
WaitInput
If @ButtonClicked(hB%) Nachstellen
Ok% = 1
Aktionen hier
ElseIf @ButtonClicked(hA%) Abbrechen
Ok% = 1
ElseIf (%Key = 2) ALT+F4 bzw. schließen
Ok% = 1
EndIf
EndWhile
DeleteObject hF1%
@DestroyWindow(hD%)
EndProc
Proc Sub
Parameters hWnd&,Message&,wParam&,lParam&
If Message&=$401
Inc Timer_Busy%
Settext T_Text&,"Timer: " + @str$(Timer_Busy%) + " Durchläufe"
Return ~CallWindowProc(OldWndProc&,hWnd&,Message&,wParam&,lParam&)
Else
Return ~CallWindowProc(OldWndProc&,hWnd&,Message&,wParam&,lParam&)
EndIf
ENDPROC
CompileMarkSeparationDEF @GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
DEF @GetProcAddress(2) !"KERNEL32","GetProcAddress"
Testprogramm Timer
Profan Version 9
$H windows.ph
-Main----------------------------------------------------------------
Declare Timer_Busy%,end%
Declare TimerID&,Create%,T_Text&,Test#,T_TEXT2&
Declare OldWndProc&,DLL&,P_A&
LET DLL&=@Usedll("Send.DLL")
Window Style 26+512
Window Title "Subclassingtest 2"
Window 100,100 - 370,200
Let T_TEXT&=@CREATEButton(%HWND,"",30,80,300,30)
Let T_TEXT2&=@CREATEButton(%HWND,"Ende",30,120,300,30)
Waitinput
Set("FastMode", 1)
OldWndProc& = ~GetWindowLong(%hWnd,~GWL_WNDPROC)
LET P_A&=@GetProcAddress(DLL&,"_timer@16")
~SetWindowLong(%hWnd,~GWL_WNDPROC,@ProcAddr("Sub",4))
Ende%=0
TimerID&=~SetTimer(%HWND,333,25,@ProcAddr("Sub",4))
Print TimerID&
WhileNot end%
WaitInput
If @Buttonclicked(T_TEXT&)
Settings
Endif
If @Buttonclicked(T_TEXT2&)
~KillTimer(%HWND,333)
end%=1
Freedll DLL&
Endif
Wend
End
-Proc Settings
Proc Settings
Declare hD%, hA%, hB%, OK%, hTime%
Declare hF1%, hT1%
Clear OK%
Dialog-Window produce
hD% = @Create("Dialog",%hWnd,"Einstellungen",%WinLeft+80,%WinTop+155,230,190)
hD% = @Control("Dialog","Einstellungen",$14C80084,%WinLeft+80,%WinTop+155,230,190,%HWND,0,%HINSTANCE,$101)
hF1% = @Create("Font","Arial",16,0,0,0,0)
hT1% = @Create("Text",hD%,"Einstellungen...",10,10,220,20)
SetFont hT1%,hF1%
hTime% = @Create("TimeEdit", hD%, "00:00:00", 10, 35, 70, 24)
hB% = @Create("Button",hD%,"&Nachstellen",10,120,100,28)
hA% = @Create("Button",hD%,"&Abbrechen",120,120,100,28)
WhileNot OK%
WaitInput
If @ButtonClicked(hB%) Nachstellen
OK% = 1
activities here
ElseIf @ButtonClicked(hA%) Cancel
OK% = 1
ElseIf (%Key = 2) ALT+F4 or. close
OK% = 1
EndIf
EndWhile
DeleteObject hF1%
@DestroyWindow(hD%)
ENDPROC
Proc Sub
Parameters hWnd&,Message&,wParam&,lParam&
Inc Timer_Busy%
Settext T_Text&,"Timer: " + @st$(Timer_Busy%) + " Durchläufe"
ENDPROC
CompileMarkSeparation The Error has means well nothing with Subclassing To do - or what Dou you mean very? |
| | | | |
|
AnswerThemeninformationenthis Topic has 4 subscriber: |