title: Win32 current directory, locking & shell integration
body: <p>In Win32, your main thread's current working directory is set to the location the executable was launched from. My problem is that even after a call to <b>SetCurrentDirectory()</b> to somewhere else, the process apparently still has a filesystem object referencing this initial startup directory (verifiable with a tool like Process Explorer) - which means this director cannot be deleted by the process.</p>
  
  <p>Does anybody here know of a not-too-hacky solution? I'm specifically running into the problem with a program that integrates with explorer (adding a verb to HKCR\Directory\shell registry key), I need to process files in a right-clicked directory and the remove the source directory, which is impossible because the initial working directory is set to, you guessed it, the right-clicked directory.</p>
  
  <p><b>EDIT</b>: I'll go for the "use helper launch-from-sane-directory" approach. It might not be super elegant, but it will work and doesn't require any nasty hacks.</p>