- Boolean SetVisible (char* AppName, Boolean Visible)
- {
- DmOpenRef dbP;
- char *recordP;
- MemHandle recordH;
- LocalID dbIDP;
- UInt16 MaxPosition=0, i, lng;
- Boolean FoundIt=false;
-
- // Recherche de la table de l'application launcher
- dbIDP= DmFindDatabase (0,"psysLaunchDB");
- if (!dbIDP) return false;
-
- dbP = DmOpenDatabase (0, dbIDP, dmModeReadWrite);
- if (!dbP) return false;
-
- MaxPosition = DmNumRecords (dbP);
-
- for (i=0;i<MaxPosition && !FoundIt ;i++)
- {
- recordH = DmGetRecord (dbP, i);
- if (recordH != NULL)
- {
- recordP = MemHandleLock (recordH);
- // recordP+18 = Nom de l'application
- if (recordP!=NULL && (!StrCompare (recordP+18, AppName)))
- {
- // recordP[102] = Statut visible de l'application
- lng = recordP[102];
- FoundIt = true;
- if (Visible)
- {
- if (lng==4 ||lng==0) DmWrite(recordP, 102, "\4", 1);
- }
- else
- {
- if (lng==4 ||lng==0) DmWrite(recordP, 102, "\0", 1);
- }
- }
- MemPtrUnlock (recordP);
- DmReleaseRecord (dbP, i, false);
- }
- }
- DmCloseDatabase (dbP);
-
- return FoundIt;
-
- }
-
Boolean SetVisible (char* AppName, Boolean Visible)
{
DmOpenRef dbP;
char *recordP;
MemHandle recordH;
LocalID dbIDP;
UInt16 MaxPosition=0, i, lng;
Boolean FoundIt=false;
// Recherche de la table de l'application launcher
dbIDP= DmFindDatabase (0,"psysLaunchDB");
if (!dbIDP) return false;
dbP = DmOpenDatabase (0, dbIDP, dmModeReadWrite);
if (!dbP) return false;
MaxPosition = DmNumRecords (dbP);
for (i=0;i<MaxPosition && !FoundIt ;i++)
{
recordH = DmGetRecord (dbP, i);
if (recordH != NULL)
{
recordP = MemHandleLock (recordH);
// recordP+18 = Nom de l'application
if (recordP!=NULL && (!StrCompare (recordP+18, AppName)))
{
// recordP[102] = Statut visible de l'application
lng = recordP[102];
FoundIt = true;
if (Visible)
{
if (lng==4 ||lng==0) DmWrite(recordP, 102, "\4", 1);
}
else
{
if (lng==4 ||lng==0) DmWrite(recordP, 102, "\0", 1);
}
}
MemPtrUnlock (recordP);
DmReleaseRecord (dbP, i, false);
}
}
DmCloseDatabase (dbP);
return FoundIt;
}