How to call IShellFolder::EnumObjects externally in a shell extension - shell-extensions

I have created a Windows Shell Extension similar to Google's GDrive. Now I want to add different views to the ListView that inherits from IShellView. A new context menu has been added to to display 3 views (Details, Small Icon, Large Icon). When a view is changed using the context menu, the current window needs to be refreshed/created to display the changed view.
In my IShellFolder::EnumObjects, a new ListView object is created and OnCreate is called automatically. I need to call this method when I change view using the context menu also. I guess there might be some API like SHChangeNotify() that can all the EnumObjects() automatically and a new IShellView window will be created with the changed view.

As i understood from your question, you need the same contents to be viewed in listview but with the new view.
You don't need to recreate the Listview object after the new view mode selection, Just set the ListView's style to LVS_REPORT, LVS_SMALLICON, or LVS_ICON.
SHChangeNotify is used to reflect the change to the tree pane not the ListView.

Related

How to get default Window TextBox Context Menu in?

I develop custom widget set from scratch in windows.This widget set controls (except Form control) doesn't have window handle.
Now, I have show default TextBox Context Menu when user right click over TextBox control but I can't find any solution to get default context menu from windows API.
1- Is there way to get default Context Menu of windows TextBox ?
2- Where can I see some example around windows Context Menus ?

Making a menu item appear when a certain view is displayed rails

Windows 8.1
Rails 4.1
Ruby 2.0
I have the menus for my application defined in views/layout, and one of those is the header where I have the menu items. There are some additional partials rendered form _header.html.erb as well.
I would like to have an additional menu appear ONLY when I render views/pages/index. How do I go about doing this?
I would look in Javascript. Have you tried listening for the specific body class of that page? Each body gets a dynamically generated attribute of class="controller action". If you listen for body.controller.action, you'll have the event that can trigger you to show (or hide) your menu item.
Pseudo code might look like:
I want a new menu to appear for controller1, action1
when any action fires in any controller
if the class of the body element has both class "controller1" and class "action1"
menu.show()
else
menu.hide()

Programmatically and completely delete button from MFC toolbar

I have a document within MFC C++ application. I need to delete one the buttons from the particular CMFCToolbar within a code (not resources) completely, even preventing a user to restore the button via toolbar customization dialog. At this moment I use RemoveButton method of CMFCToolbar but it only makes the button invisible and it can be restored via toolbar customization dialog that is not an option for me at this time. I will be very glad if you suggest something that can help me there.
There are two internal lists in CMFCToolBar that are used to reset the Buttons upon customization.
They are named m_OrigButtons and m_OrigResetButtons.
You may need to derive your own class and delete the buttons with the specific IDs from there.
But better: Never to include such a button on the first time when the toolbar is created!

Switch layouts of CWnd inside CVIew

I have MDI application with Document/View enabled.
Inside CView class of the application there are created several CWnd derived child windows(different views) and then placed inside tab control (CMFCTabCtrl), which is also created in application CView class. So, I can see tabs inside each application document and by switching between these tabs, see each child view. For example, one view with OpenGL data visualization, another with text editor window, third with table visualization and so on.
Now, I want to add possibility to see all created child views simultaneously, separated with split control inside one document and switch between this new layout to tabbed layout, mentioned above, and vice versa by menu command.
So, I wonder what is the best way to accomplish my task
Thank you in advance
The SWSPLIT sample app on MSDN does just about everything that can be done with views and splitters.
http://support.microsoft.com/kb/199515/en-us

how to add child window controls to CWindowImpl

How do I add simple child window controls (e.g. a button) to a CWindowImpl?
I've looked at CWindowImpl and CDialogImpl. With CDialogImpl, it appears that you just create a dialog template resource and use it, very simple. I would like to do something similar with CWindowImpl, but there doesn't seem to be a way to do it. Must I add the controls manually and position them programmatically?
Some context on what I'm trying to do: I'm trying to create a plug-in for foobar2000, a Windows audio player. I would like to create a "UI element" plugin, and in the sample code that I've looked at, a "UI element" is created via CWindowImpl. How do I add buttons to this CWindowImpl? I've tried using a CDialogImpl instead, but this gives me a "pop-up" dialog, which is not what I'm looking for.
Thanks very much in advance!
With any window, including CDialogImpl, you can add child controls by creating a new window of control class and specifying your parent window handle as a parent for new control. Additionally, SetParent API is here to re-parent any window.