How to get AutoComplete window handle?

Topics: User Forum
May 18, 2013 at 12:00 AM
Hi guys!
I have been working on adding a ToolTip next to my autocomplete window like most IDEs do to display help from XML help documents. However, I cannot get the spacing right without being able to get the current width and height of the autocomplete window.

I figure that the autocomplete window is part of the native Scintilla control, so I want to use P/Invoke to get its dimensions to show my ToolTip in the correct place. All I need is the autocomplete window handle but I cannot find it for the life of me anywhere in the ScintillNet source. Does anybody know where I might find it?
May 21, 2013 at 2:46 AM
That's an interesting question.... We don't have any notion in ScintillaNET of a wrapper for the auto-complete window. That is driven purely by the native Scintilla control--it creates and destroys that window completely outside of ScintillaNET.

If I were in you position I would start by hooking up Spy++ to your application and see what kind of window messages get fired when the auto-complete window is created. In many cases those messages will get reflected in the manged Scintilla.WndProc method and if you're lucky it might be something you could capture.

Another option I'm almost certain would work is to use the Win32 GetWindow function (or a variant of it)? That would likely get you the handle of the auto-complete child window. You would just need to make sure to call it at the right time.

Lastly, you might find the Scintilla (not ScintillaNET) source code helpful.

Good luck!
May 24, 2013 at 10:51 PM
Edited May 24, 2013 at 10:58 PM
Thanks for your reply! I have been playing with Spy++ 64 with all known messages disabled but can only see 0x0118 messages being sent at intervals (no autocomplete messages or anything like that). I have also peeked around in the Scintilla source code but cannot find much since I really don't know Win32 C++.

I have tried EnumWindows but it will not find the AutoComplete window. I am starting to wonder if the AutoComplete window is actually a window at all or just a pop-up ListBox.

Right now, I am working on implementing a custom AutoComplete wheel instead of using the native one.