Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Destroying properly of the frame window appearing from an application Collapse All
Subject Author Date
howard liu Jul 10, 2008 - 1:18 AM

Hi,


I have a frame window appearing through the click of one of the menu items in my application. This frame window  has several controls and a close/cancel button. When i click this close/cancel button the frame window as well as the application gets closed. Ideally this should only close the frame window and not the application. This is happening after the prof-ui implementation over the frame window.


Is there a procedure from prof-ui to destroy / close only the frame window 


Thanks,


Howard


 


 

Technical Support Jul 10, 2008 - 1:46 PM

The skinned desktop windows are working exactly in the same way as default looking desktop windows. Click on the "X" button in window caption causes sending of the WM_SYSCOMMAND message with SC_CLOSE value in WPARAM. The default window procedure handles this message and sends WM_CLOSE message which notifies window that it should destroy itself. If you want only hide your window without destroying it, then you should handle the WM_CLOSE message and make window hiding itself without delivering WM_CLOSE message to parent class method/default window procedure.

The main thread/application class in MFC runs message loop until the main window exist. When the main window is destroyed, the application stop running thread message loop and exits. It’s not cleanly described in your message which window in your application is main. We need more details.