Jump to content


Photo

N_menu 2.0.5.3: Winapi Menus Dll/extension


  • Please log in to reply
187 replies to this topic

#1 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 12 February 2005 - 07:13 AM

This dll is for using real windows menus in your games. It supports both menu bars and popup menus. It also supports bitmaps, checkmarks, changing menus on the fly, and tool windows with menus in them.

5-20-06: N_Menu 2.0.2.0 is out! Changes in 2.0.2.0 include new tool windows with menus inside, radio buttons, and getting the maximum width and height of bitmaps for menus.

2-20-07: Released version 2.0.3.1. New to the version is the N_Menu_GetToolWindowExists function, which returns whether or not a tool window exists. Useful for detecting when a tool window has been closed. Thanks to darkuranium for the suggestion.

5-23-07: Version 2.0.5.1 is released today. This version simply fixes a bug in which N_Menu_DestroyMenu was not removing the menu from a menu bar. A GM7 extension file has also been added.

5-26-07: Released version 2.0.5.2 which fixes a few minor issues and adds some new features:

- Now N_Menu_DestroyMenu should only be used for destroying a popup menu that does not have a parent like a right click menu.

- N_Menu_RemoveItem can now remove popup menus from menu bars, submenus from popup menus, and items from popup menus. It automatically destroys any menus (and any child menus of them) that are removed as well.

- N_Menu_AttachMenuBar can now remove the menu bar from GM's window. Just pass GM's window handle as always as well as 0 for the ID of the menu.

2-27-09: Released version 2.0.5.3. This version includes a GM5 and GM7 file as well as extension for GM7. Also included is the full source code.

Download: http://ravotus.nfsho...enu_2.0.5.3.zip

Edited by Ravotus, 17 May 2012 - 02:10 AM.

  • 1

#2 Shaltif

Shaltif

    The Audio Master

  • GMC Elder
  • 1185 posts

Posted 12 February 2005 - 07:21 AM

A very excellent DLL. It easlly allows for adding WinAPI menus into your application to give it that added "professional" look.

For those wanting those excellent popup right-click menus (aka context menus) or a file menu bar for your application. You can place menus in menus, add seperatores, disable items, checkmark, images, and the list goes on.

I highly recommend this DLL to anyone using menus that are windows based. Forget show_menu(), you now got N_Menu!

Now all we need is a DLL with every single WinAPI call... ::lmao::

...and as already mentioned, this DLL was beta tested during the creation of the SXMS Player 3.0 and finally incorporated into the final product.

Thanks NintendoFreak88 for making such a wonderful DLL, and I'll hope to see more in the future :P.

~Brandon
  • 0

#3 Porfirio

Porfirio

    GMC Member

  • GMC Member
  • 1209 posts

Posted 12 February 2005 - 10:22 AM

It is very cool!
In gm6 the right click menu dont work because gm6 dont have this functions:
window_client_left window_client_top
if you delete that the menu will apear very bad so you should fix it

Mabe you should add ( if it is possibel ) a statusbar with text and gadgects

I never figured out how to work with window handle i want to make somethings but i dont know how ::lmao::
  • 0

#4 PromaneX

PromaneX

    Fixer of broken web things

  • New Member
  • 489 posts

Posted 12 February 2005 - 10:33 AM

wow nice work , with this and my menus gm users can maker much better looking games now ::lmao::
  • 0

#5 THE GAME

THE GAME

    GMC Member

  • New Member
  • 98 posts

Posted 12 February 2005 - 02:03 PM

ferry good dll + example ::lmao::

cen i try make a lib for it?

Edited by THE GAME, 12 February 2005 - 02:13 PM.

  • 0

#6 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 12 February 2005 - 04:14 PM

Sure, make whatever you want with it. Just please credit me. ::lmao:: I won't do a status bar because this is a menu dll, not a winapi one.
BTW about the gm5/gm6 thing i'll make a .gm6 for ya too then and fix that.
EDIT: Added gm6 version to the download. Just download from the same url

Edited by Nintendofreak88, 12 February 2005 - 04:21 PM.

  • 0

#7 Porfirio

Porfirio

    GMC Member

  • GMC Member
  • 1209 posts

Posted 12 February 2005 - 04:51 PM

Ok!
It's a cool dll sure i will use it ::lmao::
  • 0

#8 THE GAME

THE GAME

    GMC Member

  • New Member
  • 98 posts

Posted 12 February 2005 - 06:35 PM

