Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I've an activex control with 4 splitters inside it.
Each splitter is having different controls (tree controls, list controls of type grid, buttons, exit boxes and test boxes).
I'm having a problem when i resize the window(i.e. when i click the restore button on the toolbar, the controls are not getting resized automatically, but after clicking restore button if i just drag(resize) the window using the mouse slightly, all the controls are resized properly)

Kindly help me out in fixing this problem.

Thanks,
Phani.
Posted

1 solution

A SetWindowPos call in your WM_SIZE message handler is all you should be needing.
 
Share this answer
 
Comments
Phaneendar 25-Aug-10 7:05am    
i tried SetWindowPos() in the OnSize() handler but it did not work.
Niklas L 25-Aug-10 7:20am    
But you DO end up there when restoring your window?
Phaneendar 26-Aug-10 1:16am    
Yes, every size change will end up in OnSize() but unfortunately, my controls are not getting resized on clicking restore button. I tried a work around for this, but it is working only for keyboard short cuts.
In the pretranslate message when we press alt+space+r for restore i'm posting a WM_SIZE message then it is working fine. same is the case with alt+space+x. but I'm struck in doing the same for mouse click on the restore button.
Niklas L 26-Aug-10 2:42am    
If I understood you:
1. You DO get a call to OnSize when restoring the window.
2. If you send a WM_SIZE message to the ActiveX control it will resize properly.
Are you sending the same width and height as it already has? In your OnSize, try setting a totally different size to the control, and see if that affects the update.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900