razor5070 Posted August 8, 2008 Report Share Posted August 8, 2008 Well... Since i moved to native C++ it's just been a fun ride making apps... Figured ide ask here if anyone know's any good DX books? I made a form... Extended the glass .. now i want to add a DX component.. Straight from the Main.cpp #include <windows.h> #include <dwmapi.h> #pragma comment(lib,"dwmapi") bool Running = true; LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { case WM_DESTROY: //End(); //Running = false; PostQuitMessage(0); break; } return DefWindowProc(hWnd, Msg, wParam, lParam); } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { WNDCLASSEX wc; MSG Msg; HWND hWnd; wc.cbSize = sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC)WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = 0; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(RGB(0,0,0)); wc.lpszMenuName = NULL; wc.lpszClassName = "CTmain"; wc.hIconSm = 0; RegisterClassEx(&wc); hWnd = CreateWindow("CTmain", "DX Test", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 720, 400, NULL, NULL, hInstance, NULL); if (!hWnd) { return 0; } ShowWindow(hWnd, nShowCmd); UpdateWindow(hWnd); MARGINS mar = {0}; mar.cyBottomHeight = -1; DwmExtendFrameIntoClientArea ( hWnd, &mar ); ZeroMemory(&Msg, sizeof(Msg)); while (Running == true) { if (PeekMessage(&Msg, hWnd, 0, 0, PM_REMOVE)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } else { } } return 0; } Just messing around.. Any thaughts? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.