Thread: Windows 2000 Skeleton

  1. #1
    Registered User bljonk's Avatar
    Join Date
    Oct 2001
    Posts
    70

    Windows 2000 Skeleton

    i still getting error msgs while a try to open this app:

    #include <windows.h>

    LRESULT CALLBACK WindowFunc(HWND, UINT, WPARAM, LPARAM);
    char szWinName[ ] = "MyWin";

    int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE hPrevInst, LPSTR lpszArgs, int nWinMode){
    HWND hwnd;
    MSG msg;
    WNDCLASSEX wcl;
    /* */ wcl.cbSize = sizeof(WNDCLASSEX);
    wcl.hInstance = hThisInst;
    wcl.lpszClassName = szWinName;
    wcl.lpfnWndProc = WindowFunc;
    wcl.style = 0;
    /* */ wcl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wcl.hIconSm = NULL;
    wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
    wcl.lpszMenuName = NULL;
    wcl.cbClsExtra = 0;
    wcl.cbWndExtra = 0;
    /* */ wcl.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
    if(!RegisterClassEx(&wcl)) return 0;
    hwnd = CreateWindow(szWinName,"My Window Area",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFA ULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hThisIns t,NULL);
    ShowWindow(hwnd, nWinMode);
    UpdateWindow(hwnd);
    while(GetMessage(&msg, NULL, 0, 0)){
    TranslateMessage(&msg);
    DispatchMessage(&msg);
    }
    return msg.wParam;
    }
    LRESULT CALLBACK WindowFunc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
    switch(message){
    case WM_DESTROY:
    PostQuitMessage(0);
    break;
    default:
    return DefWindowProc(hwnd, message, wParam, lParam);
    }
    return 0;
    }
    Ünicode¬>world = 10.0£

  2. #2
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    522
    What error messages, it compiled fine for me.

  3. #3
    Registered User bljonk's Avatar
    Join Date
    Oct 2001
    Posts
    70
    "this is not an valid win32 | winnt | win2k application" stupid message boxes

    did u run it? how does it look! pretty hmm! my first Windows 2000 skeleton.
    Ünicode¬>world = 10.0£

  4. #4
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    522
    So it compiles with no warnings or error messages, it's when you run it you get the error's?

    >>this is not an valid win32
    When you started the project you did choose win32 application?

  5. #5
    Registered User bljonk's Avatar
    Join Date
    Oct 2001
    Posts
    70

    way there!

    I use DM(digital Mars) C/C++ compiler i don't know where to choose win32

    i'm start to feel dumb

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. XP Sucks
    By Darkman in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 01-19-2004, 07:54 PM
  2. Windows 2000 Pro. Personalized Start Menu?
    By SyntaxBubble in forum Tech Board
    Replies: 2
    Last Post: 08-31-2003, 08:38 AM
  3. WS POPUP and Windows 2000
    By Arrow Mk 84 in forum Windows Programming
    Replies: 13
    Last Post: 09-02-2002, 09:48 AM
  4. Windows 2000 Service Pack 3...
    By MrWizard in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 08-13-2002, 12:25 AM
  5. Networking Windows 2000 and Windows Me
    By FCP in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 08-29-2001, 09:10 AM