944,221 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 692
  • C++ RSS
Oct 11th, 2009
-1

C++ OS

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Banned
cwats124 is offline Offline
1 posts
since Oct 2009
Oct 11th, 2009
1
Re: C++ OS
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.
C++ Syntax (Toggle Plain Text)
  1. #include <windows.h>
  2.  
  3. const char g_szClassName[] = "myWindowClass";
  4.  
  5. LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
  6. {
  7. switch(msg)
  8. {
  9. case WM_CLOSE:
  10. DestroyWindow(hwnd);
  11. break;
  12. case WM_DESTROY:
  13. PostQuitMessage(0);
  14. break;
  15. default:
  16. return DefWindowProc(hwnd, msg, wParam, lParam);
  17. }
  18. return 0;
  19. }
  20.  
  21. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  22. LPSTR lpCmdLine, int nCmdShow)
  23. {
  24. WNDCLASSEX wc;
  25. HWND hwnd;
  26. MSG Msg;
  27.  
  28. //Step 1: Registering the Window Class
  29. wc.cbSize = sizeof(WNDCLASSEX);
  30. wc.style = 0;
  31. wc.lpfnWndProc = WndProc;
  32. wc.cbClsExtra = 0;
  33. wc.cbWndExtra = 0;
  34. wc.hInstance = hInstance;
  35. wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  36. wc.hCursor = LoadCursor(NULL, IDC_ARROW);
  37. wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
  38. wc.lpszMenuName = NULL;
  39. wc.lpszClassName = g_szClassName;
  40. wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
  41.  
  42. if(!RegisterClassEx(&wc))
  43. {
  44. MessageBox(NULL, "Window Registration Failed!", "Error!",
  45. MB_ICONEXCLAMATION | MB_OK);
  46. return 0;
  47. }
  48.  
  49. hwnd = CreateWindowEx(
  50. WS_EX_CLIENTEDGE,
  51. g_szClassName,
  52. "The title of my window",
  53. WS_OVERLAPPEDWINDOW,
  54. CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
  55. NULL, NULL, hInstance, NULL);
  56.  
  57. if(hwnd == NULL)
  58. {
  59. MessageBox(NULL, "Window Creation Failed!", "Error!",
  60. MB_ICONEXCLAMATION | MB_OK);
  61. return 0;
  62. }
  63.  
  64. ShowWindow(hwnd, nCmdShow);
  65. UpdateWindow(hwnd);
  66.  
  67. while(GetMessage(&Msg, NULL, 0, 0) > 0)
  68. {
  69. TranslateMessage(&Msg);
  70. DispatchMessage(&Msg);
  71. }
  72. return Msg.wParam;
  73. }
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 .
Last edited by pspwxp fan; Oct 11th, 2009 at 9:36 am.
Reputation Points: 43
Solved Threads: 7
Junior Poster in Training
pspwxp fan is offline Offline
93 posts
since Feb 2009
Oct 11th, 2009
6
Re: C++ OS
>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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Oct 11th, 2009
1
Re: C++ OS
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
Reputation Points: 1429
Solved Threads: 129
Posting Virtuoso
William Hemsworth is offline Offline
1,542 posts
since Mar 2008
Oct 11th, 2009
3
Re: C++ OS
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004
Oct 12th, 2009
0
Re: C++ OS
Wow, nice where'd you get that from?
Very useful.
Reputation Points: 43
Solved Threads: 7
Junior Poster in Training
pspwxp fan is offline Offline
93 posts
since Feb 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Multimap problem
Next Thread in C++ Forum Timeline: Microsoft access permissions in c++ Builder





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC