Subject:
Newbie problems
From:
Manuel Teira Paz ####@####.####
Date:
19 Jan 2000 14:16:43 -0000
Message-Id: <Pine.GSO.4.21.0001191445500.6763-100000@hades>
Hello everybody. This is my first message to the list. First of all,
apologizes for my bad english.
I'm part of the development of a new operating system. It's a little
project, for an embedded system (for a Motorola Dragonball based system,
the Olivetti daVinci PDA). So, I wrote the driver for the daVinci screen
(it's just a framebuffer supporting 1, 2 and 4bpp) and it seems to work
fine. I built it into the OS core, because the vt stuff uses it. Then, I
made little changes into the microwin 0.87 Makefile (because the
equivalent of device.h is into the OS), and I was able to compile and link
an OS with the microwindows stuff into.
I've made a little demo that opens a window with a text message. I'm
attatching it just here because is a very little code, sorry:
#include <windows.h>
LRESULT CALLBACK wproc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static char szAppName[]="HolaWin";
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = (WNDPROC)wproc;
wndclass.cbClsExtra =0;
wndclass.cbWndExtra =0;
wndclass.hInstance =0;
wndclass.hIcon =0;
wndclass.hCursor =0;
wndclass.hbrBackground =(HBRUSH)GetStockObject(LTGRAY_BRUSH);
wndclass.lpszMenuName =NULL;
wndclass.lpszClassName = szAppName;
RegisterClass(&wndclass);
hwnd=CreateWindowEx(0L,
szAppName,
"Hola",
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT,
CW_USEDEFAULT,
80,
80,
NULL,
NULL,
NULL,
NULL);
ShowWindow(hwnd,iCmdShow);
UpdateWindow(hwnd);
while (GetMessage(&msg,NULL,0,0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK wproc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch (iMsg) {
case WM_CREATE:
break;
case WM_PAINT:
case WM_MOUSEFIRST:
hdc=BeginPaint(hwnd,&ps);
GetClientRect(hwnd,&rect);
DrawText(hdc, "Hola, NOS", -1, &rect,
DT_SINGLELINE|DT_CENTER|DT_VCENTER);
EndPaint(hwnd,&ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,iMsg,wParam,lParam);
}
return (0);
}
OK. I make no modifications into the winmain.c. After the calibration of
the screen (this is the last stage of the postboot), the desktop is
painted and them, the expected window paints, but after that, the Desktop
paints again and overwrites my window :-( . I added the WM_MOUSEFIRST, and
so, if I touch with the pen where the window should be, it is repainted.
If I try to drag the window around the desktop, it works (well, the shape
of the window remains painted in every place) and them, the desktop
overwrites the little window as before.
I'm not sure of what could be happen. So, could anybody test my little
demo and say me how does it work in another platform.
Should I need to made any change into the microwindows code because the
Dragonball, or differences bigendian and littleendian, etc.?
I think that the doubleclick doesn't works in my implementation. (The
window doesn't maximize when I doubleclick on the top bar) Could be
because my GetTickCount() only returns a 0L (non UNIX system) ?
Thank you very much for your time.
--
LLL LLLLL Manuel Teira Paz Telefonica I+D
LLL LLLLLLL Tfno: 34 91 337 9973 Infraestructura de Red (5240)
LLL L LLL LLL Fax: 34 91 337 4502 C/ Emilio Vargas, 6
LLL LLL LLL LLL ####@####.#### 28043 Madrid (Spain)
LLL L LLLLLLL --------------------------------------------------
LLL LLLLL "Sonreir cuando las cosas van mal, quiere decir que ya
tienes a quien echarle la culpa"