Click to See Complete Forum and Search --> : Win Api: Text output problems...


Y0rkieP
February 19th, 2007, 05:13 PM
as a newbie to win api and this forum, I hope not to annoy with lame questions.

I have studied c++ on and off for some time now and while I not mastered it, I like to feel I have a general understanding of it. there is still things to learn & still some things I just dont understand. Most of what I've learned has been dos-based apps and with an allmost too big a learning curve, a beginning with win api.

with time to waste I wrote a very simple adventure game some time ago. now wanting a to try again with a nice little GUI and buttons for directions, I want to re-make this game and learn something new.

I've looked at a number of online tutorials for Win Api, including forgers tutorial, ebooks and paperbacks such as sams: game programming in 24 hours.

Can anyone here tell me how to make a child window that displays text that scrolls once it gets to the bottom line.

Controlls:

Edit - seems good for word apps, but I dont want selection cut & paste.

Combos & list boxes - good for selecting things from lists, but not for my little app.

Static - good for static text like lables, but static.

also I've looked into rectangles, but their hardly child windows...

if anyone here can help or point me in the right directon of how to create a window with unselectable, scrolling text output, I would very much appreciate it - or maybe I'm that proverbial baby reaching for the top shelf (just not going to do it).

Thanky to all for your patience and for any help you may give me.

Regards.

ovidiucucu
February 19th, 2007, 06:26 PM
also I've looked into rectangles, but their hardly child windows...
Can you please, explain us what do you mean with "rectangles"?

how to create a window with unselectable, scrolling text output
Quite a hard task for a "newbie to win api". If you really are one as you said, my advice is to learn/try first less exotic WinAPI stuff.

Y0rkieP
February 20th, 2007, 03:39 PM
thanks ovi for your reply,

by rectangles I meant the rect keyword Ie:

switch (msg)
{
case WM_CREATE:
{
HWND Edit1;
RECT Area;
CreateWindowEx(options);
GetClientRect(Edit1, &Area);
}
}

Sorry for any confusion... Trying to figure out how to accomplish this task did seem a little impossible. Just diddnt know if it was me or just too advanced for me - appears to be the latter.

Like you say, maybe I should step back for more learning - fun, fun, fun.
Though I am keen to learn & often push too far, too fast - I must remember that I only know simplified C++ and still exist in the "must do in dos" catagory. I am aware that Win Api is difficult and not learned overnight.

Thanks again for your reply ovi... :-)

Ali Imran
February 22nd, 2007, 08:15 PM
Can anyone here tell me how to make a child window that displays text that scrolls once it gets to the bottom line.

Sorry, I did not follow "scrolls once it gets to the bottom line".

For this you can create a "readonly" EDIT control btw, which will not be editable but scrollable:
hwndScr = CreateWindowEx(0,_T("EDIT"), "_T("my text disp"),
WS_CHILD|ES_MULTILINE|WS_VSCROLL | WS_HSCROLL | ES_AUTOVSCROLL | ES_AUTOHSCROLL|ES_READONLY,
x,y,w,h,
parenthwnd,(HMENU)unique_ID,GetModuleHandle(NULL),NULL
);

unique_ID is id of new control, parenthwnd is parent window,
x,y,w,h are coordinates and width height.


regards