Click here to Skip to main content
15,912,977 members
Home / Discussions / C#
   

C#

 
QuestionRe: ROTFLMAO Pin
haz1319-Jul-06 14:28
haz1319-Jul-06 14:28 
AnswerRe: ROTFLMAO Pin
Ennis Ray Lynch, Jr.19-Jul-06 14:40
Ennis Ray Lynch, Jr.19-Jul-06 14:40 
AnswerRe: passing data to a textbox on a form using a method in a class Pin
Christian Graus19-Jul-06 19:16
protectorChristian Graus19-Jul-06 19:16 
GeneralRe: passing data to a textbox on a form using a method in a class Pin
AB777119-Jul-06 19:36
AB777119-Jul-06 19:36 
QuestionRe: passing data to a textbox on a form using a method in a class Pin
haz1322-Jul-06 3:05
haz1322-Jul-06 3:05 
GeneralRe: passing data to a textbox on a form using a method in a class Pin
haz1322-Jul-06 5:27
haz1322-Jul-06 5:27 
GeneralRe: passing data to a textbox on a form using a method in a class Pin
Christian Graus22-Jul-06 12:06
protectorChristian Graus22-Jul-06 12:06 
QuestionCopying files with long path names Pin
GazzaJ19-Jul-06 11:50
GazzaJ19-Jul-06 11:50 
AnswerRe: Copying files with long path names Pin
RizwanSharp19-Jul-06 12:08
RizwanSharp19-Jul-06 12:08 
GeneralRe: Copying files with long path names Pin
GazzaJ19-Jul-06 22:10
GazzaJ19-Jul-06 22:10 
AnswerRe: Copying files with long path names Pin
Gavin Roberts20-Jul-06 0:25
Gavin Roberts20-Jul-06 0:25 
GeneralRe: Copying files with long path names Pin
GazzaJ20-Jul-06 0:48
GazzaJ20-Jul-06 0:48 
Questionabout writing some thing into the input stream of any running process Pin
hardikvaishnav19-Jul-06 11:15
hardikvaishnav19-Jul-06 11:15 
hello friends,
I want to get a handle to the currently open instance of the microsoft word. I got that successfully but after that I want to get the inputstream to that process (word). I found method for that but I am getting an error at that statement. my code is as under. someone please give me some suggestion. also let me know if I am doing it in a wrong way.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Windows;
using System.IO;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{

}
private void button1_Click(object sender, EventArgs e)
{
Process p = new Process();
p.StartInfo.FileName = "C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.exe";
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;


p.Start();
StreamWriter sw = p.StandardInput;
sw.WriteLine("This is a test");



Process[] procs = Process.GetProcesses();

foreach (Process proc in procs)
{
if (proc.MainWindowHandle.ToInt32() != 0)
{
if (proc.ProcessName == "WINWORD")
{

System.Windows.Forms.MessageBox.Show(proc.Handle.ToString());
StreamWriter myStreamWriter = proc.StandardInput;
myStreamWriter.WriteLine("This is a Test");
}
}
}
}


}

-vaishnav hardik
AnswerRe: about writing some thing into the input stream of any running process Pin
led mike19-Jul-06 11:42
led mike19-Jul-06 11:42 
QuestionShow small TM sign on title bar title text Pin
Saamir19-Jul-06 9:31
Saamir19-Jul-06 9:31 
AnswerRe: Show small TM sign on title bar title text Pin
Paul Brower19-Jul-06 9:36
Paul Brower19-Jul-06 9:36 
GeneralRe: Show small TM sign on title bar title text Pin
Dan Neely19-Jul-06 9:39
Dan Neely19-Jul-06 9:39 
GeneralRe: Show small TM sign on title bar title text Pin
RizwanSharp19-Jul-06 9:44
RizwanSharp19-Jul-06 9:44 
Questionhow can I sum ... Pin
mostafa_h19-Jul-06 8:22
mostafa_h19-Jul-06 8:22 
AnswerIf you are using crystal reports Pin
Ennis Ray Lynch, Jr.19-Jul-06 8:28
Ennis Ray Lynch, Jr.19-Jul-06 8:28 
GeneralRe: If you are using crystal reports Pin
mostafa_h19-Jul-06 10:09
mostafa_h19-Jul-06 10:09 
GeneralDon't forget about SQL Injection Pin
Ennis Ray Lynch, Jr.19-Jul-06 10:12
Ennis Ray Lynch, Jr.19-Jul-06 10:12 
GeneralRe: Don't forget about SQL Injection Pin
mostafa_h19-Jul-06 10:36
mostafa_h19-Jul-06 10:36 
QuestionThread Safety??? [modified] Pin
RizwanSharp19-Jul-06 8:12
RizwanSharp19-Jul-06 8:12 
AnswerRe: Thread Safety??? Pin
Ennis Ray Lynch, Jr.19-Jul-06 8:34
Ennis Ray Lynch, Jr.19-Jul-06 8:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.