Source / code snippets | | | | | 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
}
|
| | | | |
| | Frank Abbing | What exactly to the code demonstrating? The line and the Text malen incidentally into Statusbar into... |
| | | | |
| | | The code demonstrating The SetTimer-Api without ProcAddr separate over Messages which in the SubClassProc worn out go (can). The code shows the too to this secure take action self then gezeichtet go can, if z.B. the window strain moved becomes. none needed means really procAddr on the Timer. is only an example I imho already a couple Male posted having - but over ands over again somehow (too of me) not found becomes if it hereon ankommt. |
| | | | |
| | Jac de Lad | the goes but imho only, if itself the Prog in a waitinput rumlungert... |
| | | Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 08/30/08 ▲ |
| |
| | Frank Abbing | I see, ok. I recommend, a couple short Notizen to a something grösseren Codesnippet beizupacken. Dass the User at least knows, what It's all right, without whom whole code anlysieren To must. |
| | | | |
| | Jörg Sellmeyer | Also are in the 2. code a couple Error drin, The (at least by me) not of XPSE korrigiert go - if the at all vorgesehen his ought to...:
createWindow(,"Zuckertest 3.0",100,100,200,350) usePen 0,,rnd($FFFFFF) |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 08/30/08 ▲ |
| |
| | | | | | | |
| | Jörg Sellmeyer | createWindow(,"Zuckertest 3.0",100,100,200,350) no %hwnd usePen 0,,rnd($FFFFFF) missing one Parameter |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 08/31/08 ▲ |
| |
| | | 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!?? |
| | | | |
|
Zum QuelltextTopic-Options | 11.389 Views |
Themeninformationenthis Topic has 5 subscriber: |