title: How to Grab dll message-dispatching procedure and redirect to python stdout?
body: <p>I'm trying to figure out how to proceed and if it is feasible or not in general.</p>
  
  <p>I working with external DLL to control my mechanical delay line.</p>
  
  <p>This API has it internal procedure for message output in separate window. I have a strong desire to catch this message flow and present in my python (PyQT5) written application.</p>
  
  <p>In API description there is a function:</p>
  
  <pre><code>int LS_SetProcessMessagesProc(void *pProc);
  </code></pre>
  
  <p>Function returns either 0 or 1, if there is no error or it is present, respectively.</p>
  
  <p>According to dll description 
  It enables the replacement of the internal message-dispatching procedure of the LStep API.</p>
  
  <p>The LStep API processes during waiting for confirmation of the LStep in the main-thread messages. If you want to switch of the Message-Dispatching or replace with your onw Code, you can use SetProcessMessagesProc for using a callback-procedure.</p>
  
  <p>pProc must be a pointer to a stdcall-procedure without a parameter:</p>
  
  <pre><code>void MyProcessMessages() {...}
  </code></pre>
  
  <p>Example:
  LS.SetProcessMessagesProc(&amp;MyProcessMessages);</p>
  
  <p><strong>As example if we take python stdout, how I can send the message to it?</strong></p>