|
From: EviLToYLeT <evi...@us...> - 2004-08-28 19:56:36
|
Update of /cvsroot/notepro/pete-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2518/src Modified Files: main.cpp Log Message: Index: main.cpp =================================================================== RCS file: /cvsroot/notepro/pete-current/src/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 28 Aug 2004 19:13:37 -0000 1.2 --- main.cpp 28 Aug 2004 19:56:26 -0000 1.3 *************** *** 8,17 **** INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){ static TCHAR szAppName[] = "PETE"; //Application name ! HWND hWnd; //Handle to main window WNDCLASSEX wc; //Default window class MSG msg; //Procedure messages ! ZeroMemory(&wc,sizeof(WNDCLASSEX)); //Clear the window structure ! //Setting up our window structure wc.cbClsExtra = 0; --- 8,16 ---- INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){ static TCHAR szAppName[] = "PETE"; //Application name ! HWND hWnd,hToolbar; //Handle to main window WNDCLASSEX wc; //Default window class MSG msg; //Procedure messages ! ::ZeroMemory(&wc,sizeof(WNDCLASSEX)); //Clear the window structure //Setting up our window structure wc.cbClsExtra = 0; *************** *** 29,50 **** //Regsiter the window class ! if(!RegisterClassEx(&wc)){ ! MessageBox(0,"Error registering the window","Fatal Error", MB_ICONERROR); } //Create the window ! hWnd = CreateWindow(szAppName,szAppName,WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); if(!hWnd){ ! MessageBox(0,"Error creating the window", "Fatal Error", MB_ICONERROR); } //Display and update the window ! ShowWindow(hWnd,nShowCmd); ! UpdateWindow(hWnd); //Enter the message pump ! while(GetMessage(&msg,NULL,0,0)){ ! TranslateMessage(&msg); ! DispatchMessage(&msg); } return msg.wParam; --- 28,55 ---- //Regsiter the window class ! if(!::RegisterClassEx(&wc)){ ! ::MessageBox(0,"Error registering the window","Fatal Error", MB_ICONERROR); } //Create the window ! hWnd = ::CreateWindow(szAppName,szAppName,WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); if(!hWnd){ ! ::MessageBox(0,"Error creating the window", "Fatal Error", MB_ICONERROR); } + //Testing out toolbars + hToolbar = ::CreateWindowEx(WS_EX_TOOLWINDOW,szAppName,"Toolbar using same window proc", WS_POPUP| WS_SYSMENU | WS_THICKFRAME | WS_CAPTION,200,200,400,64,hWnd,NULL, GetModuleHandle(0),NULL); + //Display and update the window ! ::ShowWindow(hWnd,nShowCmd); ! ::UpdateWindow(hWnd); ! ! ::ShowWindow(hToolbar,nShowCmd); ! ::UpdateWindow(hToolbar); //Enter the message pump ! while(::GetMessage(&msg,NULL,0,0)){ ! ::TranslateMessage(&msg); ! ::DispatchMessage(&msg); } return msg.wParam; *************** *** 53,59 **** LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam){ switch(msg){ - case WM_CREATE: - MessageBox(hWnd, "hello", "hello", 0); - break; case WM_DESTROY: PostQuitMessage(0); --- 58,61 ---- *************** *** 62,65 **** } //Let windows handle the processing ! return DefWindowProc(hWnd,msg,wParam,lParam); } --- 64,67 ---- } //Let windows handle the processing ! return ::DefWindowProc(hWnd,msg,wParam,lParam); } |