Click here to Skip to main content
15,916,835 members

Comments by Abdullahomaid (Top 19 by date)

Abdullahomaid 28-Feb-11 10:54am View    
thank you useless man ,less take care about your writing. what is Is is??????????????????
look to ur following Is is .

Is is so difficult to take a look at MessageBox help?!
Abdullahomaid 13-Feb-11 1:56am View    
Deleted
thank you google.
Abdullahomaid 13-Feb-11 1:55am View    
Deleted
Thank you i get the solution
private AxAgentObjects.AxAgent activeXagent = new AxAgentObjects.AxAgent();
public Form1()
{
InitializeComponent();
this.Controls.Add(activeXagent);
}
that is the solution .
Abdullahomaid 13-Feb-11 0:20am View    
ok i am waiting to your help or idea.
thank you very much.
Abdullahomaid 12-Feb-11 6:06am View    
thank you SAKryukov,
this is the complete code:
problem:when i say something from the following grammar like(open Notepad,calculator...myDocuments)it is working .but when i say something out of those words that time also it give me out put one of the following grammar word.
using SpeechLib;
using IWshRuntimeLibrary;

namespace finalProject.Utils.Windows
{
public partial class Form1 : Form
{
SpeechRecognizer rec = new SpeechRecognizer();
public void Send(string keys, bool wait)
{
WshShell shell = new WshShellClass();
object wObj = wait;

shell.SendKeys(keys, ref wObj);
}
public void Send(string keys)
{
Send(keys, false);
}
public void SendWait(string keys)
{
Send(keys, true);
}
public Form1()
{
InitializeComponent();
rec.SpeechRecognized += rec_SpeechRecognized;
}

void rec_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{

textBox1.Text = e.Result.Text;
}

private void Form1_Load(object sender, EventArgs e)
{
var c = new Choices();
c.Add("Open Notepad");
c.Add("Calculator");
c.Add("Start Menu");
c.Add("excel");
c.Add("Microsoft Word");
c.Add("msWord");
c.Add(" System ShutDown");
c.Add("ControlPanel");
c.Add("Paint Brush");
c.Add("command Prompt");
c.Add("my Documents");

var gb = new GrammarBuilder(c);

var g = new Grammar(gb);
rec.LoadGrammar(g);
rec.Enabled = true;

}

private void textBox1_TextChanged(object sender, EventArgs e)
{
string text = textBox1.Text.Trim();

switch (text)
{
case"Calculator":
System.Diagnostics.Process.Start("calc");
break;
case"Start Menu":
Send("^{ESC}");
break;
case"excel":
System.Diagnostics.Process.Start("excel");
break;
case "Open Notepad":
System.Diagnostics.Process.Start("notepad");
break;
case"Microsoft Word":
System.Diagnostics.Process.Start("winword");
break;
case"System ShutDown":
Send("%{F4}");
break;
case"ControlPanel":
System.Diagnostics.Process.Start("Control");
break;
case"Paint Brush":
System.Diagnostics.Process.Start("PBRUSH");
break;
case"command Prompt":
System.Diagnostics.Process.Start("cmd");
break;
case"my Documents":
System.Diagnostics.Process.Start("explorer");
break;
default:
textBox1.Text = "*";
return;

}
}
}
}