OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [mw/] [src/] [demos/] [mwin/] [mtest_ksc.c] - Blame information for rev 1765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 673 markom
/* KSC5601 test program*/
2
#include <windows.h>
3
 
4
LRESULT CALLBACK wproc(HWND,UINT,WPARAM,LPARAM);
5
 
6
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
7
                   PSTR szCmdLine, int iCmdShow)
8
{
9
        static char szAppName[]="HolaWin";
10
        HWND hwnd;
11
        MSG msg;
12
        WNDCLASS wndclass;
13
 
14
        wndclass.style          = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
15
        wndclass.lpfnWndProc    = (WNDPROC)wproc;
16
        wndclass.cbClsExtra     =0;
17
        wndclass.cbWndExtra     =0;
18
        wndclass.hInstance      =0;
19
        wndclass.hIcon          =0;
20
        wndclass.hCursor        =0;
21
        wndclass.hbrBackground  =(HBRUSH)GetStockObject(LTGRAY_BRUSH);
22
        wndclass.lpszMenuName   =NULL;
23
        wndclass.lpszClassName  = szAppName;
24
 
25
        RegisterClass(&wndclass);
26
        hwnd=CreateWindowEx(0L,
27
                          szAppName,
28
                          "Hola",
29
                          WS_OVERLAPPEDWINDOW | WS_VISIBLE,
30
                          CW_USEDEFAULT,
31
                          CW_USEDEFAULT,
32
                          200,
33
                          200,
34
                          NULL,
35
                          NULL,
36
                          NULL,
37
                          NULL);
38
 
39
 
40
        ShowWindow(hwnd,iCmdShow);
41
        UpdateWindow(hwnd);
42
 
43
        while (GetMessage(&msg,NULL,0,0)) {
44
                TranslateMessage(&msg);
45
                DispatchMessage(&msg);
46
        }
47
        return msg.wParam;
48
}
49
LRESULT CALLBACK wproc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
50
{
51
        HDC hdc;
52
        PAINTSTRUCT ps;
53
        RECT rect;
54
 
55
        switch (iMsg) {
56
        case WM_CREATE:
57
                break;
58
        case WM_PAINT:
59
        /*case WM_MOUSEFIRST:*/
60
                hdc=BeginPaint(hwnd,&ps);
61
                GetClientRect(hwnd,&rect);
62
                DrawText(hdc, "Hola, NOS ¤¾¤؟¤¤ار", -1, &rect,
63
                         DT_SINGLELINE|DT_CENTER|DT_VCENTER);
64
                EndPaint(hwnd,&ps);
65
                break;
66
        case WM_DESTROY:
67
                PostQuitMessage(0);
68
                break;
69
        default:
70
                return DefWindowProc(hwnd,iMsg,wParam,lParam);
71
        }
72
        return (0);
73
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.