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 cre8able, Today, 03:20 PM
          0 responses
          5 views
          0 likes
          Last Post cre8able  
          Started by Fran888, 02-16-2024, 10:48 AM
          3 responses
          47 views
          0 likes
          Last Post Sam2515
          by Sam2515
           
          Started by martin70, 03-24-2023, 04:58 AM
          15 responses
          114 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by The_Sec, Today, 02:29 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by jeronymite, 04-12-2024, 04:26 PM
          2 responses
          31 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X