ok but i cen only made it for gamemaker 5
i cen`t use gamemaker 6

Edited by THE GAME, 12 February 2005 - 06:35 PM.

  • 0

#9 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 12 February 2005 - 06:53 PM

It has a gmd file included with it...
  • 0

#10 THE GAME

THE GAME

    GMC Member

  • New Member
  • 98 posts

Posted 12 February 2005 - 08:54 PM

::lmao:: dow jou cen gife my jou e-mail aderes
for if the lib ready is?
my e-mail is
the_com_server@hotmail.com
or
pro_greensoft@yahoo.com
  • 0

#11 avanderveen

avanderveen

    GMC Member

  • New Member
  • 120 posts

Posted 13 February 2005 - 02:25 AM

can someone please post some screenshots
:EDIT:
wow old post, (that was a dumb question ::lmao:: lol)

Edited by avanderveen, 06 March 2005 - 10:34 PM.

  • 0

#12 PromaneX

PromaneX

    Fixer of broken web things

  • New Member
  • 489 posts

Posted 13 February 2005 - 02:36 AM

it is just standard windows menus , so a screen shot would be pointless
  • 0

#13 The Cuteness

The Cuteness

    GMC Member

  • New Member
  • 2 posts

Posted 13 February 2005 - 03:44 AM

It is very cool!
In gm6 the right click menu dont work because gm6 dont have this functions:
window_client_left window_client_top
if you delete that the menu will apear very bad so you should fix it

Mabe you should add ( if it is possibel ) a statusbar with text and gadgects

I never figured out how to work with window handle i want to make somethings but i dont know how



correct me if I'm wrong but I think that
window_client_left window_client_top
have been changed to
window_client_x window_client_y

anyway on topic
cool menus ::lmao::
  • 0

#14 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 13 February 2005 - 04:09 AM

It's already been fixed in the included gm6 file. Thanks for the comments everyone! ::lmao::
  • 0

#15 Bitmappity

Bitmappity

    The Man With The Golden Gun

  • New Member
  • 31 posts

Posted 13 February 2005 - 04:55 AM

AH, perfect. I was searching for a DLL like this.

Thanks ;)
  • 0

#16 Blijbol

Blijbol

    Happy business

  • GMC Member
  • 313 posts

Posted 13 February 2005 - 11:42 AM

Thanks NintendoFreak88 for making such a wonderful DLL, and I'll hope to see more in the future :blink:.

~Brandon

<{POST_SNAPBACK}>


I agree!!! This is great!!!
  • 0
Blijbol OnScore 2 Extend your games with online highscore lists! New version!

Joystick OEM Name DLL Controller name as in Control Panel.
Registry Reader DLL Full read access to the Windows Registry.
Game Appearance Extension Control the game window and taskbar button in detail!
INI Data Structure Extension Much better than GM's INI functions.

Games and software: Slimeball Deluxe (digital arcade volleyball) Blijbol Snake 2 (traditional snake including a Maze Editor) Flood (try to escape from the water) Blijbol Memory (find the pairs) Game Maker Quiz (test your GM knowledge) More at Games.Blijbol.nl and Software.blijbol.nl
My website: Blijbol.nl (English/Dutch) | User of Game Maker 7.0 Pro | Moderator of the Dutch Game Maker Community

#17 Blijbol

Blijbol

    Happy business

  • GMC Member
  • 313 posts

Posted 13 February 2005 - 11:44 AM

Maybe you could add radio boxes in the menus.
  • 0
Blijbol OnScore 2 Extend your games with online highscore lists! New version!

Joystick OEM Name DLL Controller name as in Control Panel.
Registry Reader DLL Full read access to the Windows Registry.
Game Appearance Extension Control the game window and taskbar button in detail!
INI Data Structure Extension Much better than GM's INI functions.

Games and software: Slimeball Deluxe (digital arcade volleyball) Blijbol Snake 2 (traditional snake including a Maze Editor) Flood (try to escape from the water) Blijbol Memory (find the pairs) Game Maker Quiz (test your GM knowledge) More at Games.Blijbol.nl and Software.blijbol.nl
My website: Blijbol.nl (English/Dutch) | User of Game Maker 7.0 Pro | Moderator of the Dutch Game Maker Community

#18 Dragongames

Dragongames

    Comitar

  • New Member
  • 162 posts

Posted 13 February 2005 - 04:16 PM

I love the DLL, but it is messing up my backgrounds. When I put backgrounds in it shrinks them. I figured it was because the roomsize was too small, I changed that, but it still didn't work. Is it something in the code?
  • 0

#19 Shaltif

Shaltif

    The Audio Master

  • GMC Elder
  • 1185 posts

Posted 13 February 2005 - 07:02 PM

I love the DLL, but it is messing up my backgrounds.  When I put backgrounds in it shrinks them.  I figured it was because the roomsize was too small, I changed that, but it still didn't work.  Is it something in the code?

<{POST_SNAPBACK}>


This is because the menu takes up 20 pixels on the window space. However, your roomsize is now "larger" than the window space...so, is scales down your room to keep the aspect ratio correct.

To fix this, at the beginning of game, use window_set_size() and make the window 20 pixels taller than the room size.

example: if your room is 640x480, then you would set the window size to 640x500. Basically, you have to give space for the menu, since the menu DOES NOT draw inside the GM drawing region (it draws above it, then puts the GM drawing below).

EDIT: Btw, when using the window_set functions in GM, the window_handle() changes. So, set the window size before initalizing the DLL.

~Brandon

Edited by Shaltif, 13 February 2005 - 07:07 PM.

  • 0

#20 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 13 February 2005 - 07:10 PM

Well its not neccessarily 20 pixels. In the next version i may add a function to get the height (there's an api call for getting the size of any windows element.)
  • 0

#21 Dragongames

Dragongames

    Comitar

  • New Member
  • 162 posts

Posted 13 February 2005 - 08:52 PM

Shaltif, thank you soooo much! That was extremely helpful. Worked and all. Enhances this dll so much more!
  • 0

#22 Blijbol

Blijbol

    Happy business

  • GMC Member
  • 313 posts

Posted 13 February 2005 - 09:07 PM

I love the DLL, but it is messing up my backgrounds.  When I put backgrounds in it shrinks them.  I figured it was because the roomsize was too small, I changed that, but it still didn't work.  Is it something in the code?

<{POST_SNAPBACK}>


This is because the menu takes up 20 pixels on the window space. However, your roomsize is now "larger" than the window space...so, is scales down your room to keep the aspect ratio correct.

To fix this, at the beginning of game, use window_set_size() and make the window 20 pixels taller than the room size.

example: if your room is 640x480, then you would set the window size to 640x500. Basically, you have to give space for the menu, since the menu DOES NOT draw inside the GM drawing region (it draws above it, then puts the GM drawing below).

EDIT: Btw, when using the window_set functions in GM, the window_handle() changes. So, set the window size before initalizing the DLL.

~Brandon

<{POST_SNAPBACK}>

I didn't thought about that. Thank you for mentioning.

By the way, I'm currently listening music with your SXMS Player 3! :blink:

Blijbol
  • 0
Blijbol OnScore 2 Extend your games with online highscore lists! New version!

Joystick OEM Name DLL Controller name as in Control Panel.
Registry Reader DLL Full read access to the Windows Registry.
Game Appearance Extension Control the game window and taskbar button in detail!
INI Data Structure Extension Much better than GM's INI functions.

Games and software: Slimeball Deluxe (digital arcade volleyball) Blijbol Snake 2 (traditional snake including a Maze Editor) Flood (try to escape from the water) Blijbol Memory (find the pairs) Game Maker Quiz (test your GM knowledge) More at Games.Blijbol.nl and Software.blijbol.nl
My website: Blijbol.nl (English/Dutch) | User of Game Maker 7.0 Pro | Moderator of the Dutch Game Maker Community

#23 jhood

jhood

    GMC Member

  • New Member
  • 1 posts

Posted 17 February 2005 - 12:54 AM

Tidbit of information: Not calling N_Menu_CleanUp(); before restarting the room or game will end the game.

Is there a way to display a bitmap in a menu that is attached to the menubar itself and not just a menuitem? (E.g. "File" menu displaying a bitmap as opposed to showing a bitmap on the "File New" menuitem in the "File" menu.)

Nice DLL.
  • 0

#24 jacobmp92

jacobmp92

    Founder of GlobalMsg

  • New Member
  • 107 posts

Posted 21 February 2005 - 05:12 PM

Excellent DLL!

I have two suggestions:
1. Radio button menu options
2. Default item (the one that is in bold)
  • 0

#25 eagleclaw364

eagleclaw364

    GMC Member

  • New Member
  • 296 posts

Posted 05 March 2005 - 10:40 PM

Very nice DLL. I love it.

I'm implementing it into my zip program which should be finished some time soon. I'll be releasing it in like 2 days. Maybe less. You can see how I used it :)

Very nice DLL. Good job!
  • 0

#26 DEvil Nemesis

DEvil Nemesis

    GMC Member

  • New Member
  • 7 posts

Posted 05 March 2005 - 11:49 PM

Hey this is a masterpiece Nintendofreak88! But I don't like those GM pre-maked popup messages :D . I that not disturb, can you include in next version editable mainprogram-like windows? In any case great job Nintendofreak88! :)

P.S.: Give credit mean that your dll name should appear into my end credits or at least in my game readme?
  • 0

#27 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 06 March 2005 - 04:01 PM

wow nice work , with this and my menus gm users can maker much better looking games now


I tink this would be much more useful for programs made in gm than games!
great job though!
  • 0
GM 8.1 / GM:HTML5 User

#28 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 06 March 2005 - 06:13 PM

Tidbit of information: Not calling N_Menu_CleanUp(); before restarting the room or game will end the game.

I wonder why that happens... Maybe it has to do with the menu clean up procedures in windows? I'll check into it...

Is there a way to display a bitmap in a menu that is attached to the menubar itself and not just a menuitem? (E.g. "File" menu displaying a bitmap as opposed to showing a bitmap on the "File New" menuitem in the "File" menu.)

Well I'm not sure about that... It depends on if the Windows API supports it or not. I'll look into it as well.

1. Radio button menu options
2. Default item (the one that is in bold)

1. Will be in the next version (when I get around to it.)
2. I'll also add that to my To Do list.

Very nice DLL. I love it.

I'm implementing it into my zip program which should be finished some time soon. I'll be releasing it in like 2 days. Maybe less. You can see how I used it wink1.gif

Very nice DLL. Good job!

Thanks! :)

I that not disturb, can you include in next version editable mainprogram-like windows?

Do you mean like message boxes or actual windows? This is supposed to be just for menus but if you just want a message box function I could possibly make an exception. :D

P.S.: Give credit mean that your dll name should appear into my end credits or at least in my game readme?

Well really where ever you want. Just as long as my name appears somewhere in your game, readme, or credits. :P

Thanks for all the great comments guys! ;)

EDIT: Checked on the clean up thing. It has to do with the game's window procedure being overwritten. So I'll add a warning in the N_Menu_CleanUp script saying that you MUST call it before restarting the game/room.

Edited by Nintendofreak88, 06 March 2005 - 06:21 PM.

  • 0

#29 njgaming

njgaming

    GMC Member

  • New Member
  • 9 posts

Posted 06 March 2005 - 11:08 PM

Just wondering if you had a way to add in the things that are right aligned such as "Ctrl+O", like in most programs, if not could you try and add it in a newer version?

EDIT: Nevermind, you just add the character chr(9) to it.

Edited by njgaming, 06 March 2005 - 11:27 PM.

  • 0

#30 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 07 March 2005 - 12:52 AM

I added the abilities for default items. I also am no longer including a .gm6 file. Read the first post for more information. The download url is the same. Enjoy! ::lmao::

Edited by Nintendofreak88, 07 March 2005 - 12:53 AM.

  • 0

#31 eagleclaw364

eagleclaw364

    GMC Member

  • New Member
  • 296 posts

Posted 07 March 2005 - 04:56 PM

Well, mr Nintendofreak, the release of my program is delayed. I think I'm going to have to script it all over again basically, with a different DLL. :/ Coderchris is nowhere to be seen, so I can't get him to update his dll. :D but you will see it... someday ::lmao::
  • 0

#32 Timmo

Timmo

    GMC Member

  • New Member
  • 558 posts
  • Version:GM:HTML5

Posted 21 March 2005 - 02:00 PM

Cool system. But does it really use 13*13 pics?
Newer programs uses 16*16. How do use 16*16 pics, and when i use the pics(adding them to the menu) then the colours are changed to worse...What to do with that?
  • 0

Posted Image Posted Image


#33 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 21 March 2005 - 10:41 PM

Well I'll look at it more but that's just a windows api thing. Nothing I can do about it.
  • 0

#34 Timmo

Timmo

    GMC Member

  • New Member
  • 558 posts
  • Version:GM:HTML5

Posted 22 March 2005 - 10:18 AM

But how do make so that the box who has the triangle owns a picture:
---------------
|pic ->
---------------
  • 0

Posted Image Posted Image


#35 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 22 March 2005 - 10:03 PM

I don't really understand your question...
  • 0

#36 Catdaemon

Catdaemon

    Sheep Launcher

  • New Member
  • 1146 posts

Posted 22 March 2005 - 10:39 PM

I think he means the menus like file > save > to disk ( for example ) he wants the save part to have an image.. not sure
  • 0

#37 david24

david24

    Owner of GrayDragon.net

  • New Member
  • 165 posts

Posted 01 April 2005 - 06:05 PM

This is an awesome DLL. I'm using it in my FrontDesk (business management) software!
  • 0

#38 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 01 April 2005 - 10:18 PM

Thanks! Glad someone's putting it to good use! ::lmao::
  • 0

#39 BZGaming

BZGaming

    GMC Member

  • New Member
  • 514 posts

Posted 02 April 2005 - 08:21 PM

Hey nintendofreak88 I'm gunna use your dll for a program of mine for easier java editing, though it won't have a compiler... But I was gunna use all C++ for this program, my editor and compiler posed problems that agervated me too much so I decided to stick with GM on this, and fount your dll and find it the best menu dll... And I may have a proposition for you... I'll pm you with details...


BZG
  • 0

#40 heavenraiser

heavenraiser

    GMC Member

  • New Member
  • 6 posts

Posted 01 May 2005 - 03:46 PM

How do all you people understand it right away? and i cant... a tutorial would be great...
anyway, good dll
  • 0

#41 Shaltif

Shaltif

    The Audio Master

  • GMC Elder
  • 1185 posts

Posted 01 May 2005 - 07:59 PM

How do all you people understand it right away? and i cant... a tutorial would be great...
anyway, good dll

<{POST_SNAPBACK}>

All the scripts have internal comments which explain the function. Make sure to read them. Also, this does come with an example which shows how it works. I recommend looking through that for additional help.

~Brandon
  • 0

#42 heavenraiser

heavenraiser

    GMC Member

  • New Member
  • 6 posts

Posted 04 May 2005 - 08:28 PM

owk i figured it out right now...
but now i have this problem
in my game/program there can be an unlimited amount of images(its an drawing program) and these will be saved under file->image->image 1
image 2
etc

this works fine, but when i want to check, i will have to check for all the images, but at the coding moment i dont know how much it will be... the number of images are saved as global.images

i tried using this
for (ggg=0;ggg<=global.images;ggg+=1)
{case image[ggg]:
//do things with ggg
break;}

i tried it with the {} and without them, but neither works... when i remove the loop and replace the ggg with 1, it works fine but this way it wont... do you know how i can solve this?

i thought since my question is related to this dll it was best to post it here
  • 0

#43 Shaltif

Shaltif

    The Audio Master

  • GMC Elder
  • 1185 posts

Posted 05 May 2005 - 12:39 AM

The case statement works only in a switch. So, that is why you getting errors.

I did this using the following method, however this will only work if you set things up correctly.

Every time I wanted to add a new item to a "expandable" menu, I would put the item id in an array slot. Then, when I do menu checking, I would make a loop which would check this array. example:

var count; count = 0;
while (count < numberOfItems) {
        if (argument0 = item[count]) {
           /*Do whatever*/
           count = numberOfItems;
        };
        count += 1;
};

All the menu id's are stored in the array item[] and the numberOfItems is the number of id's currently stored on the array. If you remove an item from the array, you will need to update the array correctly. Btw, argument0 in the example above was the menu selection return.

~Brandon
  • 0

#44 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 05 May 2005 - 11:52 AM

Lol thanks for answering questions for me shaltif! ;)

Edited by Nintendofreak88, 05 May 2005 - 11:52 AM.

  • 0

#45 seventoes

seventoes

    Yeah, I got that.

  • New Member
  • 106 posts

Posted 15 May 2005 - 04:54 AM

i get a black bar around my whole game window about 10 pixels big, and it makes it look like windows automaticly scaled down the window so that the bar would fit.

Im using windows XP and gm6.

Edited by seventoes, 15 May 2005 - 04:54 AM.

  • 0

#46 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 15 May 2005 - 12:09 PM

Increase the room height by about 20 pixels and then see if it does that. :)
  • 0

#47 seventoes

seventoes

    Yeah, I got that.

  • New Member
  • 106 posts

Posted 15 May 2005 - 04:06 PM

still doing it.
  • 0

#48 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 15 May 2005 - 04:55 PM

Really? In the game options what are your settings for making the frame resizable? Is it resizable? and if it is, what is the scale setting?
  • 0

#49 seventoes

seventoes

    Yeah, I got that.

  • New Member
  • 106 posts

Posted 15 May 2005 - 04:59 PM

Ah, thanks, i had keep aspect ratio on :)

I changed it to fixed at 100%.
  • 0

#50 Ravotus

Ravotus

    GMC Member

  • GMC Member
  • 327 posts

Posted 15 May 2005 - 05:10 PM

Oh ok that's great! Good to hear it wasn't a bug! :)
  • 0