Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;


namespace parol_udal
{
    class Program
    {
        [DllImport("user32.dll",CharSet=CharSet.Auto,SetLastError=true)]
        public static extern IntPtr FindWindow(string sClassName,string sWindowName);

        [DllImport("user32.dll",CharSet=CharSet.Auto,SetLastError=true)]
         public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpClassName, string lpWindowName);

        [DllImport("user32.dll",CharSet=CharSet.Auto ,SetLastError = true)]
        public static extern int GetWindowText (IntPtr hwnd,StringBuilder lpString,int nMaxCount);

        [DllImport("user32.dll",CharSet=CharSet.Auto, SetLastError = true)]
        static extern int GetWindowTextLength(IntPtr hWnd);
        
        static void Main()
        {
           IntPtr thisWindow = FindWindow(null, "Window description Parent");
           IntPtr Rod = thisWindow;
                      
           IntPtr otherWindow = FindWindowEx(Rod, IntPtr.Zero, "RICHEDIT50W", null);
        
                        
            int len = GetWindowTextLength(otherWindow);
            StringBuilder sb = new StringBuilder(len);
            len = GetWindowText(otherWindow, sb, len);

            Console.WriteLine(sb.ToString(0,len)); //get empty string
            Console.WriteLine(thisWindow); //get parent description
            Console.WriteLine(otherWindow);//get receivery description
            Console.ReadKey(true); 
       }
    }
}
Please help, how to get title "otherWindow"?
Posted
Comments
Sergey Alexandrovich Kryukov 28-Mar-13 14:23pm    
Please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership. And the fact you even self-accepted on formally is just outrageous, a sure way for a ban. I hope you won't do it after this warning.

Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900