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.

Dark GDK / Menu's and Dialogs - DarkSDK Tutorial

Author
Message
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 22nd Apr 2005 03:01 Edited at: 31st May 2005 04:38
OLD

please goto:
http://forum.thegamecreators.com/?m=forum_view&t=54893&b=22
for the finished tutorial





Hey there!

Right. I feel so bad about the delay in my tutorial, especially considering it had people interested. I have been so busy - if im not doing "life stuff" then i have been grabbing every availiable moment to work on my own project Shisaku which some of you have seen me posting about.

The tutorial is still not finished im afraid. But I figured as I have left you guys hanging so long you deserve something so I have uploaded the first half of the tutorial. This covers Menu's in their entirity but not dialog boxes or custom forms. I have written a good half of the chapters on dialogs but they would be usless to you without the final half so I have cut them completly out for now.

For those wanting to implement a menu before the upgrade arrives with its supposed menu commands this is how

Because I havnt finished writing the entire thing yet it hasnt had final proof reading and stuff so if you find stupid errors please excuse them - report them here if you have time so I may fix it.

The document is a PDF file (adobe reader) and I have provided two compressed versions. One using rar, then after seeing some people complain about rar elsewhere I have provided a zip also.

rar:
-removed-
zip:
-removed-
I hope it is usful to someone, I will post in this thread when I have finished the chapters on dialogs and custom forms.

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
billy the kid
19
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 22nd Apr 2005 03:52
Dude, this is awesome. I havent tried it out myself, but I plan to.
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 22nd Apr 2005 06:32
It looks great, thank you so far

//Pentium IV 3200E/Prescott; 800Mhz FSB; Hyperthreading; WinXP Pro (!XP2); ATI R9700PRO; 1024MB RAM (2x 512MB "DualChanneled"; VC++ 6.0; Delphi; ADSL;
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 22nd Apr 2005 09:40
Thanks for your responses ^_^

If you find any errors, ranging from grammer/spelling to technical wrongs, then please let me know here so i can fix them

Also if you want more explination of something or something added to it let me know

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 22nd Apr 2005 18:49
Will do so, but at the moment I am in a "sleep"-state.
I have to wait for my .NET 2003 IDE to arrive

//Pentium IV 3200E/Prescott; 800Mhz FSB; Hyperthreading; WinXP Pro (!XP2); ATI R9700PRO; 1024MB RAM (2x 512MB "DualChanneled"; VC++ 6.0; Delphi; ADSL;
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 22nd Apr 2005 21:55
im not sure quite how well it will work in .net 2k3 - i wrote the tutorial for vc++ 6 The code should definatly be the same but i dont know if theres any differances between the resource editors and stuff so you might have to figure out a few things as you go ^^

should be more-or-less the same though.

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 22nd Apr 2005 23:30 Edited at: 22nd Apr 2005 23:31
Ah don't worry about, I am sure I can figure out

//Pentium IV 3200E/Prescott; 800Mhz FSB; Hyperthreading; WinXP Pro (!XP2); ATI R9700PRO; 1024MB RAM (2x 512MB "DualChanneled"; VC++ 6.0; Delphi; ADSL;
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 8th May 2005 09:41
so how did you get on with it? was it written okay? any questions comments? anything i should know before finishing up and releasing the full article?

do you LIKE it? XD

and are people interested in the full custom dialog/form aspect of it and want to see that hurried along? Lets get some feed back over here

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Spline
20
Years of Service
User Offline
Joined: 30th Oct 2004
Location: London U.K
Posted: 8th May 2005 19:46
great work Sephnroth,it works a treat
are you going to add to these tutorials, they are great for helping people, have you any plans for aditions
eg toolbars, massage boxes, dialog boxes
this is exactly the sort of help people nead to use SDK

keep up the great work
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 8th May 2005 22:27
Thanks a lot Sephnroth!
The article was very useful!

I have now added a menu (only shows if the mouse comes near the top)
("unloaded" with SetMenu ( g_Glob->hWnd, NULL ); )


Thank you again for this great article!!!

( and have a look in your mail inbox )

Smithy

//Pentium IV 3200E/Prescott; 800Mhz FSB; Hyperthreading; WinXP Pro (!XP2); ATI R9700PRO; 1024MB RAM (2x 512MB "DualChanneled"; VC++ 6.0; Delphi; ADSL;
Beavis
21
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 9th May 2005 22:11
Good work on tutorial, but I think that there is no need to explain basics of windows programming. I think that whole tutorial should be 2 - 3 pages.

--------
Beavis
http://www.progress-studio.com
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 9th May 2005 22:39
@Beavis
The important things like, how to get the windows handle with dgSDK.

But I think, there are many people that are using the dgDSK
and who have no background in windows API programming.
I think we should encourage such tutorials,
even if they might not "fit" into these forums.

And for those who know the basic of windows programming,
they don't have to download this tuts

Just my 1 1/2 copper coins,
smithy

//Pentium IV 3200E/Prescott; 800Mhz FSB; Hyperthreading; WinXP Pro (!XP2); ATI R9700PRO; 1024MB RAM (2x 512MB "DualChanneled"; VC++ 6.0; Delphi; ADSL;
billy the kid
19
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 10th May 2005 02:58
agreed
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 10th May 2005 05:26
@Beavis
I tried to make the tutorial as easy to read and quick to implement as possiable even writing in a style that allowed for copy/pasting code for the impatient. But any background on windows programming and how it works I added because I think it IS important.

