Solved

Window in VC

Posted on 1998-10-09
1
191 Views
Last Modified: 2010-04-15
How can I do a window with vertical scrollbar and text in it with CreateWindow function.
0
Comment
Question by:arip
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 100 total points
ID: 1253451
An edit control (which can also be set to not allow editing) fits this criteria

HWND hWndEdit ;
hWndEdit = CreateWindow(
"edit",
"Hello world",
WS_CHILD | WS_VSCROLL | ES_LEFT | ES_MULTILINE, /* Add ES_READONLY if you don't want user to be able edit */
x,
y,
nWidth,
nHeight,
hWndParent,
(HMENU)1000,
hInstance,
NULL
) ;
 
1. Edit control can not be a top level window.  Therefore create this as a child window of your frame window (e.g. Call this when WM_CREATE is sent to your frame).  Your frame should include WS_CLIPCHILDREN style.

2. Don't forget to make this visible
ShowWindow( hWndEdit, SW_SHOW ) ;

3. Size this control x,y,nWidth,nHeight to fit your frame client area.  If you want to make it fit changes in the frame size, resize hWndEdit in response to WM_SIZE being sent to your frame.

4. Retain hWndEdit in a global or static variable.



0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now