Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / WinAPI Menu Creation. Almost working

Author
Message
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 14th Mar 2009 20:33
ok so i found this post when looking around in the forums(http://forum.thegamecreators.com/?m=forum_view&t=33405&b=1) its dbp but it uses winapi calls and so i tried to convert it. it works its just not displaying the menu when i click on it. heres a screen shot:



and heres the code:



New Site! Check it out \/
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 14th Mar 2009 20:38
Hmm, pretty neat, Caleb! Well done! Now I guess you can just use this for your paint program then, eh?

~QJ
That's what they WANT you to think...
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 14th Mar 2009 20:48
hahaha ya and other things hahaha oh i fixed it! it all works properly now i just have to go to msdn and figure out how to get info from it!


the thing that fixed it wwas that the constant MS_Popup was wrong while searching the forums i found a someone who uploaded a txt file with all the winapi constants and i changed it appropriatly it works now i'll upload the file for anyone who wants it! i'm exited

New Site! Check it out \/
AndrewT
18
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 14th Mar 2009 20:57
I did this not too long ago as well, with DBP, though I didn't post about it. However I stopped working on it when I couldn't figure out how to process windows messages from within DBP--in fact I'm not totally sure if it's even possible.

Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 14th Mar 2009 21:11
Quote: "However I stopped working on it when I couldn't figure out how to process windows messages from within DBP--in fact I'm not totally sure if it's even possible."

Not natively. You need to get the address of a user function to use as a callback to process these messages, and you need a DLL function to act as a proxy to translate the cdecl (DBP's calling convention) call to that of a stdcall (WinAPI's calling convention). IanM's probably written something that can do this, and if not it's not a terribly difficult task.

Thought, for DBC it just isn't possible as far as I know.

Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 14th Mar 2009 21:59
are you saying theres no way to return the menu or item or whatever from windows?

New Site! Check it out \/
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Mar 2009 18:36
For DBC, you have to subclass the the DBC window and use your own wndproc to receive the commands being sent to the window. You can write the wndproc in a dll.

Enjoy your day.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th Mar 2009 20:15
oh well I can't do dlls yet lolol well it's still cool to make

New Site! Check it out \/

Login to post a reply

Server time is: 2025-05-16 15:34:40
Your offset time is: 2025-05-16 15:34:40