#include <cafe/procui.h>

ProcUIStatus ProcUISubProcessMessages(BOOL block);


block If TRUE, blocks when in the background.

If FALSE (not recommended), can return PROCUI_STATUS_BACKGROUND when in the background.

Return Values

PROCUI_STATUS_FOREGROUND The process is currently in the foreground.
PROCUI_STATUS_BACKGROUND The process is currently in the background. This can only be returned if block is set to FALSE (not recommended).
PROCUI_STATUS_RELEASING The process needs to release the foreground. Threads that encounter this message should stop doing work and sleep while calling ProcUISubProcessMessages.
PROCUI_STATUS_EXIT The process needs to exit.


Allows multiple threads to handle system messages. This function may be used by sub-loops that handle graphics commands.

ProcUIProcessMessages does not wait for ProcUISubProcessMessages loops to idle. The operations performed in a ProcUISubProcessMessages loop must be valid in the background.
When ProcUIProcessMessages returns PROCUI_STATUS_RELEASING, you need to call ProcUIDrawDoneRelease before calling ProcUIProcessMessages again. If ProcUIProcessMessages is called again before ProcUIDrawDoneRelease, PROCUI_STATUS_FOREGROUND will be returned.

Do Not Call From

Multiple threads This function is not thread-safe.

See Also


Revision History

2013/05/08 Automated cleanup pass.
2012/09/19 Initial version.