^- /* Listing #8 */ #include #include #include #include struct IntuitionBase *IntuitionBase; struct GfxBase *GfxBase; struct Screen *wbscreen, *ekran=0; struct DrawInfo *wbdinfo=0; ULONG wbmodeid; void wyjscie(int kodpowr) { if (ekran) CloseScreen(ekran); if (wbdinfo) FreeScreenDrawInfo(wbscreen, wbdinfo); if (wbscreen) UnlockPubScreen(0, wbscreen); CloseLibrary((struct Library*)GfxBase); CloseLibrary((struct Library*)IntuitionBase); exit(kodpowr); } int main(int argc, char *argv[]) { check_os(OS_20); if (!(IntuitionBase=(struct IntuitionBase*)OpenLibrary("intuition.library", 37))) return 20; if (!(GfxBase=(struct GfxBase*)OpenLibrary("graphics.library", 37))) { CloseLibrary((struct Library*)IntuitionBase); return 20; } if (((struct Library*)IntuitionBase)->lib_Version<39) { if (!(wbscreen=LockPubScreen(0))) wyjscie(10); if (!(wbdinfo=GetScreenDrawInfo(wbscreen))) wyjscie(10); if ((wbmodeid=GetVPModeID(&wbscreen->ViewPort))==INVALID_ID) wyjscie(10); ekran=OpenScreenTags(0, SA_Width, wbscreen->Width, SA_Height, wbscreen->Height, SA_Depth, wbdinfo->dri_Depth, SA_Title, "Klon Workbencha", SA_SysFont, 1, SA_Type, CUSTOMSCREEN, SA_DisplayID, wbmodeid, SA_AutoScroll, (wbscreen->Flags & AUTOSCROLL), SA_Pens, wbdinfo->dri_Pens, TAG_DONE); } else ekran=OpenScreenTags(0, SA_Title, "Klon Workbencha", SA_LikeWorkbench, TRUE, TAG_DONE); if (!ekran) wyjscie(10); Delay(500); wyjscie(0); }