English
Forum

Done: SubClassProc per Return leave?

 
- Page 1 -



Uwe
''Pascal''
Niemeier
Hi people (particularly Roland)!

the Subject sagts already: Can a SubClassProc per Return leave and thereby values give back??
at least, if one before Set(WinProc,0) einsetzt?

The Help isn't there very informativ

BTW: when very must Set(WinProc,n) and Set(SubClassMode,n) at all applied go?
from the Set-functions be I it dwelt, that these more or less globale Settings distinguished and mostly at the beginning the Program stand...

I knabbere namely still on the CUSTOMDRAW for diverse Controls...

...more data necessary...
Pascal
 
03/06/09  
 



 
- Page 1 -



RGH
Hi,

i will time try, it something rather as in the Help explain:

Set(WinProc, n%)
(n = 0 or 1)

each Fensterin windows has a Fensterprozedur, The for the Edit all Messages zuständig is, The on the window skillful go. These becomes in the rule mitder jeweiligen Fensterklasse set. usually there for most windows-Messages a windowseigene Standardbehandlung. These sorgt to that example at pressing the tab-Button for, that the Focus in that next Dialogelement goes, without that one it eigens in the pertinent Windowsprozedur program should. others Messages go though in the Fensterprozedur treats. The Normalfall is means, that for all Messages, The not in the Fensterprozedur treats go, The Standardbehandlung called becomes.

with Subclassing becomes now The ursprüngliche Windowsprozedur through our Own Windowsprozedur supplant. in lieu of the for Fensterklasse defined Fensterprozedur becomes now our procedure called. in the rule use we Subclassing but only, circa some Special Messages of/ one Spezialbehandlung To unterziehen and the remainder should really so functions How dwelt. here comes Set(WinProc,...) in that game: If WinProc at leave the SubProc on 1 standing, becomes subsequently The ursprüngliche Windowsprozedur called, anderenfalls even not. in the Normalfall becomes one WinProc then on 0 settle, if The Message in the SubClassProc treats watts, otherwise even on 1.
(In some Make can it however too sense make too with reaction on The Message nevertheless yet The Windowsprozedur for these Message aufzurufen. therefore can the Programmer with the the Set-function spare to determine.)

Return in SubClassProc
Yes, Return can (and must in some Make) akin go. Return certainly whom Return Value the Message. with whom most Messages, The a Window skillful go, game the Return Value no role, with some but a integrally vastly! this is then Help to jeweiligen Message To entnehmen, about if over a Message angefragt becomes, whether the window closed go can. One Returnwert power but only then sense, if WinProc on 0 standing, there Yes otherwise The subsequently aufgerufene Original Fensterprozedur whom Return Value certainly.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
03/06/09  
 




Uwe
''Pascal''
Niemeier
Hi people!

@ iF:


would be plainer if one by return 0 or 1, WinProc 0 or 1, settle could - as usually so (almost) too is.


at least wären suitable Special Rücksprungbefehle from the Syntax since einleuchtender been...


CustomDraw/OwnerDraw with XProfan11 by SubClassProc becomes unfortunately not correctly functions can, because in the rarest drop instructions The one Repaint trigger, in the SubClassProc (means in the WaitInput) triggered go, separate even ausserhalb waitInput - where however The Zeichnungsmessages lost weg.


therefore Yes my suggestion, the ProcAddr-behaviour as SubClass-mode einzuführen

where I - How you know - not the opinion be, SubClassing by ProcAddr would dangerous (at best during the development, if one not yet very white, what does).
some programs of me benefit this until Exzess (self for my Maßstäbe!) and are since years in the daily Dauereinsatz.
me fuming only, that XProfan 11 something like fundamentally installed has what about me not running wars...

@ Roland:


One Returnwert power but only then sense, if WinProc on 0 standing, there Yes otherwise The subsequently aufgerufene Original Fensterprozedur whom Return Value certainly.


so I thought me the.

in my case ought to it so his, that a defined Return windows veranlaßt, The Proc anew with modified Parameters aufzurufen, what but apparently not the case is...

old with ProccAddr:
window 10,10-500,500
 $H Messages.ph
 $H windows.ph
 $H commctrl.ph
