Need to catch WM_CREATE event with all parameters. Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
extream
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Jun 08, 2022 8:00 am

Need to catch WM_CREATE event with all parameters.

Post by extream »

Hi! I need to catch WM_CREATE event with all parameters (message, lParam, wParam) in wxFrame based class. I tried override MSWWindowProc but this not help me. First message that MSWWindowProc receives is WM_SHOWWINDOW.
User avatar
doublemax@work
Super wx Problem Solver
Super wx Problem Solver
Posts: 474
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: Need to catch WM_CREATE event with all parameters.

Post by doublemax@work »

Try this one:

Code: Select all

    virtual bool MSWHandleMessage(WXLRESULT *result,
                                  WXUINT message,
                                  WXWPARAM wParam,
                                  WXLPARAM lParam);
extream
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Jun 08, 2022 8:00 am

Re: Need to catch WM_CREATE event with all parameters.

Post by extream »

Thanks for you reply. But unfortunately calling this function has the same effect.
User avatar
doublemax@work
Super wx Problem Solver
Super wx Problem Solver
Posts: 474
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: Need to catch WM_CREATE event with all parameters.

Post by doublemax@work »

I just tested it, you need to use two-step window creation to get the WM_CREATE msg. Then it will probably also work with MSWWindowProc.

Instead of:

Code: Select all

wxFrame *frame = new wxFrame(NULL, wxID_ANY, title);
Use:

Code: Select all

wxFrame *frame = new wxFrame();
frame->Create(NULL, wxID_ANY, title);
Last edited by doublemax@work on Tue Oct 04, 2022 7:10 am, edited 1 time in total.
extream
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Jun 08, 2022 8:00 am

Re: Need to catch WM_CREATE event with all parameters.

Post by extream »

doublemax@work wrote: Tue Oct 04, 2022 7:03 am you need to use two-step window creation to get the WM_CREATE msg
How to do it. Can I have an example please.
Last edited by extream on Tue Oct 04, 2022 7:10 am, edited 1 time in total.
User avatar
doublemax@work
Super wx Problem Solver
Super wx Problem Solver
Posts: 474
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: Need to catch WM_CREATE event with all parameters.

Post by doublemax@work »

extream wrote: Tue Oct 04, 2022 7:10 am
doublemax@work wrote: Tue Oct 04, 2022 7:03 am I just tested it, you need to use two-step window creation to get the WM_CREATE msg. Then it will probably also work with MSWWindowProc.
How to do it. Can I have an example please.
See my edited code above.
extream
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Jun 08, 2022 8:00 am

Re: Need to catch WM_CREATE event with all parameters.

Post by extream »

doublemax@work wrote: Tue Oct 04, 2022 7:10 am See my edited code above.
Thanks, now this is working!
Post Reply