I wrote a small sample of code in C# to capture selected text from other applications: SendKeys.SendWait("^c"); string searchedText = Convert.ToString(Clipboard.GetText());
my problem is its not working if i captured text from the browser Chrome anyone know why this happen or if there is another way to do the same task
UPDATE
I am doing this application to capture selected text from any other application and save it in a file when the user press a hot key.
protected override void WndProc(ref System.Windows.Forms.Message m)
{
// let the base class process the message
base.WndProc(ref m);
// if this is a WM_HOTKEY message, notify the parent object
const int WM_HOTKEY = 0x312;
if (m.Msg == WM_HOTKEY)
{
SendKeys.SendWait("^c");
string searchedText = Convert.ToString(Clipboard.GetText());
Save(searchedText);
Clipboard.Clear();
}
}