Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6598115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:17:54+00:00 2026-05-25T18:17:54+00:00

VMWare Workstation does something quite cool when I try to shutdown Windows while a

  • 0

VMWare Workstation does something quite cool when I try to shutdown Windows while a Virtual Machine is running:

VMWare prevents Windows shutdown with a custom message

Normally, we’d see a “This program is preventing Windows from shutting down” message instead of the new “1 Virtual Machine is in use”.

How does VMWare do this? I haven’t been able to find any APIs about it on Google.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:17:54+00:00Added an answer on May 25, 2026 at 6:17 pm

    You can read all about the changes introduced in Vista here. You really should read that article very carefully.

    The APIs you are looking for are ShutdownBlockReasonCreate, ShutdownBlockReasonDestroy and ShutdownBlockReasonQuery. Remember that these APIs are only available on Vista/2008 server up. You’ll have to implement fall back behaviour on 2000/XP.

    If you need to block shutdown you call ShutdownBlockReasonCreate passing the handle to your main window and the reason as a string. This string is what is displayed in the shutdown blocked dialog, i.e. “1 virtual machine is in use” in your screenshot.

    If the operation that blocks shutdown completes then you call ShutdownBlockReasonDestroy.

    Note that you must still implement WM_QUERYENDSESSION to make all the pieces fit together. This is the part that actually blocks the shutdown.

    On XP you should also respond to WM_ENDSESSION and if your app blocked shutdown it is polite to show a message indicating why. If you don’t do so then the user is left scratching his/her head as to why the computer is ignoring the instruction to shutdown.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VMware virtual machine running Windows 2008 Standard and I would like
We're running the latest versions of VMWare Player and Workstation for Windows. The following
I'm running some virtual machines using VMware workstation on my PC (using win 7),
I'm running VMWare Workstation on Ubuntu 10.10. I have a series of virtual machines
I am using VMware Workstation 6.5 on Windows Vista x64. I would like to
I am using VMware Workstation 6.5 on Windows Vista x64. I am trying to
I have a VmWare virtual machine that is coming dangerously close to it's primarry
Is it possible that, on my Windows machine, I get the vmware player and
I have installed Windows Server 2008R2x64 under VMWare Workstation, to test installation of my
I am working on Ubuntu 9.04. I am running this on VMware workstation. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.