var Lv&=create(gridbox,%hwnd,Test;0;150,0,200,10,200,200)
addstring(Lv&,Test1)
addstring(Lv&,Test2)
declare LvDraw#
struct LvDraw= HwndFrom&,idFrom&,Code&,DrawStage&,remainder#(44)
dim LvDraw#,LvDraw

proc LvProc--------------------------------------------------------

    parameters wnd&,msg&,wparam&,lparam&

    if msg&=~WM_NOTIFY

        LvDraw#=lparam&

        if LvDraw#.Hwndfrom&=Lv&

            if LvDraw#.Code&=~NM_CUSTOMDRAW

                if LvDraw#.DrawStage& = ~CDDS_PREPAINT

                    print PREPAINT recognized
                    return ~CDRF_NOTIFYITEMDRAW

                elseif LvDraw#.DrawStage& = ~CDDS_ITEMPREPAINT

                    print ITEMPREPAINT recognized

                endif

            endif

        endif

    endif

    return ~DefWindowProc(wnd&,msg&,wparam&,lparam&)
    endproc-------------------------------------------------------------
    set(fastmode,1)
    ~SetWindowLong(%hwnd,~GWL_WNDPROC,procaddr(LvProc,4) )

    while 1

        waitinput

    endwhile


New with SubClass:
window 10,10-500,500
 $H Messages.ph
 $H windows.ph
 $H commctrl.ph
var Lv&=create(gridbox,%hwnd,Test;0;150,0,200,10,200,200)
addstring(Lv&,Test1)
addstring(Lv&,Test2)
declare LvDraw#
struct LvDraw= HwndFrom&,idFrom&,Code&,DrawStage&,remainder#(44)
dim LvDraw#,LvDraw
subclassproc--------------------------------------------------------

if %smessage=~WM_NOTIFY

    LvDraw#=&slparam

    if LvDraw#.Hwndfrom&=Lv&

        if LvDraw#.Code&=~NM_CUSTOMDRAW

            if LvDraw#.DrawStage& = ~CDDS_PREPAINT

                print PREPAINT recognized
                set(subclassmode,1)--???
                set(winproc,0)-------???
                return ~CDRF_NOTIFYITEMDRAW

            elseif LvDraw#.DrawStage& = ~CDDS_ITEMPREPAINT

                print ITEMPREPAINT recognized--here comes nothing More on!

            endif

        endif

    endif

endif

endproc-------------------------------------------------------------
SubClass %hwnd,1

while 1

    waitinput

endwhile


Perhaps see so did i only whom woods not sheer trees?

SeeYou
Pascal
 
03/07/09  
 




RGH
Uwe Pascal Niemeier
Perhaps see so did i only whom woods not sheer trees?


... ähem ... there lying objectively one bow to, the whom Return Value verhinderte ...
the RETURN remaining in SUBCLASSPROC wirkungslos.

Sorry!
I see already, the next Bugfix comes certainly. it'll well soon one XProfan 11.2 give.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
03/07/09  
 




Jac
de
Lad
becomes there possible too the others here angesprochene with adjusted?
 
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
03/07/09  
 




RGH
Jac
becomes there possible too the others here angesprochene with adjusted?


What exactly mean You so?
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
03/07/09  
 




Jac
de
Lad
Subclassing outside of Waitinput and with the ProcAddr.
 
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
03/08/09  
 



Uwe Pascal Niemeier
where I - How you know - not the opinion be, SubClassing by ProcAddr would dangerous (at best during the development, if one not yet very white, what does).

some programs of me benefit this until Exzess (self for my Maßstäbe!) and are since years in the daily Dauereinsatz.


OK hör time, for dangerous stops I not gladly because it blockiert me integrally vastly and so I seither circa Stack bettle.

only theoretical for dangerous held I it initially as i tried me vorzustellen How the resolved watts, or. because here and there always time a small Info coming as because resolved be.

