Source / code snippets | | | | - Page 1 - |
| | SubClassProc Timer - secure CompileMarkSeparation $H windows.ph
WINDOWSTYLE 80 | 512 | 1024
WINDOW %MAXX,%MAXY - 0,0
SHOWWINDOW(%HWND,0)
WINDOWSTYLE 1 | 2 | 4 | 8 | 16 | 512
var HMYWND&=(CREATE("WINDOW",(0),"Zuckertest 3.0",(100),(100),(200),(350)))
var HPIC&=CREATE("hNewPic",64,64,$FFFFAA)
var HDSK&=CREATE("text",HMYWND&,"",0,0,$FFFF,$FFFF)
var HSTATBAR&=CREATE("statusWindow",HMYWND&,"Bereit.")
USERMESSAGES $0010,$0014
MYWND.RESIZING()
SUBCLASS HMYWND&,1
~SetClassLongA(HMYWND&,-12,~LoadCursorA(0,32512))
~SetTimer(HMYWND&,55100,100,0)
~SetTimer(HMYWND&,55101,500,0)
WHILE 1
WAITINPUT
SELECT %UMESSAGE
CASEOF $0010
SELECT %MWND
CASEOF HMYWND&
BREAK
ENDSELECT
ENDSELECT
ENDWHILE
~KillTimer(HMYWND&,55100)
~KillTimer(HMYWND&,55101)
end
SUBCLASSPROC
SELECT &SWND
CASEOF HMYWND&
SELECT %SMESSAGE
CASEOF 532,$0005
MYWND.RESIZING()
CASEOF $0113
SELECT &SWPARAM
CASEOF 55100
DEMO(1)
CASEOF 55101
DEMO(2)
ENDSELECT
ENDSELECT
ENDSELECT
endproc
proc MYWND.RESIZING
SETWINDOWPOS HSTATBAR&=0,0 - 0,0
DEMO(1)
DEMO(2)
endproc
proc DEMO
PARAMETERS MODE&
SELECT MODE&
CASEOF 1
STARTPAINT HMYWND&
USEPEN 0,0,RND($FFFFFF)
LINE 10,10 - 200,43
ENDPAINT
CASEOF 2
STARTPAINT HMYWND&
TEXTCOLOR RND($FFFFFF),~GetSysColor(15)
DRAWTEXT 10,10,&GETTICKCOUNT
ENDPAINT
ENDSELECT
endproc
CompileMarkSeparation {$cleq}
windowstyle 80 | 512 | 1024
window maxx,maxy - 0,0
showWindow(hWnd,false)
windowstyle 1 | 2 | 4 | 8 | 16 | 512
long hMyWnd=createWindow(,"Zuckertest 3.0",100,100,200,350),
hPic=create("hNewPic",64,64,$FFFFAA),
hDsk=create("text",hMyWnd,"",,,$FFFF,$FFFF),
hStatBar=create("statusWindow",hmyWnd,"Bereit.")
userMessages wm_close,wm_erasebkgnd
myWnd.resizing()
setClassLong(hMyWnd,gcl_hcursor,loadCursor(,IDC_ARROW))
subClass hMyWnd,true
~setTimer(hMyWnd,55100,100,)
~setTimer(hMyWnd,55101,500,)
do {
waitInput
select uMessage
caseof wm_close
select mWnd
caseof hMyWnd
break
endSelect
endSelect
}
~killTimer(hMyWnd,55100)
~killTimer(hMyWnd,55101)
end
subClassProc {
select sWnd
caseof hMyWnd
select sMessage
caseof wm_sizing,wm_size
myWnd.resizing()
caseof wm_timer
select sWParam
caseof 55100:demonstration(1)
caseof 55101:demonstration(2)
endSelect
endSelect
endSelect
}
myWnd.resizing{
setWindowPos hStatBar=0,0 - 0,0
demonstration(1)
demonstration(2)
}
demonstration(long fashion){
select fashion
caseof 1
startPaint hMyWnd
usePen 0,,rnd($FFFFFF)
line 10,10 - 200,43
EndPaint
caseof 2
startPaint hMyWnd
textColor rnd($FFFFFF),getSysColor(15)
drawText 10,10,getTickCount
EndPaint
endSelect
}
|
| | | | |
| | | | | - Page 1 - |
| | Nö, is completely correctly with XPSE.
Window should on 0 prepares go (supreme plain) so it too sure in the Tastkbar alights - and the Parameter between ,, can only 0 his. the works but only behind clinging and between Kommas...
XPSE Translated it still too correctly, or?
You can with XPSE write: CompileMarkSeparation and the ausgekommaten 4 Parameter are hold 0... (saves but too only, the - if in the Zielfunktion no pCount-check installed is - The übergebenen Parameter too really 0 are) |
| | | | |
| | | Frank Abbing
What exactly to the code demonstrating?
so can sicheres threadähnliches behaviour program, or. is it this a Vereinfachung.
Blockierende Apis can so naturally not überrumpelt go. |
| | | | |
| | Jörg Sellmeyer | If I the zweien code as prf-File by Drag & Drop on XPSE ziehe sustain I this code: CompileMarkSeparation
proc __xpse__endofprogram__
REM {{SOMEEXTRAENDCOMMAND}}
end
endproc
DECLARE __cf1&,__cf2&,__cf3&,__cf4&,__cf5&
Def __cf1(2) !"KERNEL32","GetProcAddress"
Def __cf2(1) !"KERNEL32","GetModuleHandleA"
__cf1&=__cf1(__cf2("user32.dll"),"SetClassLongA")
__cf2&=__cf1(__cf2("user32.dll"),"LoadCursorA")
__cf3&=__cf1(__cf2("user32.dll"),"SetTimer")
__cf4&=__cf1(__cf2("user32.dll"),"KillTimer")
__cf5&=__cf1(__cf2("user32.dll"),"GetSysColor")
WINDOWSTYLE 80 | 512 | 1024
WINDOW %MAXX,%MAXY - 0,0
SHOWWINDOW(%HWND,0)
WINDOWSTYLE 1 | 2 | 4 | 8 | 16 | 512
var HMYWND&=(CREATE("WINDOW",(),"Zuckertest 3.0",(100),(100),(200),(350)))
!!!!!
var HPIC&=CREATE("hNewPic",64,64,$FFFFAA)
var HDSK&=CREATE("text",HMYWND&,"",,,$FFFF,$FFFF)
!!!!!
var HSTATBAR&=CREATE("statusWindow",HMYWND&,"Bereit.")
USERMESSAGES $0010,$0014
MYWND.RESIZING()
call(__cf1&,HMYWND&,-12,call(__cf2&,,32512))
SUBCLASS HMYWND&,1
call(__cf3&,HMYWND&,55100,100,)
call(__cf3&,HMYWND&,55101,500,)
WHILE 1
WAITINPUT
SELECT %UMESSAGE
CASEOF $0010
SELECT %MWND
CASEOF HMYWND&
BREAK
ENDSELECT
ENDSELECT
ENDWHILE
call(__cf4&,HMYWND&,55100)
call(__cf4&,HMYWND&,55101)
__xpse__endofprogram__
proc SUBCLASSPROC
SELECT SWND
CASEOF HMYWND&
SELECT SMESSAGE
CASEOF 532,$0005
MYWND.RESIZING()
CASEOF $0113
SELECT SWPARAM
CASEOF 55100
DEMO(1)
CASEOF 55101
DEMO(2)
ENDSELECT
ENDSELECT
ENDSELECT
endproc
proc MYWND.RESIZING
SETWINDOWPOS HSTATBAR&=0,0 - 0,0
DEMO(1)
DEMO(2)
endproc
proc DEMO
PARAMETERS MODE&
SELECT MODE&
CASEOF 1
STARTPAINT HMYWND&
USEPEN 0,,RND($FFFFFF)
!!!!!
LINE 10,10 - 200,43
ENDPAINT
CASEOF 2
STARTPAINT HMYWND&
TEXTCOLOR RND($FFFFFF),call(__cf5&,15)
DRAWTEXT 10,10,&GETTICKCOUNT
ENDPAINT
ENDSELECT
endproc
__xpse__endofprogram__
|
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 08/31/08 ▲ |
| |
| | | Ähä, the neuste XPSE (but hierbei already one XPSE the explicit older his can) gives but subesquent code CompileMarkSeparation
proc __xpse__endofprogram__
PARAMETERS exitcode&
REM {{SOMEEXTRAENDCOMMAND}}
case %pcount=1 : end exitcode&
end
endproc
DECLARE __cf1&,__cf2&,__cf3&,__cf4&,__cf5&
Def __cf1(2) !"KERNEL32","GetProcAddress"
Def __cf2(1) !"KERNEL32","GetModuleHandleA"
__cf1&=__cf1(__cf2("user32.dll"),"SetClassLongA")
__cf2&=__cf1(__cf2("user32.dll"),"LoadCursorA")
__cf3&=__cf1(__cf2("user32.dll"),"SetTimer")
__cf4&=__cf1(__cf2("user32.dll"),"KillTimer")
__cf5&=__cf1(__cf2("user32.dll"),"GetSysColor")
WINDOWSTYLE 80 | 512 | 1024
WINDOW %MAXX,%MAXY - 0,0
SHOWWINDOW(%HWND,0)
WINDOWSTYLE 1 | 2 | 4 | 8 | 16 | 512
!!!!!
var HMYWND&=(CREATE("WINDOW",(0),"Zuckertest 3.0",(100),(100),(200),(350)))
var HPIC&=CREATE("hNewPic",64,64,$FFFFAA)
var HDSK&=CREATE("text",HMYWND&,"",0,0,$FFFF,$FFFF)
!!!!!
var HSTATBAR&=CREATE("statusWindow",HMYWND&,"Bereit.")
USERMESSAGES $0010,$0014
MYWND.RESIZING(on class=s2>)
...
in the momentum type I yet hereon the You vlt. a but already into months gekommenen XPSE using!?? |
| | | | |
| | | | - Page 2 - |
| | Jörg Sellmeyer | in the momentum I get the To see, if I XPSE starte:
yesterday runtergeladen.
[offtopic]the feature with the Dateibrowser, if I into area "Datei on Posting anhängen" click, is Yes integrally nice. now can I but nothing More by Tasttatur or Strg + V prompt. [/offtopic] |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 08/31/08 ▲ |
| |
| | | The dialog is too normal - comes with eachone (first of all strangers) File if the windows-Dateisystem The File not as "eigene" recognize - has with xpse self but nothing To do. The XPSE-Version get You out if you XPSE simply time with Program, or in the CMD launch.
[offtopic] Jörg Sellmeyerthe feature with the Dateibrowser, if I into area "Datei on Posting anhängen" click, is Yes integrally nice. now can I but nothing More by Tasttatur or Strg + V prompt. this is no of my Erfindungen separate a the FireFox - there have I none Einfluss on it. FireFox "tut now so" circa it Angriffen - How z.B. unerwünschtes Upload through "scripts" - tougher To make. I find too pity the so z.B. one Strg+V only yet goes over "Durchsuchen" -> Strg+V -> {enter} [/offtopic] |
| | | | |
| | Jörg Sellmeyer | If XProfan the here knows: var HMYWND&=(CREATE("WINDOW",(0),"Zuckertest 3.0",(100),(100),(200),(350))) ,then is the In any accrue me vorbeigegangen. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 08/31/08 ▲ |
| |
| | | NULL as Parent-lever has imho nothing with XProfan to do, and naturally knows windows very I so my and reacted too correctly because it the window on 0 (root) prepares. what speaks against NULL as Fensterparent? |
| | | | |
| | Jörg Sellmeyer | Ah, if the so is. my XPSE-Version was objectively something antiquated. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 08/31/08 ▲ |
| |
| | | particularly with XPSE can I only over ands over again note the really no Update übergangen go ought to... |
| | | | |
| | Stefan M. Caillet | Hello iF, if You the now too yet so hinbekommst, that it too ausserhalb the waitinputs runs, have you got whom Substitute for The MSX-Interval Inc. greeting Stefan |
| | | Ich habe grosses Glück, weil ich Mitmenschen helfen darf. Entwicklungsumgebung: XProfan11 , Win XP Pro 32Bit , Win XP Home ,Win7 HomePremium 64Bit PC: P4/3GHz , 2GB RAM , 1700GB HD Laptop: Intel Core 2 Duo /2,2GHz , 4GB RAM , 500GB HD | 11/13/08 ▲ |
| |
| | | look time, yet plainer as The msx-interval.inc is the thread-unit [...] , both settle on The settimer-api on.
in the Difference only to msx-interval.inc is the thread-unit equips with something safety and manual distributed over Threads, but too these both items can The Absturzgefahr only decrease.
ProcAddr is momentarily for Enumerationsapis vorgesehen. it for setTimer To use, and yet ausserhalb the Waitinput, can always crashen, as long as XProfan the (yet) not explizit manage can.
look, self Rolands Implementation the SubClassings functions only WaitInput.
Sometime becomes Roland there ran must. |
| | | | |
|
Zum QuelltextTopic-Options | 11.342 Views |
Themeninformationenthis Topic has 5 subscriber: |