Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
U

User 10603967

@User 10603967
About
Posts
22
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How I end the create xml file as ...?
    U User 10603967

    I am able to create a xml file as the following:

    <testsuite error="0" failure="0" hostname="10.133.38.115" name="GIC_Test_API_3.12.0.3338" test="31" time="3304511345" timestamp="2014-05-23 13:26:56">
    <testcase time="3304511345" name="GIC.FPA.GetLocation" classname="GIC.FPA">
    <error type="GUI Radio priviledge" message="ne peut pas executer" />
    </testcase>
    </testsuite>

    with the follwing codes:

    writer.WriteStartDocument(false);
    writer.WriteStartElement("testsuite");

    writer.WriteAttributeString("error", "0");
    writer.WriteAttributeString("failure", "0");
    writer.WriteAttributeString("hostname", "10.133.38.115");
    writer.WriteAttributeString("name", "GIC_Test_API_3.12.0.3338");
    writer.WriteAttributeString("test", "31");
    writer.WriteAttributeString("time", "3304511345");
    writer.WriteAttributeString("timestamp", "2014-05-23 13:26:56");

    writer.WriteStartElement("testcase");
    writer.WriteAttributeString("time", "3304511345");
    writer.WriteAttributeString("name", "GIC.FPA.GetLocation");
    writer.WriteAttributeString("classname", "GIC.FPA");

    writer.WriteStartElement("error");
    writer.WriteAttributeString("type", "GUI Radio priviledge");
    writer.WriteAttributeString("message", "ne peut pas executer");
    writer.WriteEndElement();
    writer.WriteEndElement();

    writer.WriteEndElement();
    writer.WriteEndDocument();

    writer.Flush();
    writer.Close();

    *) But I am required to complete the

    <error .... /error>

    as

    <error type="GUI Radio priviledge" message="ne peut pas executer" /error>

    I tried different approaches but failed ... someone can help? :doh:

    C# help xml question

  • How can I add standalone="no" in creating an XML file?
    U User 10603967

    Thanks for the link, it is OK if I viewing my xml file with Notepad! :-D

    C# question xml help

  • How can I add standalone="no" in creating an XML file?
    U User 10603967

    Yes, you are right which writer.WriteStartDocument(false); I do have if seeing it with Notepad. Thanks for clarifying it ;)

    C# question xml help

  • How can I add standalone="no" in creating an XML file?
    U User 10603967

    Yes, you are right about seeing it with Notepad which I have: Thanks for clarifying it :)

    C# question xml help

  • How can I add standalone="no" in creating an XML file?
    U User 10603967

    When I use the link and set:

    writer.WriteStartDocument(true)

    ; then I have

    However when I set:

    writer.WriteStartDocument(false)

    ; then I have

    *) What I need as mentionned before:

    Thanks for help, we are close! :doh:

    C# question xml help

  • How can I add standalone="no" in creating an XML file?
    U User 10603967

    I am able to create a XML file with:

    with the following codes:

    XmlWriterSettings settings = new XmlWriterSettings();
    settings.Indent = true;
    settings.Encoding = Encoding.GetEncoding("ISO-8859-1");

            XmlWriter writer = XmlWriter.Create("C:\\\\XML files\\\\XML\_File.xml", settings);
    

    How can I add standalone="no" after encoding="ISO-8859-1" as

    Thanks for any help :doh:

    C# question xml help

  • Fail to click on Child windows using API
    U User 10603967

    It's me again. I would like to confirm that the codes which I posted working fine if the Child Window is the 2nd level from the Parent! *) As I did mentionned earlier (since I couldn't post the attachment) my intended Child Window is deep down more than 2nd level ... might be that was why I couldn't use it directly!!! I still find the better way to do it!!! :confused::confused:

    C# com json help

  • Fail to click on Child windows using API
    U User 10603967

    The reason is that the PostMessage require the Pointer of the Child Window (not the handle) to place the focus on that Child Window then simulate clicking on the its intended Button (that what I understand from it) *) My main purpose is trying to simulate clicking on intended Button (not using mouse) on a Child Window ... I don't mind to use other methods (but so far on the other methods which I found, they couldn't help) - By the way, I have just replied my own post to mentionned that the code posted working fine if the Child Window is 2nd level from the Parent Window ... in my case the intended Child Window is lower than that ... so I still looking the way to go ditectly to it!

    C# com json help

  • Fail to click on Child windows using API
    U User 10603967

    By any chance I can send you a image which show you what my Window parent & Child looks like (including SPY contents) through your Email? I also can send you my project so that you can see full DLL Imports - It will easy to understand the issue!

    C# com json help

  • Add more detail on creating an XML file
    U User 10603967

    I am able to create a XML file like this:

    testsuite

    Colony

    arc

    With the following code:

    // Create a new file in C:\\ dir
    XmlTextWriter textWriter = new XmlTextWriter("C:\\XML files\\API_PASS.xml", null);

    // Opens the document
    textWriter.WriteStartDocument();

    // Write first element
    textWriter.WriteStartElement("testsuite");

    // Write next element
    textWriter.WriteStartElement("Name", "");
    textWriter.WriteString("testsuite");
    textWriter.WriteEndElement();

    // Write one more element
    textWriter.WriteStartElement("Address", ""); textWriter.WriteString("Colony");
    textWriter.WriteEndElement();

    // WriteChars
    char[] ch = new char[3];
    ch[0] = 'a';
    ch[1] = 'r';
    ch[2] = 'c';
    textWriter.WriteStartElement("Char");
    textWriter.WriteChars(ch, 0, ch.Length);
    textWriter.WriteEndElement();

    // Ends the document.
    textWriter.WriteEndDocument();

    // close writer
    textWriter.Close();

    *) But I was required to add some more detail for the first element (keep the last line as it is), for example:

    -

    I tried to add in the:

    textWriter.WriteStartElement("testsuite errors=\"0\");

    but it shows nothing in the xml file Anyone can help?

    C# xml json help tutorial question

  • Fail to click on Child windows using API
    U User 10603967

    - The function FindWindowEx(hwnd, Chd_win, child.ClassName, child.MainWindowTitle); supposed to return the Child Window pointer (Chd_win) which referent from child.ClassName & child.MainWindowTitle (from Parent Window = hwnd pointer) - In my case I do have correct hwnd pointer (parent) and its child.ClassName & child.MainWindowTitle also correctly ... however, somehow it couldn't find Child Window pointer = Chd_win!!! I hope that I explain correctly!

    C# com json help

  • Fail to click on Child windows using API
    U User 10603967

    I have used SPY to find the intended Child window and used those DllImport("user32", ... as indicated in http://msdn.microsoft.com/en-us/magazine/cc163738.aspx#S3, but it doesn't work with the following codes:

    WindowsEnumerator enumerator = new WindowsEnumerator();

    foreach (WindowsEnumerator.ApiWindow top in enumerator.GetTopLevelWindows())
    {
    if (top.MainWindowTitle == "Client Builder")
    {
    foreach (WindowsEnumerator.ApiWindow child in enumerator.GetChildWindows(top.hWnd))
    {
    if (child.ClassName == "Child_ClassName" && child.MainWindowTitle == "Child_Title")
    {
    IntPtr Chd_win = IntPtr.Zero;

                // GUI 
                Chd\_win = FindWindowEx(hwnd, Chd\_win, child.ClassName, child.MainWindowTitle);
                           
                PostMessage(Chd\_win, WM\_LBUTTONDOWN, 5, 5); // button down 
                PostMessage(Chd\_win, WM\_LBUTTONUP, 5, 5); // button up
                           
                MessageBox.Show(child.ClassName + ", " + child.MainWindowTitle, "");
            }
        }
    }
    

    }

    *) The Child Window pointer Chd_win always returns Zero even if it found the correct child.MainWindowTitle & child.ClassName (it confirms with the MessageBox.Show(child.ClassName + ", " + child.MainWindowTitle, "") *) I can send the image with the SPY shows Child Window with the GUI if you provide the Email address (for easier to understand my problem) Thanks in-advanced :doh:

    C# com json help

  • How to get position a Child Window & its items?
    U User 10603967

    Finally I found out (for now) I can't get their coordinations x,y of the Child Window. However, since I am able to go directly into its instance ... therefore I no more need it! Cheers :)

    C# help tutorial question

  • How to get position a Child Window & its items?
    U User 10603967

    By using Spy I am now able to see my intended Child Windows with Handle, Caption & Class exact like the one I used ... I try it over & returning the same x=0 & y=0! However, the AutoiT find tool shows its position correctly! I can't use AutoIt with the current project (C# only) ... you can help? :((

    C# help tutorial question

  • How to get position a Child Window & its items?
    U User 10603967

    I have use AutoIt Info to monitor all Child Windows, it found them ... however I amn't sure it works for C# ( it has Class, ClassNN,Title, Name, Advanced Class ...), I did try all of them but doesn't work well! - As you suggested I am using SPY now to see it can help!:java:

    C# help tutorial question

  • How to get position a Child Window & its items?
    U User 10603967

    I am able to find the Parent Window & its Child Windows, even I can find the position of the Parent Windows ... I can't find the position a its Child Window & its Child items (Button, Text Box ...) 1. The following codes to help me pinpoint the Parent & its Child Window:

    IntPtr hwnd;
    hwnd = FindWindow("ParentClass", "ParentTitle");

            WindowsEnumerator enumerator = new WindowsEnumerator();
            foreach (ApiWindow top in enumerator.GetTopLevelWindows())
            {
    
                foreach (ApiWindow child in enumerator.GetChildWindows(top.hWnd))
                    MessageBox.Show("Child Window = " + child.MainWindowTitle + ", Child ClassName = " + child.ClassName);
    
            }
    

    2. When I found an intended Child Window, I used:

    IntPtr Chd_win = IntPtr.Zero;
    Chd_win = FindWindowEx(hwnd_Parent, Chd_win, "ChildWindow_Class", "ChildWindow_Tiltle"); // From one of the found Child Window in #1

                            GetWindowRect(Chd\_win, out rect);
    
                             MessageBox.Show("Child = " + Chd\_win.ToString() + ": TopLeft\_X = " + rect.Left.ToString() + ", TopLeft\_Y = " + rect.Top.ToString());
    

    *) The result shows always TopLeft_X = 0 & TopLeft_Y = 0 Anyone can help? :((

    C# help tutorial question

  • Find all Child windows
    U User 10603967

    While I am waitting for a reply I found this and it works http://www.experts-exchange.com/Programming/Languages/.NET/Q\_26708666.html Thank you anyway :)

    C# help question

  • Find all Child windows
    U User 10603967

    I am able to find the Parent Window but I would like to have the list of all its Child Windows, in order to find their Class Name & Window Name, can anyone help? I have used: [DllImport("user32.dll", CharSet = CharSet.Unicode)] static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle); [DllImport("user32.dll")] private static extern IntPtr FindWindow(string className, string windowName); Thanks in-advanced :((

    C# help question

  • How to access Advanced Class with API
    U User 10603967

    Hi Dave, In this case I don't have to search for it any more! Thanks for the confirmation.

    C# question csharp json help tutorial

  • How to access Advanced Class with API
    U User 10603967

    Might be the way I asking wasn't right, I do work well with Autoit ... but I have to work with Visual C# now! I am not expert in Visual C#, that was why I would like to know there is a similiar way to access direct an instance of a GUI or not? I thought Visual C# a well-known SW should have a better way than a free Autoit (it can't even build a DLL or a distribution application) If there isn't a way, then I will have to use mouse method to move to the area I want to access ... but this ia the bad way, because if the people move the GUI to other position or change the screen resolution ... the mouse will move to wrong location :(( I hope that you aren't upset because of a people who just wants to know there is any thing available :doh:

    C# question csharp json help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups