1
Answer

How do I identify windows with same class in spy++

Stanko Klipic

Stanko Klipic

7y
349
1
 I have WM_SETTEXT and when i try to identify Edit window i have to many parent windows with the same class for example i determine FindWindow and getting some value and after same but on third window value is 0
 
this is my code
 
 
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;   namespace WindowsFormsApplication1 {     public partial class Form1 : Form     {         private const int WM_SETTEXT = 0x000C;         [DllImport("user32.dll")]         private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);           [DllImport("User32.dll")]         private static extern IntPtr FindWindowEx(IntPtr hwndParent,IntPtr hwndChildAfter,string lpszClass,string lpszWindows);         [DllImport("User32.dll")]         private static extern Int32 SendMessage(IntPtr edithWnd, int Msg, IntPtr wParam, StringBuilder lParam);           public Form1()         {             InitializeComponent();         }           private void Form1_Load(object sender, EventArgs e)         {             IntPtr hWnd = FindWindow("WindowsForms10.Window.8.app.0.23f19a8_r14_ad1", "some software");              if (!hWnd.Equals(IntPtr.Zero)) ;              IntPtr edit = FindWindowEx(hWnd, IntPtr.Zero, "WindowsForms10.SysTabControl32.app.0.23f19a8_r14_ad1", null);             IntPtr pod = FindWindowEx(edit, IntPtr.Zero, null, "Stores");            IntPtr H1 = FindWindowEx(pod, IntPtr.Zero, "WindowsForms10.Window.8.app.0.23f19a8_r14_ad1", null);          IntPtr H2 = FindWindowEx(H1, IntPtr.Zero, "WindowsForms10.Window.8.app.0.23f19a8_r14_ad1", null);          IntPtr H3 = FindWindowEx(H2, IntPtr.Zero, "WindowsForms10.Window.8.app.0.23f19a8_r14_ad1", null);           IntPtr H4 = FindWindowEx(H3, IntPtr.Zero, "WindowsForms10.Window.8.app.0.23f19a8_r14_ad1", null);         IntPtr H5 = FindWindowEx(H4, IntPtr.Zero, "WindowsForms10.Window.8.app.0.23f19a8_r14_ad1", null);        IntPtr H6 = FindWindowEx(H5, IntPtr.Zero, "WindowsForms10.COMBOBOX.app.0.23f19a8_r14_ad1", null);       IntPtr edithWnd = FindWindowEx(H6, IntPtr.Zero, "Edit", null);          if (!edithWnd.Equals(IntPtr.Zero))         SendMessage(edithWnd, WM_SETTEXT, IntPtr.Zero, new StringBuilder("hey"));           }                              }              }     
 i am getting some value from FindWindow and 3 line of FindWindowEx after that it is 0
and when I call
Marshal.GetLastWin32Error();
I am getting error 6 what is
ERROR_INVALID_HANDLE
6 (0x6)
The handle is invalid.
and when i set  
Marshal.GetLastWin32Error();
code was 1400
any suggestions?
 
 
Answers (1)
1
Jim Stroke

Jim Stroke

NA 492 2 11y
You can find various solutions on having a google search for your problem.
Or you can have a look at the following link: Apple mail to Pst Windows


Hope this will help.
Thank you
Accepted
0
Andew Condon

Andew Condon

NA 4 1 8y
Try Mail Extractor Pro, if you are looking for Apple Mail / MBOX to PST Converter for Mac Version.
Get More Info:http://www.mailextractorpro.com
0
Stephen Ronald

Stephen Ronald

NA 12 0 9y

You need to copy Apple Mail MBOX file to Windows machine and convert it to PST format. For that you can use a smart Apple mail to Outlook converter for Windows. The tool extract all email messages from MBOX file and save them to an importable PST format.

Download from: http://www.mboxtooutlook.org/convert/applemail.html 

0
David Brenner

David Brenner

NA 5 1.7k 10y
I just tried the new mac version of the same tool Apple Mail to pst Converter

M
uch faster than the windows version and auto-detects the apple mail email files. Being a user the only thing I needed to do was transfer the converted pst file and import it into windows outlook.
0
William Wall

William Wall

NA 3 1.5k 11y
Thanks for the solution.
0
Tony Gump

Tony Gump

NA 922 5 11y
A quick and easy way to do this is with a GMail IMAP account. Just setup the GMail account on the Mac and in Outlook on Windows. Then in Mail (Mac) drag the messages from your account to the GMail IMAP folders (make as many as you need). Now in Outlook drag the messages from the GMail IMAP account into the Outlook folders you want.

Another way is to go fro third party applications. 
The one I know is : Apple Mail to PST Convert – Convert Apple Mail Emails to WIndows Outlook PST

Using third party applications has the advantage of doing the migration quickly while the imap account method is slow and lengthy.

Choose the way you want to opt.
Thank you