Use GetWindowText API or the same in Win32 Message to get the window text from the handle you get from the call