If some application are open when you are shutting down Windows 7, such applications will be not be automatically terminated during shutdown. But you will be asked if you want to save your work. But if you find that this is not happening, you may have to do the following:
Type gpedit.msc in start search and hit enter to open the Group Policy Editor.
Navigate to Computer Configuration > Administrative Templates > System > Shutdown Options.
Now in the RHS pane, click on Turn off automatic termination of applications that block or cancel shutdown.
Click on Edit policy setting. From the window that opens you can enable or disable this policy.
This policy setting specifies whether Windows will allow console applications and GUI applications without visible top-level windows to block or cancel shutdown. By default, such applications are automatically terminated if they attempt to cancel shutdown or block it indefinitely.
If you enable this setting, console applications or GUI applications without visible top-level windows that block or cancel shutdown will not be automatically terminated during shutdown.
If you disable this setting, these applications will be automatically terminated during shutdown, helping to ensure that Windows can shut down faster and more smoothly.