mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 19:26:33 +00:00
- I'm going to try my hand at porting the WINE edit control as Richard and Ge work on User32 svn path=/trunk/; revision=4793
83 lines
1.5 KiB
C
83 lines
1.5 KiB
C
#include <windows.h>
|
|
#include <stdio.h>
|
|
|
|
HFONT tf;
|
|
LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
|
|
|
|
int WINAPI
|
|
WinMain(HINSTANCE hInstance,
|
|
HINSTANCE hPrevInstance,
|
|
LPSTR lpszCmdLine,
|
|
int nCmdShow)
|
|
{
|
|
WNDCLASS wc;
|
|
MSG msg;
|
|
HWND hWnd;
|
|
HWND hWnd2;
|
|
|
|
wc.lpfnWndProc = MainWndProc;
|
|
wc.style = CS_VREDRAW | CS_HREDRAW;
|
|
wc.hInstance = hInstance;
|
|
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
|
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
|
wc.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
|
|
wc.lpszMenuName = NULL;
|
|
wc.cbClsExtra = 0;
|
|
wc.cbWndExtra = 0;
|
|
if (RegisterClass(&wc) == 0)
|
|
{
|
|
fprintf(stderr, "RegisterClass failed (last error 0x%X)\n",
|
|
GetLastError());
|
|
return(1);
|
|
}
|
|
|
|
hWnd = CreateWindow("EDIT",
|
|
"Edit Control Test",
|
|
WS_OVERLAPPEDWINDOW|WS_VISIBLE,
|
|
0,
|
|
0,
|
|
320,
|
|
240,
|
|
NULL,
|
|
NULL,
|
|
hInstance,
|
|
NULL);
|
|
|
|
if (!hWnd)
|
|
{
|
|
fprintf(stderr, "CreateWindow failed (last error 0x%X)\n",
|
|
GetLastError());
|
|
return(1);
|
|
}
|
|
ShowWindow(hWnd, nCmdShow);
|
|
|
|
while(GetMessage(&msg, NULL, 0, 0))
|
|
{
|
|
TranslateMessage(&msg);
|
|
DispatchMessage(&msg);
|
|
}
|
|
return msg.wParam;
|
|
}
|
|
|
|
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|
{
|
|
PAINTSTRUCT ps;
|
|
HDC hDC;
|
|
|
|
switch(msg)
|
|
{
|
|
case WM_PAINT:
|
|
hDC = BeginPaint(hWnd, &ps);
|
|
EndPaint(hWnd, &ps);
|
|
break;
|
|
|
|
case WM_DESTROY:
|
|
PostQuitMessage(0);
|
|
break;
|
|
|
|
default:
|
|
return DefWindowProc(hWnd, msg, wParam, lParam);
|
|
}
|
|
return 0;
|
|
}
|