title: How can I get a selected text from another application?
body: <p>I trie to get a selected text from another application without use the clipboard. I have find the way to have the HWND from the active application but when I use EM_GETSELTEXT they are no text in the buffer.</p>
  
  <pre><code> char* shortcut::getSelectedText(){
    POINT mouse;
    if (GetCursorPos(&amp;mouse)){
    HWND window = WindowFromPoint(mouse);//get the HWND from the active application
      if (window != nullptr){
          char* buffer = new char[100];
          SendMessage(window , EM_GETSELTEXT, 0, LPARAM(buffer));
          return buffer;  
      }
      else{
          return "";
      }
    }
    else{
      return "";
    }
  }
  </code></pre>