If i litrally just gave you everything with no explination then you will learn nothing except maybe the names of some commands. Thans fine and all, but what if something unexpected went wrong? Knowing how things work internally will give you a better idea of which parts could be going wrong and make debugging easier. Just skipping ahead without basic knowledge just makes you incapable when you try and do something outside of my tutorial or if unexpected errors occur.

@Everyone else

Thanks very much for the encouragment Im glad it was usful. I'm guessing no errors have been found so far as no one has reported any I am working away on the dialog tutorial between other stuffs, dont worry i'll get it out to you ^^ It might be a bit bigger than the menu half because theres an awful lot you can do with dialogs and I want to cover them as much as possiable as well as potential problems with some of the controls that I personally ran into and had me stumped for a while.

An extra special thanks to Smithy who has gone beyond the call of duty as it were in supporting me with this and extra encouragment over email ^^

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Artus
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: France
Posted: 16th May 2005 19:29
Thank you Sephnroth for this clear and usefull tutorial.
It helped me a lot to reconnect to the Windows API that I had not used directly since a long time.

Quote: "MyMenu = LoadMenu(NULL, MAKEINTRESOURCE(IDR_MENU1));
[..]According to the MSDN the first parameter of
LoadMenu is some sort of reference to some module or other. I'm not entirely sure what that is but suspect it's to do
with having multiple resource files, and that parameter is used to tell it which resource file you are loading the menu
from."


The first parameter (HMODULE) is a reference to a loaded .dll or .exe. As an example, this can be used to store localized versions of text or image resources (one .dll per supported language, that you load on demand). This permits to add support to a new language without recompiling the main app.

You get the handle by:

HMODULE theModule=LoadLibrary("myResources_Fr.dll");
MyMenu = LoadMenu(theModule, MAKEINTRESOURCE(IDR_MENU1));

You should not forget to free the dll after use :
FreeLibrary(theModule);

Thanks again. I am expecting the next tutorial !
Artus.
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 23rd May 2005 03:55
Thankyou artus, the article has been updated my end with that information and you will be credited for it

Just a quick update for everyone - I have been working away on the tutorial again. I got 3 chapters done today so far and after a short break im about to continue. I've already written chapters to explain the creation of a simple dialog box and the code to get it in the program. Just a last chapter now about more advanced dialog interaction (setting text in a component, retriving text from an component, detecting mouse hover, etc) and it will be done although I may throw in another chapter about further advanced techniques like using GDI to manually blit bitmaps to the dialog and changing the colour of dialogs Maybe

But either way chances are it will be finished TONIGHT. However, you may not see it for a day or two because it needs to be edited and proof read like the last installment and my editor is working over time at the moment, although im sure he will spare me a few hours when he gets in

But stay tuned, not long now.

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 23rd May 2005 09:25
Just so that you know, the tutorial is now -FINISHED-

It is complete. Im tired and my fingers ache after writing like 4-5 chapters tonight. Its 10 chapters in total and covers simple to advanced stuff. Chapter 10 covers drawing to the dialog surface using the GDI api. As soon as my editor has finished doing his magical thang to it I will post a -new- post here with the tutorial inside and clean out the links from this one so theres no confusion. Expect it tomorrow or the day after depending on how much time my editor can spare

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd May 2005 21:35
Nice one - I'm looking forward to reading it myself

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 23rd May 2005 22:45
Hoozzah

ps: did you receive the "encouragement" ?

//Pentium IV 3200E/Prescott; 800Mhz FSB; Hyperthreading; WinXP Pro (!XP2); ATI R9700PRO; 1024MB RAM (2x 512MB "DualChanneled"; VC++ 6.0; Delphi; ADSL;
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 24th May 2005 00:26
Thanks all~

Yes smithy, and I cant thank you enough I almost have enough now to buy a book I want on HLSL shaders and stuff - also as my birthday is right around the corner it was awesome timing Thankyou lots ^^

If everything goes perfectly then the tutorial will be up today before the sun sets. My editor isnt around at the moment, i'm presuming hes at work (the sod got a beta testing job with konami! thats THREE of my friends that work there now. I've gotta get a hand in this..) but as soon as he gets in i will see if he can spare an hour or so to run over the article.

In the mean time i'm adding an apendix which contains a function listing of the functions we covered, their parameters and return types etc. Guess it could be usful for a quick refrance and its keeping me busy whilst im ill (sucks to be me :/)

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 25th May 2005 09:39
Okay well my editor finally turned up, hes been busy with overtime and also writing articles and reviews of gigs and stuff. But he got the tutorial tonight, nearly had a heart attack when he saw the new page count and then said he would get working on it

He reckons at the -latest- he will be done by friday. I am sorry for the extra delay, I didnt predict it ;;;;;;

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
scooby bloke
20
Years of Service
User Offline
Joined: 4th Nov 2004
Location:
Posted: 25th May 2005 19:26
Excellent. Looking forward to reading this
Max
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: Behind your back....
Posted: 27th May 2005 05:52
Excellent job! Thank you for publishing it =]

Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 27th May 2005 16:05
I have no problem with the delay, I am happy that it exists

//Pentium IV 3200E/Prescott; 800Mhz FSB; Hyperthreading; WinXP Pro (!XP2); ATI R9700PRO; 1024MB RAM (2x 512MB "DualChanneled"; VC++ 6.0; Delphi; ADSL;
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 29th May 2005 10:46
um, im a bit embarassed here
He isnt appearing online nor answering his mobile.. I have no idea where he is or if he finished editing the article

He doesnt live far so if i dont see him tomorrow I will goto his house and hunt him down, im sorry
*shy*

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol

Login to post a reply

Server time is: 2024-11-18 23:35:20
Your offset time is: 2024-11-18 23:35:20