unfortunately has not only in simplest Tests herausgestellt (I faith we'd the already meaty), that objectively with one appeal of/ one with ProcAddr-bezogenen function, if XProfan z.B. not in the WaitInput befindet, it integrally simply and not only by me not at all seldom knallt.

The Error come then always How from the breeze and are seldom nachvollziehbar or. beziehbar the ProcAddr-trouble.

After (then still years of) (stubborn) nachkratzen having Roland - of my view to - the trouble too confirm and verwiesen the even a with ProcAddr-bezogene function for z.B. ENum-Apis virtual is - means if XProfan standing or. wait or itself even in the WaitInput befindet.

objectively had I terrific plenty paraphrase on software so even no unerklärlichen Abstürze More occur - seither my StackGebettel.

Auuuch if z.B. one Program the ProcAddr on dangerous point uses, then is the long ago not, that it always knallt. The thing is imho even so komplex, that one say can, that it systems forsaking them it then constantly knallt and it systems gives, with them it so well How never Knallt.

both systems have I here in Vorhaltung and so I ums ver** no ProcAddr dangerous use because me unerklärliche Abstürze horrend plenty Time and nerves cost[ed] had - and who building already gladly on Zuckerstäben*.

*) ausgenommmen (naturally) The Fraggles

what I do not so dolle find is, that Roland - because gefährliches procAddr nunmal not always crashes - not clear says, that it from the Use of ProcAddr dissuade would except for gedachten drop the EnumApis or. if XProfan standing. anyway could I me then plenty Gesabbel save what imho none (More) listen will; mag; muss; kann; custom.

circa it figurative To make position Roland imho z.B. the following not sure:

|MARKE|Print 1+5+meineFunktion()+5+2
|MARKE|andereFunktion(solala)*primadoll

would be The angecallte function z.B. only |MARKE| process obtain, would the trouble explicit schmächtiger.

in the actually drop can The gecallte function imho but in the middle in the 1+5+here or in the middle in meineFunktion(here)+5 or otherwise mittendrin carryed out go, what naturally, if one it itself vorstellt, not at all safe his must - considerate one z.B. a delTree-function which at a single blow one Call missed get woraufhin itself then something changes. : - /

naturally can here each Detailinfo from the reality - The well only Roland kennen likes - deviation, naturally are the solely my Beurteilungen The Roland (Please!) in the breeze zerfetzt for wrong declared.
 
03/09/09  
 




Jac
de
Lad
my unqualifizierter comment:

lying not on it, that several Procs then at the same time try on same things, z.B. variables access? the would explain, why I never Problems with ProcAddr() having (SetTimer and so), because I the mostly only use, circa in the Statuszeile The Uhrzeit and z.B. whom Speicherverbrauch anzugeben, the comes even not others functions in that enclosure.
 
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
03/09/09  
 



So less worn out go must... but imho is self one return in line 1 the Proc dangerous.

Nachtrag: is well Wurstbrot how much worn out becomes, Daufruf self is imho sooner the trouble.
 
03/09/09  
 



here an example which with alike welchem WhileLoop-Parameter not to judder might if it because geregelt would.

The anhängige Screenshot shows, that not each row described becomes.

because of the fact, that naturally 10ms vergleichbar Jahrzehnte are, arise the Error only relatively seldom.

turn one whom WhileLoop-Parameter something higher vlt. even until Exzess, so becomes The application always Lustiger react up to jolly crash...

Well, missing the Line break... lying hold on the Print isn't my attitude.

8 kB
Hochgeladen:03/10/09
Downloadcounter140
Download
1.025 kB
Hochgeladen:03/10/09
Downloadcounter74
Download
 
03/10/09  
 



 
- Page 2 -



Uwe
''Pascal''
Niemeier
Hi iF!

As I said, I can the so not confirm. (and my programs walk thoroughly not only on my computer - if this Eindruch emerged his ought to )

Perhaps lying it on the manner, How I these engineering einsetze.
here time integrally roughly my üblicher Programmaufbau:

might me present, that the in Profan integrally similar looks what about me therefore so integrally well drove be.
but i think time, the must not further chasing go
(especially since I of Stacks etc. not really Idea have => by doing)

BTW: can me on a drop remind, where I in a WndProc a Standartvariable (a&) inserted having, without these pub To deklarieren.
then have I two hours long attempts rauszukriegen, Why these sch... Variable in the Hauptprogramm constantly completely unmotiviert any values encompassed...

SeeYou
Pascal
 
03/12/09  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.159 Views

Untitledvor 0 min.
Sven Bader07/03/23
H.Brill06/06/21
Jörg Sellmeyer05/15/18
rquindt08/27/16
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