Click here to Skip to main content
12,953,937 members (48,455 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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
        public static extern IntPtr FindWindow(string sClassName,string sWindowName);
         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
Please help, how to get title "otherWindow"?

Posted 19-Feb-13 22:38pm
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.

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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,464
CHill60 3,490
Maciej Los 3,123
ppolymorphe 2,020
Jochen Arndt 1,975

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100