I have an MFC dialog application that needs to stop the Windows Wifi service to work correctly, but I want to turn it on again when my application exits.
So, I thought I would put in code that will restart the service in the destructor of the main dialog class.
Now it occurred to me that others are using their own code, which should be run during program termination in a message handler WM_CLOSE.
WM_CLOSE
Both methods seem to work, but I would like to know if there are any flaws anyway.
MFC InitInstance, DoModal. MFC (MDI, SDI) ExitInstance.
InitInstance
DoModal
ExitInstance
SDI/MDI , InitInstance FALSE, - DoModal.
ExitInstance , .
Edit. , WM_DESTROY ( ) , WM_CLOSE. WM_CLOSE , , " ? - ". , , WM_CLOSE WM_DESTROY . , , Windows .
WM_DESTROY
: wifi , . InitInstance, ExitInstance; WM_CREATE - , WM_CLOSE ..
WM_CREATE
, , / .
InitInstance ExitInstance, Windows, WM_CLOSE, , , , .