How to use an autocomplete edit control in an MFC Ribbon Application - c++

I need to develop a search module for an mfc ribbon application using C++. I have used auto complete feature in C#.NET but never worked on any mfc ribbon application. I want auto complete search with an icon image as prefix of each suggestion, just like Facebook search. I have also consulted this article, but that uses CComboBox, I need to use CMFCRibbonCombobox in my program because I tried with CCombobox but that was causing problems. Any help will be appreciated.

you need to create your own CMFCRibbonComboBox derived class, that will be pretty much a copy of the CMFCRibbonFontCombBox without the fonts.to check how you draw the images you can check the CMFCRibbonFontComboBox::OnDrawDropListItem implementation.
Then I think that you will have to dynamicaly add it to the ribbon.

Related

Table/Grid using MFC

I just started developing an MFC application for the first time and I'm hoping to get more familiar with the whole "controls" concept. I am using the dialog editor in visual studio and so far I was not able to find functionality to add a simple table/grid. It seems quite basic to me, but I can't even find reliable information on how to do it on the internet.
I am looking for something similar to Qt's QTableWidget, something that I can later program with variable amount of rows and columns tailored to my application's use cases.
Do you have any ideas how to do it?
I use CGridCtrl which is very powerful and does a lot of the legwork for you.
Sounds like you're after a List View Control, which is wrapped by MFC's CListCtrl class. The dialog editor will enable you to add one and set its properties.

Implementing an extra title bar button

I am developing a C++ Desktop application, and wondered what exactly I would need to do in order to add a button into the title bar of my application, and how to do it. I'm not really sure how to go about doing this.
I'm aiming to achieve something like the titlebar of the Windows File Explorer
or something like this
Any help would be appreciated!
First one requires Ribbon framework, there is also MFC and some third-party variants.
Second is some sort of Custom window frame implementation.

Getting a external programs handle

I made a small program in C++ that can type text into a notepad document, it does so using FindWindow and FindWindowEx, but I was only able to do that because I knew the names of the windows I was trying to access (in this case it was "Notepad" for the doc and "Edit" for the text area).
If I didn't know the names how would I go about figuring that out? Lets hypothetically say I wanted to make text appear in Chrome's URL box, how would I figure out what the name of that box is so I can use FindWindowEx on it?
The least painful approach to automating 3rd party applications is to use UI Automation. It allows you to navigate UI hierarchies as well as operate on the individual objects.
All native windows controls support UI Automation out of the box. UI Automation also works with frameworks, that do not implement their UI using native controls (e.g. Qt). Particularly with Qt, tools like Spy++ will not give you the information you need.
Run the other app and then use a tool like Spy++, Winspector, etc to look at the other program's window hierarchy to find what you need.

Browser Helper Object UI

I am a newbie working towards developing an IE extension that would appear as an overlay in certain webpages. I am getting started by creating a simple BHO in VS2008 (using C++), but I am wondering how UI may be incorporated within the project. Any ideas?
Just to give you an idea, I'm looking for overlays similar to what was developed by stickis
http://www.stickis.com/faq/
Thanks
You have two real options:
1> Inject your UI into the page as HTML.
2> Overlay your UI (using Windows graphics APIs) over top of the page.
Neither of these is super-simple, I'm afraid. Unfortunately, doing UI is usually the hardest part of building IE addons.
The key question is whether you need a BHO at all. Between context-menu extensions and IE8 Accelerators, you may find that you can let IE do all of the heavy lifting. See www.enhanceie.com/ie/dev.asp for more info.
Using CreateWIndowEx() was what I was looking for :)

Detail Grid in MFC

I want a detail grid kind of control in MFC, where on expanding each row of the grid an embedded dialog would appear for it (not a popup but inside the same parent control, inside which I can show other controls).
Can you please point me if there is any such existing library providing this kind of a control? Or else how to go about implementing it. I want to do it in C/C++, MFC, Win32.
Best,
Sourabh
You can try Codejock Xtreme Toolkit Pro (Link). I had the opportunity to use its Grid Control to create an excel like sheet in MFC. It was quite good for my needs.
Refer to this link, i think it has what you are looking for.
HTH