English
Source / code snippets

secure Subclassproc Threads Timer

 
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

458 kB
Hochgeladen:08/30/08
Downloadcounter163
Download
 
08/30/08  
 




Frank
Abbing
What exactly to the code demonstrating?
The line and the Text malen incidentally into Statusbar into...
 
08/30/08  
 



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.
 
08/30/08  
 




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.
 
08/30/08  
 




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  
 



where is the Error?
 
08/31/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)
 
08/31/08  
 



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.
 
08/31/08  
 




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!??
 
08/31/08  
 




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

11.362 Views

Untitledvor 0 min.
Walter12/30/22
RudiB.02/16/22
Tango08/06/21
Jörg Sellmeyer06/16/20
More...

Themeninformationen



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