Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Get window text as string from NTMessageBox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Get window text as string from NTMessageBox

    Hello,

    From OnWindowCreated(Window window) , how can I get window text as string from NTMessageBox
    and print it .

    Sincerely,Kobi

    #2
    Hello Kobi,

    This would be outside of what is supported by NinjaTrader Support as the NTMessageBoxSimple is not documented for use, however, this thread will remain open for any community members that would like to assist.

    These windows do not have automationIDs. But you might try looking for the Name of the window which is set by the caption parameter if you know what this will be ahead of time.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hey Chelsea,

      I came across this when doing some research and wanted to ask a follow up question. Is it true that all NinjaTrader 8 windows are based on WPF and therefore if we learn WPF and utilize the AddOn framework docs to capture a window on creation, we should be able to read the text and even click certain buttons of the NTMessageBox with our AddOn code?

      Thank you!
      Paul

      Comment


        #4
        Hello Paul,

        The windows in NinjaTrader 8 are WPF.

        It may be possible to find the NTMessageBox window and get the text controls in the window, however this would be outside of what is supported by NinjaTrader Support.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I completely understand it is outside of NinjaTrader Support. I just wanted to get some guidance on where I could do the research, so now I know to research WPF and utilize the NT8 guide for the AddOn projects. Thank you!

          Comment


            #6
            I was looking for this solution as well but couldn't find it on here. I did some research on WPF windows and was able to create an AddOn that is able to catch a NTMessageBox and check its text, and in my case if it was a warning about disconnecting from my Interactive Brokers connection, I have it dismissing the message box by invoking the OK button click.

            A couple very helpful links that I owe most of the credit to:

            Since there's no button.PerformClick() method in WPF, is there a way to click a WPF button programmatically?


            I hope this helps others save some time!
            Paul
            Attached Files

            Comment


              #7
              Hello Paul,

              Thank you for taking the time to create this and share this.

              The whole community will benefit and I'll direct others with similar inquiries to your post.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by GLFX005, Today, 03:23 AM
              0 responses
              1 view
              0 likes
              Last Post GLFX005
              by GLFX005
               
              Started by XXtrader, Yesterday, 11:30 PM
              2 responses
              11 views
              0 likes
              Last Post XXtrader  
              Started by Waxavi, Today, 02:10 AM
              0 responses
              6 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by TradeForge, Today, 02:09 AM
              0 responses
              14 views
              0 likes
              Last Post TradeForge  
              Started by Waxavi, Today, 02:00 AM
              0 responses
              3 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Working...
              X