Solved

Window in VC

Posted on 1998-10-09
1
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
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 structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.

737 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