Solved

Window in VC

Posted on 1998-10-09
1
206 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

Technology Partners: 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

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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
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.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

696 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