how to fire menu item click event in ATL OR WTL? - atl

Currently i am using the ON_WM_SELECT messgae
but it will fire on mouse hover over the menu.

Instead of the ON_WM_SELECT i used the COMMAND_RANGE_HANDLER(0, 10000, OnClickCopyItem)
to get the click event for the each menu item
COMMAND_RANGE_HANDLER( idFirst, idLast, func )

Related

How to set signal to a button of the GtkColorChooserDialog composite widget?

I am using Glade to create GUI. I have the default GtkColorChooserDialog.
How to set signals to the Select and Cancel button clicked event.
These two buttons are grouped in one GtkButtonBox and I can only choose the box, but not the buttons themselves.
If I can't select the button then how to assign action to the clicked signal?

Gtk2: event for top menu item click?

I want to see how to make it in Gtk2 (e.g. C++). Does gtk2 has ability to set event which is called, when top menu item is clicked?
E.g. topmenu may be "File Edit Help". When "Edit" clicked (Alt+E key too) I want that event is called (event sets checkmarks for menu items in Edit).
How to do it.
You can "trap" them with activate-current. As most of the widgets, they have an activated signal handler.

How to call a dialog box from another (Win32 application)

I implemented a dialog-based Win32 Visual C++ application (Visual Studio Ultimate 2012) by following this article.
What is the way to call another dialog box (by clicking on a button) from the one I already created?
Add a button to the dialog in the dialog resource view. Just drag a button from the toolbar onto the dialog template. When the button is clicked you will get a WM_COMMAND message containing the button ID and the BN_CLICKED notification code.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb761825(v=vs.85).aspx
Add a case in your DialogProc to detect the click. When you get it, create a new dialog by calling the DialogBox API.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms645452(v=vs.85).aspx
This second dialog will need you to write a new DialogProc2, just like the first DialogProc, to handle messages from the second dialog.

WinApi C++, How to open a window push down a button?

I have created a "check Box " window with a button, when the button is clicked, It should open a "Edit" window, How can I do?
thanks
It depends completely on the windowing system you are using, or the graphics library. ¿Are you using .NET? ¿MFC?
In any case, your button object will have a way to associate a function to its click event. Just write a function that does what you need (in this case, open the "Edit" window), associate this function to the click event of your button, and you are done.
Make your edit window hidden by default in the resource editor and show it with ShowWindow(hEditWnd,SW_SHOW) when the button is clicked.
You could instanciate a new window and show it on the click event

Creating popup menu in Qt for QTableView

I have a QTableView in the main UI of my program. I'd like to show popup menu when user right clicks on the cells of the table and take appropriate action when an option is selected from the menu.
I am using Qt Creator 1 (Qt version 4.5). How can I do that?
Check out the customContextMenuRequested signal to get the event, and use a QMenu for the menu itself. Use QTableView::indexAt to find out what, if any, cell was clicked based on the coordinates given to the signal and take the appropriate action when a menu item is clicked.