Convert your old WinDom applications From WinDom version March 2000 Frequently Asked Questions
Programming guideline of WinDom

From WinDom June 1999

Event handling

The main different with old version of WinDom and the new one is the Event handling. Before, each window had a set of pointer matching a specific event. For example, the pointer win->redraw matched the WM_REDRAW event. In the new version, you can associate any event to any window (and more :)). For details, reads the EvntAttach() manual.

Old way New way
win->redraw = redraw; EvntAttach( win, WM_REDRAW, redraw);
win->destroy = destroy; EvntAttach( win, WM_DESTROY, destroy);
win->closed = closed; EvntAttach( win, WM_CLOSED, closed);
win->fulled = fulled; EvntAttach( win, WM_FULLED, fulled);
win->sized = sized; EvntAttach( win, WM_SIZED, sized);
win->moved = moved; EvntAttach( win, WM_MOVED, moved);
win->topped = topped; EvntAttach( win, WM_TOPPED, topped);
win->untopped = untopped; EvntAttach( win, WM_UNTOPPED, untopped);
win->iconified = icon; EvntAttach( win, WM_ICONIFY, icon);
win->uniconified = unicon; EvntAttach( win, WM_UNICONIFY, unicon);
win->alliconified = allicon; EvntAttach( win, WM_ALLICONIFY, allicon);
win->hslided = hslided; EvntAttach( win, WM_HSLID, hslided);
win->vslided = vslided; EvntAttach( win, WM_VSLID, vslided);

The special case of WM_ARROWED

The WA_UPLINED, WA_DNLINED, WA_LFLINED, WA_RTLINED, WA_UPPAGED, WA_DNPAGED, WA_LFPAGED, WA_RTPAGED are sub messages of the WM_ARROWED message. In the new WinDom version, it is only possible to attach the WM_ARROWED message :

Old way:

win->uppaged = uppage;
win->dnpaged = dnpage;
win->uplined = upline;
win->dnlined = dnline;
win->lfpaged = lfpage;
win->rtpaged = rtpage;
win->lflined = lfline;
win->rtlined = rtline;
New way:

EvntAttach( win, WA_ARROWED, arrow);

/* where arrow() is defined by: */

void arrow( WINDOW *win) {
	switch( evnt.buff[4]) {
	case WA_UPPAGED:
		uppage( win); break;
	case WA_DNPAGED:
		dnpage( win); break;
	/* etc ... */
	}
}
snd_msg()

This function is obsolet, use the more flexible and generic function ApplWrite(). The calls :

	snd_msg( win, msg, w4, w5, w6, w7);
	snd_msg( NULL, msg, w4, w5, w6, w7);
are replaced by :

	ApplWrite( app.id, msg, win->handle, w4, w5, w6, w7);
	ApplWrite( app.id, msg, w4, w5, w6, w7);
With ApplWrite, send a message is really easy. Example :

	ApplWrite( appl_find( "QED     ", VA_START, "C:\\NEWDESK.INF");
win->fullsize

This field in the WINDOW structure has been removed. It is remplaced by the bit WS_FULLSIZE in the status field.

The sequence :

	if( win->fullsize)
		printf( "full screen window);
is replaced by:

	if( win->status & WS_FULLSIZE)
		printf( "full screen window);