Menu

#1152 Common Window Procedure stack underflow

3.0 Alpha Series
open
nobody
5
2016-12-30
2016-08-02
andry81
No

If try to use a common window procedure for all controls in the page then the Window Procedure could receive different number of parameters by the stack.

For example, mouse move over ListView forms 3 parameters in the stack per event, when the RadioBatton click (NSD_Check) or NSD_SetText w/ empty text - only 1!
The same things happens for SendMessage calls.

This all leads to terrible things like randomly stack underflow in random places after System::Store SR0R1R2R3 from Window Procedure has called.

I've used CommCtr.nsh library (http://nsis.sourceforge.net/Header_file_for_Listview) to handle the ListView, but seems the system sends such events itself.

Why you just does not to put always 4 parameters at the stack (as Win32 API does), even if they empty?

Discussion

  • Anders

    Anders - 2016-12-30

    Why would you want the same window procedure for different types of controls?

    nsDialogs is a very thin wrapper on top of Win32 but not that thin...

     

    Last edit: Anders 2017-06-12
    • andry81

      andry81 - 2016-12-30

      Because i want to process all messages from a page in a single procedure just like in raw Win32 applications. It makes code more clean and readable.

       

      Last edit: andry81 2017-01-04

Log in to post a comment.