nn::applet::CTR::IsActive Function
bool IsActive(
void
);
None.
true in the active state and false otherwise. Determines whether an Applet is currently running.
An Applet is considered to be active when it is running; it is considered to be inactive when it has been interrupted by a call to a library applet or when control has moved to the HOME Menu.
Consequently, the return value is true when called from an application, as the application must be active to be able to call this function in the first place.
However, this function can also be called by various callbacks such as the sleep query callback, in which case the application will not be active. You can even use this function within that callback to determine whether an application is currently running.
Example
// Sleep query callback
AppletQueryReply mySleepQueryCallback(uptr arg)
{
if ( applet::IsActive() )
{
return applet::REPLY_LATER;
}
return applet::REPLY_ACCEPT;
}
In the example above, the function returns REPLY_LATER handle processing in the main routine when a sleep query arrives with the application active. If the application is not active and is waiting for control to return from another applet, the function returns REPLY_ACCEPT since the application is ready for sleep mode at anytime.
CONFIDENTIAL