News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Menu in EasyCode

Started by Danesh, March 13, 2005, 07:50:56 PM

Previous topic - Next topic

Danesh

Hi All,

I am newbie in EasyCode and it looks like great, but there is some unclear issues.

1. Where is the message loop source code ? I could not find any messale loop with CreateWindow function call. Actually the source code starts with messages handling.

2. I designed a menu with several items, but when I run my program there is no menu ! How can I add designed menu to the window of my program ?

Thanks,

Danesh


Bieb

I don't know how to handle menus, but the message loop is the Window1 proc that you get by default.  The control IDs of all the controls are IDC_PARENTWINDOWSNAME_CHILDWINDOWSNAME.  For more help, look in the tutorials subforum in this forum.

AeroASM

Isn't the message loop different from the window procedure? I don't use Easy Code, so correct me if I am wrong.

Bieb

Oh yeah, I think I'm thinking of the Window Procedure.  Easy Code only shows you the procedure that actually processes the messages.

pbrennick

AeroASM,
Click Project, Add Resource and then Menu.  This will open the dialog box that allows you to build a menu.  It works the exact same way as in VB.

Paul

Ramon Sala

#5
Hi Danesh,

Welcome to Easy Code! There are two ways of building a menu and they depend on the type of project, visual or classic. The first way is creating a menu resource that has to be set to a window (the classic way), while the second way (just for visual projects) sets the menu automatically to the window for which the Menu Editor was open. Let's see:


Classic projects
=========


1 - Click Project, Add Resource and then Menu (as Paul said). This will open a Dialog Box where you can design the menu you like. Then, in your code, you will have to set that menu to a window (SetMenu API call).



Visual projects
=========


1 - You can design a menu the same exact way as in classic projects.

2 - Each window object may have a menu which will be automatically set by the Easy Code visual library. To design that type of menu, click Tools, Menu Editor... (or <Ctrl+M>) while the window for which the menu is to be designed is the active window. The Menu Editor will open (same Dialog Box that menu resources) but the menu you design there will be automatically set to the window which name appears in the Menu Editor's caption. After designing the menu, you can see it by testing the window (click Build, Test <WindowName> or <Shift+F5>).


See the examples included with Easy Code. The MDI example uses the second method (the menu belongs to the main window), while the Memory example uses the first method (the menu is a resource that has to be set to the window).

I attach a simple visual project with a menu. Once the project is open, press <Ctrl+M> to see the Menu Editor, or <Shift+F5> to test the window and see how the menu will look like.

About the message loop in visual projects, by default all messages are sent to their corresponding window procedures. Anyway, you can check all messages before being processed by adding the ProcessMessages procedure (see Easy Code help, Visual projects-->Controlling application message loop topic). On the other hand, in classic projects you write all the code, so you have to write the message loop too, but when choosing a Classic Win32 executable file, Easy Code writes some initial code including the message loop.

If you have any doubt or problem, please tell me, or send me your code to see if there is something wrong.

Regards,

Ramon


[attachment deleted by admin]
Greetings from Catalonia

Danesh

Hi Ramon,

Thanks for your help. It is solved now and I use menus easily.

Regards,

Danesh


Ramon Sala

Thank you Danesh. I'm glad you enjoy Easy Code!

Regards,

Ramon
Greetings from Catalonia