Author Topic: WndProc gets no messages for several seconds  (Read 2554 times)

jj2007

  • Member
  • *****
  • Posts: 9687
  • Assembler is fun ;-)
    • MasmBasic
WndProc gets no messages for several seconds
« on: April 12, 2014, 06:43:07 PM »
Hi folks,

I've run into a weird problem with my RTF editor: Sometimes it hangs for several seconds. Monitoring messages in WndProc, SubEdit and SubList shows clearly that during this phase, neither the main window nor the kids receive any messages.

Any ideas what could cause this behaviour? I wouldn't ask if I had not been chasing this bug for several nights ;-)


msg LIST        chg:msgCount    1711    uMsg = WM_NCPAINT
msg MAIN        chg:msgCount    1712    uMsg = WM_ERASEBKGND
msg EDIT        chg:msgCount    1713    uMsg = WM_GETTEXT

msg
MsgDuration             22687   <<<< 22 seconds no activity!!
chg:msgCount    1714
uMsg = WM_HELP

msg EDIT        chg:msgCount    1715    uMsg = WM_NCPAINT
msg MAIN        chg:msgCount    1717    uMsg = WM_CTLCOLORLISTBOX

sinsi

  • Member
  • *****
  • Posts: 1182
Re: WndProc gets no messages for several seconds
« Reply #1 on: April 12, 2014, 07:22:51 PM »
Best guess? Network access. Use sysinternals process monitor to see.

C'mon jj, post some code please. Psychic powers are non-existent on a Saturday night...
I can walk on water but stagger on beer bourbon.

jj2007

  • Member
  • *****
  • Posts: 9687
  • Assembler is fun ;-)
    • MasmBasic
Re: WndProc gets no messages for several seconds
« Reply #2 on: April 12, 2014, 09:04:25 PM »
Best guess? Network access. Use sysinternals process monitor to see.

Doesn't seem so, but will keep that in mind, thanks.

Quote
C'mon jj, post some code please. Psychic powers are non-existent on a Saturday night...

15,000+ lines of MasmBasic, are you sure??

This is how I test it:

WndProc ...
   invoke GetTickCount
   mov rticks(uMsg), eax
... handlers ...
   invoke CallWindowProc, ...
   invoke GetTickCount
   xchg eax, ecx
   sub ecx, rticks(uMsg)
   .if ecx>1000
      deb 1, "msg RE", chg:msgCount
     .endif

And deb 1 does not pop up, i.e. the ten seconds delay happens outside the WndProc :(

sinsi

  • Member
  • *****
  • Posts: 1182
Re: WndProc gets no messages for several seconds
« Reply #3 on: April 12, 2014, 09:18:02 PM »
So can I reproduce it? What are the steps?
I can walk on water but stagger on beer bourbon.

jj2007

  • Member
  • *****
  • Posts: 9687
  • Assembler is fun ;-)
    • MasmBasic
Re: WndProc gets no messages for several seconds
« Reply #4 on: April 12, 2014, 09:53:57 PM »
- download and install
- when reading The smallprint: this library is provided..., click on Try one more
- when the new source is open, click in the task bar on MbGuide to go back to the first document
- and voilĂ , it should hang for several seconds, and then MbGuide appears again.

What is odd is that very old versions (>6months) behave exactly the same. I start wondering if it was a good idea to let Windows do the last 30+ updates since October 2013...

P.S.: I found the culprit - the ten seconds default timeout of Launch. No messages while the OS is waiting...

One day I'll have to buy a Win8 puter, just to test why you could these strange menus. For me it works like a charm...
« Last Edit: April 14, 2014, 11:53:48 PM by jj2007 »