English
Source / code snippets

secure Subclassproc Threads Timer

 
- 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

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



 
- 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)
 
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  
 



 
- 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]

30 kB
Hochgeladen:08/31/08
Downloadcounter225
Download
 
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 Sellmeyer
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.


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




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




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




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.
 
11/13/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.342 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