6 This small application removes GEOS disk write protection tag.
7 e.g. boot disk is always protected after boot-up
9 Maciej 'YTM/Elysium' Witkowiak
17 char diskName[17] = "";
19 static const graphicStr clearScreen = {
22 RECTANGLETO(319, 199),
26 static const dlgBoxStr mainDialog = {
28 DB_TXTSTR(TXT_LN_X, TXT_LN_2_Y,
29 CBOLDON "Remove protection on:" CPLAINTEXT),
30 DB_TXTSTR(TXT_LN_X, TXT_LN_3_Y, diskName),
31 DB_ICON(OK, DBI_X_0, DBI_Y_2),
32 DB_ICON(DISK, DBI_X_1, DBI_Y_2),
33 DB_ICON(CANCEL, DBI_X_2, DBI_Y_2),
37 static const dlgBoxStr changeDiskDlg = {
39 DB_TXTSTR(TXT_LN_X, TXT_LN_2_Y, CBOLDON "Insert new disk"),
40 DB_TXTSTR(TXT_LN_X, TXT_LN_3_Y, "into drive." CPLAINTEXT),
41 DB_ICON(OK, DBI_X_0, DBI_Y_2),
42 DB_ICON(CANCEL, DBI_X_2, DBI_Y_2),
46 static const dlgBoxStr errorDialog = {
48 DB_TXTSTR(TXT_LN_X, TXT_LN_2_Y, CBOLDON "Error happened..."),
49 DB_TXTSTR(TXT_LN_X, TXT_LN_3_Y, "exiting..." CPLAINTEXT),
50 DB_ICON(OK, DBI_X_0, DBI_Y_2),
56 DoDlgBox(&errorDialog);
63 /* Here we clear the screen. Not really needed anyway... */
64 GraphicsString(&clearScreen);
66 /* Get the name of current disk to show it in dialog box */
67 GetPtrCurDkNm(diskName);
70 switch (DoDlgBox(&mainDialog)) {
71 /* What's the result of dialog box? which icon was pressed? */
75 curDirHead[OFF_GS_DTYPE] = 0;
80 DoDlgBox(&changeDiskDlg);
81 GetPtrCurDkNm(diskName);
83 default: /* CANCEL is the third option */