title: Detect laptop lid closure and opening
body: <p>Is it possible to detect when a laptop's lid is open or closed?  From what I've read, this isn't possible, but SO has helped me with the impossible before.</p>
  
  <p>The only thing I've found that might be in the right direction is an <a href="http://blogs.msdn.com/b/doronh/archive/2006/09/08/746834.aspx" rel="noreferrer">MSDN blog post about IOCTLs needed to report power buttons</a>.  Is it possible to "sniff" these as the OS calls them?</p>
  
  <p>I'm using VB.NET, but will take suggestions in any language.  Thank you for your time and advice.</p>
  
  <p><strong>Edit</strong>: My software will be (eventually) overriding the actions (based on user preference) that occur when the lid is closed, so listening for suspend and other actions that typically occur when the lid is closed isn't an option.</p>