title: Handling drag and drop files in a running Windows console application
body: <p>First, to clarify, I am <em>not</em> asking how to drag-and-drop a file onto an exe's icon. I want to know how to handle drag and drop onto an <strong>already running</strong> win32 console application. I'm also <em>not</em> asking how to handle drag and drop inside of WinMain based applications through the Windows message pump. I want to do this inside of a program with the entry point <em>int main()</em> that doesn't have a WndProc (yet) or anything.</p>
  
  <p>That said, I'm wondering if my goal is achievable (and hoping that it is). </p>
  
  <p>I have a server application that is running within a console window. Due to a large codebase and a lot of weird coupling, it is an 'output only' console for all intensive purposes. Within it though, I can still handle things like key presses, as I have an update loop ticking. I'd like to be able to drag and drop files full of commands (which use a custom syntax) onto my running application and have it process them.</p>
  
  <p>Is this possible to do? I was thinking that potentially I could get a pointer to the HWND of the console (which hopefully is a thing?), and then maybe subclass that window to use a custom WndProc to listen for the WM_DROPFILES message. </p>
  
  <p>I've never really tried to set up handling of windows messages in an <em>int main()</em> program instead of a <em>WinMain</em> program, but I'm hoping it's somehow possible.</p>
  
  <p>Any help would be greatly appreciated! 
  <strong><em>Weird solutions are fine.</em></strong> </p>