954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

C++ OS

Even though I am 8 :), I WANT to make an OS. Something to be proud of.
I normaly use VB but I am now starting a bit of C++ programming.

Thanks ,
Campbell

cwats124
Newbie Poster
Banned
1 post since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

8? Are you serious? Wtf, Get your ass away from the computer and work on school, football and other stuff >:[.
And FYI, OS's take dedicated teams months or even years to make. Come back to C++ when you're at least a teenager.

Oh, and to give you an example of one of the simplest things you are looking for, heres the C++ code for a blank Window, kind of like Internet Explorer but with nothing but the blue title bar and borders.

#include <windows.h>

const char g_szClassName[] = "myWindowClass";

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_CLOSE:
            DestroyWindow(hwnd);
        break;
        case WM_DESTROY:
            PostQuitMessage(0);
        break;
        default:
            return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
    WNDCLASSEX wc;
    HWND hwnd;
    MSG Msg;

    //Step 1: Registering the Window Class
    wc.cbSize        = sizeof(WNDCLASSEX);
    wc.style         = 0;
    wc.lpfnWndProc   = WndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = g_szClassName;
    wc.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);

    if(!RegisterClassEx(&wc))
    {
        MessageBox(NULL, "Window Registration Failed!", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    hwnd = CreateWindowEx(
        WS_EX_CLIENTEDGE,
        g_szClassName,
        "The title of my window",
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
        NULL, NULL, hInstance, NULL);

    if(hwnd == NULL)
    {
        MessageBox(NULL, "Window Creation Failed!", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    ShowWindow(hwnd, nCmdShow);
    UpdateWindow(hwnd);

    while(GetMessage(&Msg, NULL, 0, 0) > 0)
    {
        TranslateMessage(&Msg);
        DispatchMessage(&Msg);
    }
    return Msg.wParam;
}

Tl;dr: Programming is not for under-14's at all. It usually requires mathematical abilities too. It is appreciative that you have a lust for it, but let it wait :) .

pspwxp fan
Junior Poster
100 posts since Feb 2009
Reputation Points: 43
Solved Threads: 7
 

>Even though I am 8
If you're 8 years old then you are in violation of Daniweb's policies (members must be at least 13 years of age). Therefore, I'll report this thread so that you can be properly banned for the next five years.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

You have to admit, for an 8 year old that's a pretty well presented post compared to some people on here who are in Uni.
Stick to something easier for a while, believe me you're not ready for C++ yet, maybe in 3/4 years, in the meanwhile stick to VB or Flash, you know... the sort of things a normal 8 year old would do ;)

William Hemsworth
Posting Virtuoso
1,591 posts since Mar 2008
Reputation Points: 1,429
Solved Threads: 129
 
Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 
http://wiki.osdev.org/Main_Page


Wow, nice where'd you get that from? :)
Very useful.

pspwxp fan
Junior Poster
100 posts since Feb 2009
Reputation Points: 43
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You