/* KSC5601 test program*/
|
/* KSC5601 test program*/
|
#include <windows.h>
|
#include <windows.h>
|
|
|
LRESULT CALLBACK wproc(HWND,UINT,WPARAM,LPARAM);
|
LRESULT CALLBACK wproc(HWND,UINT,WPARAM,LPARAM);
|
|
|
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
PSTR szCmdLine, int iCmdShow)
|
PSTR szCmdLine, int iCmdShow)
|
{
|
{
|
static char szAppName[]="HolaWin";
|
static char szAppName[]="HolaWin";
|
HWND hwnd;
|
HWND hwnd;
|
MSG msg;
|
MSG msg;
|
WNDCLASS wndclass;
|
WNDCLASS wndclass;
|
|
|
wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
|
wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
|
wndclass.lpfnWndProc = (WNDPROC)wproc;
|
wndclass.lpfnWndProc = (WNDPROC)wproc;
|
wndclass.cbClsExtra =0;
|
wndclass.cbClsExtra =0;
|
wndclass.cbWndExtra =0;
|
wndclass.cbWndExtra =0;
|
wndclass.hInstance =0;
|
wndclass.hInstance =0;
|
wndclass.hIcon =0;
|
wndclass.hIcon =0;
|
wndclass.hCursor =0;
|
wndclass.hCursor =0;
|
wndclass.hbrBackground =(HBRUSH)GetStockObject(LTGRAY_BRUSH);
|
wndclass.hbrBackground =(HBRUSH)GetStockObject(LTGRAY_BRUSH);
|
wndclass.lpszMenuName =NULL;
|
wndclass.lpszMenuName =NULL;
|
wndclass.lpszClassName = szAppName;
|
wndclass.lpszClassName = szAppName;
|
|
|
RegisterClass(&wndclass);
|
RegisterClass(&wndclass);
|
hwnd=CreateWindowEx(0L,
|
hwnd=CreateWindowEx(0L,
|
szAppName,
|
szAppName,
|
"Hola",
|
"Hola",
|
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
CW_USEDEFAULT,
|
CW_USEDEFAULT,
|
CW_USEDEFAULT,
|
CW_USEDEFAULT,
|
200,
|
200,
|
200,
|
200,
|
NULL,
|
NULL,
|
NULL,
|
NULL,
|
NULL,
|
NULL,
|
NULL);
|
NULL);
|
|
|
|
|
ShowWindow(hwnd,iCmdShow);
|
ShowWindow(hwnd,iCmdShow);
|
UpdateWindow(hwnd);
|
UpdateWindow(hwnd);
|
|
|
while (GetMessage(&msg,NULL,0,0)) {
|
while (GetMessage(&msg,NULL,0,0)) {
|
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
}
|
}
|
return msg.wParam;
|
return msg.wParam;
|
}
|
}
|
LRESULT CALLBACK wproc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK wproc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
{
|
{
|
HDC hdc;
|
HDC hdc;
|
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
RECT rect;
|
RECT rect;
|
|
|
switch (iMsg) {
|
switch (iMsg) {
|
case WM_CREATE:
|
case WM_CREATE:
|
break;
|
break;
|
case WM_PAINT:
|
case WM_PAINT:
|
/*case WM_MOUSEFIRST:*/
|
/*case WM_MOUSEFIRST:*/
|
hdc=BeginPaint(hwnd,&ps);
|
hdc=BeginPaint(hwnd,&ps);
|
GetClientRect(hwnd,&rect);
|
GetClientRect(hwnd,&rect);
|
DrawText(hdc, "Hola, NOS ぞたい廃", -1, &rect,
|
DrawText(hdc, "Hola, NOS ぞたい廃", -1, &rect,
|
DT_SINGLELINE|DT_CENTER|DT_VCENTER);
|
DT_SINGLELINE|DT_CENTER|DT_VCENTER);
|
EndPaint(hwnd,&ps);
|
EndPaint(hwnd,&ps);
|
break;
|
break;
|
case WM_DESTROY:
|
case WM_DESTROY:
|
PostQuitMessage(0);
|
PostQuitMessage(0);
|
break;
|
break;
|
default:
|
default:
|
return DefWindowProc(hwnd,iMsg,wParam,lParam);
|
return DefWindowProc(hwnd,iMsg,wParam,lParam);
|
}
|
}
|
return (0);
|
return (0);
|
}
|
}
|
|
|