• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Mullvad

Differens bettwen window and controls

8 posts in this topic

What is the diffrent and how do you do a control. Can someone please write the code for a control in BC++ please. If someone wondring i am folowing the tutorial on winprog.org and have camed to the chapther on controls but now I am stuck please please help. Mullvad
0

Share this post


Link to post
Share on other sites
Technically controls are types of windows. To create a control you can create it just like you would a window but you dont have to register a class (for normal controls at least) because they''re already pre-registered classes like:

"EDIT" (which makes an edit control)

Look up CreateWindowEx on MSDN and it lists some other pre-registered window classes.

What problems are you having exactly?

Invader X
Invader''s Realm
0

Share this post


Link to post
Share on other sites
I have one more quetien How the **** do you create a EDIT control and it most be some diffrens bettwen Controls and windows or??

Mullvad
0

Share this post


Link to post
Share on other sites
although i DO know how to do this, it is quite confusing for a new person as to where to accually place this code from the f''ing manual. it might look simple to somebody doing it for a while, but it is hard for me and probably mullvad from that explanation. i was hoping somebody could clarify where to accually place the functions that accually modify the control im wanting to change, which is the static text font, color, and background.
0

Share this post


Link to post
Share on other sites
I''m not exactly sure what you mean by "where to place this code". Do you mean where "EDIT" goes in CreateWindowEx() or where CreateWindowEx() goes in your code?

Invader X
Invader''s Realm
0

Share this post


Link to post
Share on other sites
Generally, you want your controls to be child windows of your main window. The typical place to create controls is in the WM_CREATE handler. You'll want to use the HWND value for your main window as the parent for the controls.

The combination of styles that you can apply to a child window vary according to the type of control you want to create. For the most part, you can mix and match until you find a style that appeals to you - but there are a couple of styles that you can't mix together. WS_POPUP doesn't always play nice with the WS_CHILD style - you'll have to pay attention to what the docs for the particular type of control have to say about which styles to use. The extended styles - used with CreateWindowEx - provide a few more styles to choose from.

Most of the time you can use CW_USEDEFAULT for the dimensions to the child windows, but not always. You'll have to figure out when on your own. You can leave the HMENU value NULL or you can assign a resource id to the child - but you have to cast the id as a HMENU. The HINSTANCE value should be the same as that passed in to WinMain - you can use a global variable for that - or use GetModuleHandle(NULL) as the NULL parameter will force the return of the HMODULE for your application. HMODULE and HINSTANCE are the same thing - it's a throw back to the days of 16 bit windows. For best results, cast the return from GetModuleHandle(NULL) as a HINSTANCE. The very last parameter can be used to store a pointer to data. You won't need to use it much now, but after you get more comfortable with creating child windows, you'll find that parameter to be very helpful.

After you create the child window, you can then set the font, the color etc. Here's a little snippet:

    

HWND hEdit = CreateWindowEx(WS_EX_TOOLWINDOW
, TEXT("EDIT")
, TEXT("")
, WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |
ES_LEFT | ES_MULTILINE | ES_WANTRETURN |
ES_AUTOVSCROLL | ES_AUTOHSCROLL
, CW_USEDEFAULT, CW_USEDEFAULT
, CW_USEDEFAULT, CW_USEDEFAULT
, hwndParent
, (HMENU)IDC_CHILD_EDIT
, (HINSTANCE)GetModuleHandle(NULL)
, NULL);

if ( hEdit != NULL ) { // don't set the font if the windows bad


SendMessage(hEdit
, WM_SETFONT
, (WPARAM)GetStockObject(ANSI_FIXED_FONT)
, MAKELPARAM(TRUE, 0));

}



I should have added that this is C, so YMMV - and the TEXT macro takes care of making the string unicode when you're using unicode, but otherwise leaves the string as ansi. Sometimes you'll see _T("string") instead. It's not required, it's just good practice.



‘But truth's a menace, science a public danger.’ Brave New World, Aldous Huxley

Edited by - lessbread on January 23, 2002 11:28:25 PM
0

Share this post


Link to post
Share on other sites