Thread: view window

  1. #1
    yes, I'm registered!!! algi's Avatar
    Join Date
    Nov 2004
    Location
    Ipswich
    Posts
    161

    view window

    my computer seems to have a problem where it compiles ain api code without any errors and then can't view the window. Even on some of my old prodjects thay don't work. I use Dev c++.

    I have realised that it is only when i use windclass. winclassex works fine.

    Thanks in advance
    Last edited by algi; 03-10-2005 at 04:37 PM.
    I started out with nothing and I still have most of it left.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Are you checking the return values of the API calls to make sure there are not errors? Are you showing the windows with SW_SHOW?

  3. #3
    yes, I'm registered!!! algi's Avatar
    Join Date
    Nov 2004
    Location
    Ipswich
    Posts
    161
    no what is WS_SHOW
    I started out with nothing and I still have most of it left.

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Code:
    ShowWindow(hwnd,SW_SHOW);
    Woop?

  5. #5
    C++ Enthusiast jmd15's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    532
    When you start the WinMain you define an integer, specifically int iCmdShow. You can call it different things but you can use that variable to show your window also. If you just want it visible that's how I do it, if I want it transparent or whatever I use those SW values. The iCmdShow integer is defined like this, in case you don't know what variable I am talking about.
    Code:
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCe hPrevInstance,PSTR szCmdLine,int iCmdShow)
    {
    Then just use the ShowWindow function like this:
    Code:
    ShowWindow(hwnd,iCmdShow);
    UpdateWindow(hwnd);
    Note: Depending on the purpose of your program you may or may not want to include UpdateWindow. Usually you do but just in case you might not.
    Trinity: "Neo... nobody has ever done this before."
    Neo: "That's why it's going to work."
    c9915ec6c1f3b876ddf38514adbb94f0

  6. #6
    yes, I'm registered!!! algi's Avatar
    Join Date
    Nov 2004
    Location
    Ipswich
    Posts
    161
    thanks it's worked
    I started out with nothing and I still have most of it left.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM