maximize/restore buttons
-
Hello! I have a great problem. I have done a view showing a bitmap. The view always fits the size of the bitmap. In the case, that the view is smaller than the bitmap, scrollbars are shown to scroll over the bitmap. Now I want to implement the maximize functionality that way, that pushing the maximize button expands the view to fit the bitmap only, but not to the size of the mainframe window. How can I implement this functionality. I already catched the corresponding messages in OnSysCommand and I can resize the view to fit the bitmap, but I can not change the maximize button to the restore button. Is anyone out there who can help? Many thanks in advance. Peter from Vienna pmrainer
-
Hello! I have a great problem. I have done a view showing a bitmap. The view always fits the size of the bitmap. In the case, that the view is smaller than the bitmap, scrollbars are shown to scroll over the bitmap. Now I want to implement the maximize functionality that way, that pushing the maximize button expands the view to fit the bitmap only, but not to the size of the mainframe window. How can I implement this functionality. I already catched the corresponding messages in OnSysCommand and I can resize the view to fit the bitmap, but I can not change the maximize button to the restore button. Is anyone out there who can help? Many thanks in advance. Peter from Vienna pmrainer
There are a number of ways to do this. You can turn OFF the maximise button in the view window, you could capture WM_SIZE and when the window gets a message to size bigger than the bitmap you could make it size to just the bitmap, or you could just allow the maximising and centre the bitmap. Christian As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet. Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
-
Hello! I have a great problem. I have done a view showing a bitmap. The view always fits the size of the bitmap. In the case, that the view is smaller than the bitmap, scrollbars are shown to scroll over the bitmap. Now I want to implement the maximize functionality that way, that pushing the maximize button expands the view to fit the bitmap only, but not to the size of the mainframe window. How can I implement this functionality. I already catched the corresponding messages in OnSysCommand and I can resize the view to fit the bitmap, but I can not change the maximize button to the restore button. Is anyone out there who can help? Many thanks in advance. Peter from Vienna pmrainer
Handle WM_GETMINMAXINFO. Use AdjustWindowRect[Ex] in the handler to compute frame size based on bitmap size. Tomasz Sowinski -- http://www.shooltz.com