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 aa731, Today, 02:54 AM
          0 responses
          4 views
          0 likes
          Last Post aa731
          by aa731
           
          Started by thanajo, 05-04-2021, 02:11 AM
          3 responses
          470 views
          0 likes
          Last Post tradingnasdaqprueba  
          Started by Christopher_R, Today, 12:29 AM
          0 responses
          10 views
          0 likes
          Last Post Christopher_R  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          166 responses
          2,237 views
          0 likes
          Last Post sidlercom80  
          Started by thread, Yesterday, 11:58 PM
          0 responses
          4 views
          0 likes
          Last Post thread
          by thread
           
          Working...
          X