|
|||||||
| ||
![]() |
|
|
Seçenekler | Arama | Stil |
![]() C programinizda eski win 3.1 pencere sistemi kullanin | ||||||||||
|
(#1)
|
||||||||||
|
[10]Yeni Üye
![]() ![]() >Mesaj Sayısı: 68
>Açtığı Konu: 30
Level: 7 [ ![]() ![]() ![]() ![]() ]Paylaşım: 0 / 153 Üyelik tarihi: Apr 2007
Kullanıcı No: 8207
Rep Puani: 100
Rep Derecesi :
![]() ![]() |
#include <windows.h>
#include <string.h> #include <iostream> LRESULT CALLBACK MainWndProc (HWND hwnd, UINT nMsg, WPARAM wParam, LPARAM lParam) { static HWND hwndButton = 0; static int cx, cy; HDC hdc; PAINTSTRUCT ps; RECT rc; switch (nMsg) { case WM_CREATE: { TEXTMETRIC tm; hdc = GetDC (hwnd); SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT)); GetTextMetrics (hdc, &tm); cx = tm.tmAveCharWidth * 30; cy = (tm.tmHeight + tm.tmExternalLeading) * 2; ReleaseDC (hwnd, hdc); hwndButton = CreateWindow ( "button", "Anladık be", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 0, 0, cx, cy, hwnd, (HMENU) 1, ((LPCREATESTRUCT) lParam)->hInstance, NULL ); return 0; break; } case WM_DESTROY: PostQuitMessage (0); return 0; break; case WM_PAINT: hdc = BeginPaint (hwnd, &ps); GetClientRect (hwnd, &rc); rc.bottom = rc.bottom / 2; DrawText (hdc, "Yazılımcı", -1, &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER); EndPaint (hwnd, &ps); return 0; break; case WM_SIZE: if (hwndButton && (wParam == SIZEFULLSCREEN || wParam == SIZENORMAL) ) { rc.left = (LOWORD(lParam) - cx) / 2; rc.top = HIWORD(lParam) * 3 / 4 - cy / 2; MoveWindow ( hwndButton, rc.left, rc.top, cx, cy, TRUE); } break; case WM_COMMAND: if (LOWORD(wParam) == 1 && HIWORD(wParam) == BN_CLICKED && (HWND) lParam == hwndButton) { DestroyWindow (hwnd); } return 0; break; } return DefWindowProc (hwnd, nMsg, wParam, lParam); } int STDCALL WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) { HWND hwndMain; MSG msg; WNDCLASSEX wndclass; char*szMainWndClass = "WinTestWin"; memset (&wndclass, 0, sizeof(WNDCLASSEX)); wndclass.lpszClassName = szMainWndClass; wndclass.cbSize = sizeof(WNDCLASSEX); wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = MainWndProc; wndclass.hInstance = hInst; wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); RegisterClassEx (&wndclass); hwndMain = CreateWindow ( szMainWndClass, "Pencere::Hazirkod", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInst, NULL ); ShowWindow (hwndMain, nShow); UpdateWindow (hwndMain); while (GetMessage (&msg, NULL, 0, 0)) { TranslateMessage (&msg); DispatchMessage (&msg); } return msg.wParam; } |
|||||||||
|
||||||||||
|
|
![]() Cevap: C programinizda eski win 3.1 pencere sistemi kullanin | ||||||||||
|
(#2)
|
||||||||||
|
[45]Kategori Moderatör
![]() ![]() ![]() >Mesaj Sayısı: 310
>Açtığı Konu: 41
Level: 16 [ ]Paylaşım: 38 / 386 Üyelik tarihi: Apr 2007
Kullanıcı No: 3277
Nerden: Desktop
Rep Puani: 135
Rep Derecesi :
![]() ![]() |
queen bunları da proje olu$tururken consol application olarakmı yapıyoruz??
|
|||||||||
|
||||||||||
![]() |
| Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir) | |
| Seçenekler | Arama |
| Stil | |
|
|