Click here to Skip to main content
16,013,322 members
Home / Discussions / C#
   

C#

 
GeneralYahoo and C# Pin
MeterMan18-Jun-04 21:55
MeterMan18-Jun-04 21:55 
GeneralRe: Yahoo and C# Pin
Nick Parker19-Jun-04 4:41
protectorNick Parker19-Jun-04 4:41 
GeneralRe: Yahoo and C# Pin
MeterMan19-Jun-04 6:44
MeterMan19-Jun-04 6:44 
GeneralRe: Yahoo and C# Pin
Heath Stewart19-Jun-04 6:50
protectorHeath Stewart19-Jun-04 6:50 
GeneralRe: Yahoo and C# Pin
Heath Stewart19-Jun-04 6:48
protectorHeath Stewart19-Jun-04 6:48 
GeneralRe: Yahoo and C# Pin
MeterMan19-Jun-04 10:14
MeterMan19-Jun-04 10:14 
GeneralRe: Yahoo and C# Pin
eggie519-Jun-04 15:24
eggie519-Jun-04 15:24 
GeneralRe: Yahoo and C# Pin
eggie519-Jun-04 15:51
eggie519-Jun-04 15:51 
This code is soo horibile, but it works. I'm not sure if you got it to work, but this does.... I keep spacing out when I was reading, oh well good practice for me...

public const int WM_SETTEXT = 0x000C;

		[DllImport("user32.dll")]
		static extern int FindWindow(string lpClassName, string lpWindowName);

		[DllImport("user32.dll")]
		static extern int FindWindowEx(int hwndParent, int hwndChildAfter, string lpszClass, string lpszWindow);
		
		[DllImport("user32.dll")]
		static extern int SendMessage(int hWnd, int Msg, int wParam, string lParam);

		int ParenthWnd;
		int hWnd;

		private void button1_Click(object sender, System.EventArgs e)
		{
			string lpszParentClass = "Notepad";
			string lpszParentWindow = "Untitled - Notepad";
			string lpszClass = "Edit";

			ParenthWnd = FindWindow(lpszParentClass, lpszParentWindow);

			if (ParenthWnd==0)  
				Console.WriteLine("Notepad Not Running");
			else
			{
				hWnd = FindWindowEx(ParenthWnd,hWnd,lpszClass,"");
				if (hWnd.Equals(IntPtr.Zero))  
					Console.WriteLine("What the F??? Notepad doesn't have an edit component ?");
				else
				{
					MessageBox.Show("Notepad Window: " + ParenthWnd.ToString());
					MessageBox.Show("Edit Control: " + hWnd.ToString());

					string hi="hello";
					SendMessage(hWnd, WM_SETTEXT, hi.Length, hi);
				}
			}
		}


/\ |_ E X E GG
GeneralRe: Yahoo and C# Pin
MeterMan19-Jun-04 16:41
MeterMan19-Jun-04 16:41 
GeneralRe: Yahoo and C# Pin
eggie519-Jun-04 16:46
eggie519-Jun-04 16:46 
GeneralRe: Yahoo and C# Pin
Heath Stewart20-Jun-04 9:46
protectorHeath Stewart20-Jun-04 9:46 
GeneralRe: Yahoo and C# Pin
MeterMan20-Jun-04 10:43
MeterMan20-Jun-04 10:43 
GeneralRe: Yahoo and C# Pin
eggie519-Jun-04 17:49
eggie519-Jun-04 17:49 
GeneralRe: Yahoo and C# Pin
MeterMan19-Jun-04 18:25
MeterMan19-Jun-04 18:25 
GeneralRe: Yahoo and C# Pin
eggie519-Jun-04 19:21
eggie519-Jun-04 19:21 
GeneralRe: Yahoo and C# Pin
MeterMan20-Jun-04 16:38
MeterMan20-Jun-04 16:38 
GeneralRe: Yahoo and C# Pin
eggie519-Jun-04 19:11
eggie519-Jun-04 19:11 
GeneralRe: saving collection automaticaly into form`s code file. Pin
Mazdak18-Jun-04 22:18
Mazdak18-Jun-04 22:18 
GeneralRe: saving collection automaticaly into form`s code file. Pin
Member 114126618-Jun-04 22:52
Member 114126618-Jun-04 22:52 
QuestionNewbie Q: C# ASPX Popup? Pin
Joel, Just Joel18-Jun-04 16:04
Joel, Just Joel18-Jun-04 16:04 
AnswerRe: Newbie Q: C# ASPX Popup? Pin
Heath Stewart18-Jun-04 18:37
protectorHeath Stewart18-Jun-04 18:37 
GeneralRe: Newbie Q: C# ASPX Popup? Pin
Joel, Just Joel21-Jun-04 15:34
Joel, Just Joel21-Jun-04 15:34 
GeneralFind me that record... Pin
aberger5618-Jun-04 12:05
aberger5618-Jun-04 12:05 
GeneralRe: Find me that record... Pin
Nick Parker18-Jun-04 13:36
protectorNick Parker18-Jun-04 13:36 
GeneralRe: Find me that record... Pin
aberger5619-Jun-04 15:33
aberger5619-Jun-04 15:33 

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.