A patch to add items to the Windows system menu (sample code)

Here you can discuss the development of patches.

A patch to add items to the Windows system menu (sample code)

Postby emendelson » 2016-5-04 @ 02:22

Here is a patch that adds a few items to the DOSBox Windows system menu (the menu that opens when you click the icon at the upper left of the DOSBox window). It's designed to be applied to current SVN (r3981, updated today). As in the clipboard-paste patch that I posted earlier, the code is NOT my work; I wouldn't know how to begin writing something like this. All I did was finally figure out how to make a patch that applies this feature to SVN. Everything in it is taken from the code for dbDOS 3.0, a commercial offshoot of DOSBox, written by a contract programmer whose name seems to be Olivier Hamel.

The patch only affects sdlmain.cpp. As you can see from the code, when applied to current SVN, it adds three items to the system menu, and these are meant as examples of what a non-programmer like myself can do. One item switches from windowed to full-screen mode by using the same routine used by Alt-Enter. Another item opens an About box which of course can give any information. A third item opens the dosbox.com website; the same technique can be used to open any application or file in Windows from the DOSBox system menu.

I hope I've put together the diff correctly. I don't actually know what I'm doing, but the code certainly works and I hope the diff is useful to someone. It's a small return for all the help I've had here over the years.
You do not have the required permissions to view the files attached to this post.
emendelson
Oldbie
 
Posts: 747
Joined: 2010-2-14 @ 02:00

Re: A patch to add items to the Windows system menu (sample code)

Postby Dominus » 2016-5-04 @ 13:08

moved to patches!
User avatar
Dominus
DOSBox Moderator
 
Posts: 7675
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg


Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 2 guests