Get the drop-down list handle of the command line?

Hello,

I would get the drop-down list handle of the command line.

image

I have a C# plugin to read Winapi special messages and execute some actions.

For performance and stability, I exclude all messages that are not attached to Rhino main window.


private IntPtr HookFunc (int nCode, IntPtr wParam, IntPtr lParam)
{
    if( nCode != 0 ) return CallNextHookEx (_hookId, nCode, wParam, lParam);

    if( _rhinoWinHandle != GetForegroundWindow () )
    {
        //TODO MAJ Do not go here when the drop-down list on the command line is displayed.
        return CallNextHookEx (_hookId, nCode, wParam, lParam);
    }
    ...
}

Is it possible to get the drop-down list handle ?

Thank you.
jmv.

Hi @kitjmv,

I have no idea how to get this - sorry.

– Dale

OK no worries. It is not very important.

hi @kitjmv,

AutoIt has a Window Info tool that sometimes may be helpful with identifying specific controls. While the handle may be different per each Rhino instance, maybe there are some other constant properties you can find to identify the autocomplete list control and get its handle? Far shot, probably…

–jarek

1 Like

I did not know this tool. I just try it and it is a very practical tool!

And the must is that it gives me a solution !
the name of the poppup window is the name of the class, I do this:

private IntPtr HookFunc (int nCode, IntPtr wParam, IntPtr lParam)
{
   if( nCode != 0 ) return CallNextHookEx (_hookId, nCode, wParam, lParam);

   var h = GetForegroundWindow ();
   if( _rhinoWinHandle != h )
   {
       var sb = new StringBuilder (21); // 21 == "CRhinoUiPopUpListWnd".Length + 1;
       GetWindowText (h, sb, 21);
       if( sb.ToString () != "CRhinoUiPopUpListWnd" )
       {
           Modifiers = 0;
           return CallNextHookEx (_hookId, nCode, wParam, lParam);
       }
   }
   ...
}

thank you @Jarek ! this tool is very usefull !

1 Like