delphi - Setting up a WH_CALLWNDPROC hook prevents WM_HELP propagation in deep hierarchies -


when pressing f1 key, win32 api first sends appropriate key message sends wm_helpmessage control has focus. not process it, gets sent parenting chain way form reacts message. in delphi (xe7) happens because of calls callwindowproc inside vcl.controls.twincontrol.defaulthandler

while works fine in pretty locations inside applications, there 1 place wm_help never reaches top form. trying reproduce it, came test application may find here:

http://obones.free.fr/wm_help.zip

after having built application , started it, place focus inside in sublevel or level 1 edits , press f1. see wm_help caught form.

now, if same inside in sublevel2 or level 15 edits see nothing logged, form never sees wm_help

tracing in vcl found out deep levels, calls callwindowproc inside vcl.controls.twincontrol.defaulthandler returns on 1 of controls in hierarchy, preventing form ever receiving message.

however, couldn't figure out why win32 api code thinks should not propagate message anymore, except 1 thing: if remove wh_callwndproc hook, normal. can see effect of disabling if uncheck use hook checkbox.

now, 1 argue shouldn't have such deep hierarchies of components, , agree. however, structure in center 2 frames inside 1 directly inspired what's in application noticed issue.

this means can quite easy trigger problem without noticing it. hopefully, in case, can remove few panels , go below limit.

but did encounter situation before? if yes, able solve it? or known behavior of win32 api?

this caused "windows kernel stack overflow" happens if send window messages recursively. on 64 bit windows kernel stack overflow happens faster on 32 bit windows.

this bug caused vcl not resize nested controls correctly before got fixed changing recursive aligncontrols code (my) iterative version (more stack overflow: http://news.jrsoftware.org/news/toolbar2000/msg07779.html)


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -