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

ControlCenter HWND Handle

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

    ControlCenter HWND Handle

    Dear Experts!

    Is it possible to get HWND Handle of Control Center window in the code of indicator?

    Thank you in advance
    GmA

    #2
    Hello gma17,

    Thank you for your note.

    So I can best answer your question, could you please provide more information by what you mean by handle, HWND, as well as what you are attempting to do?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello Alan!

      Sorry for not being clear enough.
      My indicator is using external unmanaged DLL making some specific calculations.
      During setup, indicator provides chart window handle to DLL as follow:
      Code:
      Chart cChartWindow = null;
      IntPtr iptChartHWND = IntPtr.Zero
      (ChartControl != null)
      {
       if (ChartControl.PresentationSource != null)
      	{
      	 cChartWindow	= ChartControl.PresentationSource as System.Windows.Interop.HwndSource;	
      	 iptChartHWND	= cMaintWindow.Handle;
      	 cChartWindow	= null;	
      	}
      }
      There is also a need to provide similar handle of Control Center Window.
      Hence the question: how can I get that handle.

      Hope it clarifies.

      Comment


        #4
        Hello gma17,

        At the following link, under Launching your Window from the Control Center, you’ll see how to grab the control center window. There is no suggested way to get the handle from this window, however since you have the instance of the control center you may be able too.



        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Hello Alan!

          An example you've provided is for AddOns while I've been talking about Indicators.
          In any case, I have found the sample for Indicator and based on it, have got required result.
          Thank you for the direction.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by alifarahani, Today, 09:40 AM
          6 responses
          29 views
          0 likes
          Last Post alifarahani  
          Started by Waxavi, Today, 02:10 AM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by Kaledus, Today, 01:29 PM
          5 responses
          13 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Waxavi, Today, 02:00 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by gentlebenthebear, Today, 01:30 AM
          3 responses
          17 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X