Create a window from... cont'd

This is a discussion on Create a window from... cont'd within the Windows Programming forums, part of the Platform Specific Boards category; a couple weeks back, peter was trying to create a window from a dialog. i'm using plain api and i ...

  1. #1
    Registered User WayTooHigh's Avatar
    Join Date
    Aug 2001
    Posts
    101

    Create a window from... cont'd

    a couple weeks back, peter was trying to create a window from a dialog. i'm using plain api and i followed ken's advice of CreateWindow(Ex). the window gets created but it won't show. i've tried calling ShowWindow but to no avail. any suggestions.

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    assuming the last arguement to winmain is iCmdShow and your HWND is hwnd then after creating the window you need to do this :-

    ShowWindow(hwnd,iCmdShow);
    UpdateWindow(hwnd);

    That will cause your window to be shown on the screen and painted. You will need to take care of the WM_PAINT message in your window procedure.....

    If that doesn't work then post your code for more help.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how i create a window whith all it's elements
    By rasheed in forum Windows Programming
    Replies: 1
    Last Post: 05-31-2006, 06:53 PM
  2. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  3. Adding colour & bmps to a Win 32 Window??
    By carey_sizer in forum Windows Programming
    Replies: 4
    Last Post: 09-04-2004, 05:55 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM
  5. Create a window from a dialogbox ?
    By peter in forum Windows Programming
    Replies: 7
    Last Post: 09-09-2001, 07:42 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21