• (2 Pages)
  • +
  • 1
  • 2

Introduction to the WinAPI Creating a basic window Rate Topic: -----

#16 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3106
  • View blog
  • Posts: 19,145
  • Joined: 14-September 07

Posted 07 February 2011 - 04:02 PM

destroy or close window
Was This Post Helpful? 0
  • +
  • -

#17 Poppa Mintin  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 72
  • Joined: 13-September 08

Posted 19 September 2012 - 06:24 AM

View PostKYA, on 15 August 2008 - 10:39 PM, said:

Note how we move all the messy window creation to a separate function (which would normally be in a separate header file, but out here for display purposes). This code will create a window, paint the background black and will have the title of "A window for <Dream in Code>"

edited to add picture and a typo

( Why would you wish edit to add a typo? :) )

Thank you for a nice exercise, easy to follow, I'm posting one small suggested alteration to show that I understood the code:
//Text "area"
	hwndStatic = CreateWindow(TEXT("static"), TEXT(" This is some text"), 
                  WS_CHILD | WS_VISIBLE,
                  116, 30, 400, 200, hwnd, NULL, hInst, NULL); 
        return;

Changed 150 to 116 to put the textbox central within window width, I think it looks tidier.
Window 640 px wide, Textbox 400 px wide, Window left and right margins 4 px wide.
640 - 400 = 240. / 2 = 120. - 4 = 116.

Poppa.
Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2