Etiketler

,

#include <Windows.h>
#include <WindowsX.h>

LRESULT CALLBACK WindowProc(HWND hWnd, 
 UINT message,
 WPARAM wParam, 
 LPARAM lParam); 

int WINAPI WinMain (HINSTANCE hInstance, 
 HINSTANCE hPrevInstance, 
 LPSTR lpCmdLine, 
 int nCmdShow)
{
 HWND hWnd;

 WNDCLASSEX ps;

 ZeroMemory(&ps, sizeof(WNDCLASSEX));

 ps.cbSize=sizeof (WNDCLASSEX);
 ps.style=CS_HREDRAW | CS_VREDRAW;
 ps.lpfnWndProc=(WNDPROC)WindowProc;
 ps.hInstance=hInstance;
 ps.hCursor=LoadCursor(NULL,IDC_ARROW);
 ps.hbrBackground=(HBRUSH)COLOR_WINDOW;
 ps.lpszClassName=L"by arch3ngin33r";

 RegisterClassEx(&ps);

 hWnd=CreateWindowEx(NULL, L"by arch3ngin33r", 
 L"arch3ngin33r's program", 
 WS_OVERLAPPEDWINDOW,
 300,300,500,400,NULL,NULL,
 hInstance,NULL);

 ShowWindow(hWnd,nCmdShow);

 MSG mesaj;

 while(TRUE)
 {
 DWORD baslangic_noktasi=GetTickCount();

 if(PeekMessage(&mesaj,NULL,0,0,PM_REMOVE))
 {
 if(mesaj.message==WM_QUIT)
 break;

 TranslateMessage(&mesaj);
 DispatchMessage(&mesaj);
 }

 while((GetTickCount()-baslangic_noktasi)<25);
 }

 return mesaj.wParam;
}

LRESULT CALLBACK WindowProc(HWND hWnd, 
 UINT message, 
 WPARAM wParam, 
 LPARAM lParam)
{
 switch(message)
 {
 case WM_DESTROY:
 {
 PostQuitMessage(0);
 return 0;
 }break;

 case WM_PAINT:
 {
 HDC hDC;
 PAINTSTRUCT PaintYapisi;
 RECT Konum;

 hDC=BeginPaint(hWnd, &PaintYapisi);

 GetClientRect(hWnd, &Konum);

 SetBkMode(hDC,TRANSPARENT);

 DrawText(hDC,
 L"ve BASARDIK...",
 -1,&Konum,
 DT_SINGLELINE|DT_CENTER|DT_VCENTER);

 EndPaint(hWnd, &PaintYapisi);

 return 0;
 }break;

 }
 return DefWindowProc(hWnd,message,wParam,lParam);
}
 
ve karsimiza cikan...
 
Reklamlar