Click here to Skip to main content
15,891,951 members

Comments by Tejas Shastri (Top 60 by date)

Tejas Shastri 26-Oct-14 3:03am View    
Please leave an answer with the above link.. I will accept solution..
Tejas Shastri 26-Oct-14 3:02am View    
Thanks a lot for the link bill :) I fixed it.. :)
Tejas Shastri 26-Oct-14 2:57am View    
I'm using a thread because it takes too much time for the messagebox to show up.. response time is faster with a thread..
Tejas Shastri 25-Oct-14 16:51pm View    
var thread = new Thread(() => { //MessageBox.Show(pressedKey);
if(pressedKey.Equals("Space")||pressedKey.Equals("Tab"))
{
System.Windows.Forms.Clipboard.SetText(pressedKey);
IDataObject key = Clipboard.GetDataObject();
string mykey = key.GetData(DataFormats.Text).ToString();
MessageBox.Show(mykey);
}
});
new Thread.ApartmentState = ApartmentState.STA;
new Thread.Start();

Gives me error:
Error 1 A new expression requires (), [], or {} after type (this is for the line :newThread.ApartmentState = ApartmentState.STA;)

Error 2 'System.Threading.Thread.ApartmentState' is a 'property' but is used like a 'type'
Error 3 'System.Threading.Thread.Start(object)' is a 'method' but is used like a 'type'
Tejas Shastri 20-Oct-14 12:30pm View    
Can you please check my code and see if there's a way to pass the string pressedkey from the method HookCallback to ThisAddIn_Startup.. thats the only problem..