View Single Post
Posts: 317 | Thanked: 787 times | Joined on Oct 2009 @ Krakow, Poland
#2
Using D-Bus is the answer:

Code:
#include <dbus/dbus.h>

void invokeTaskManager() {
        DBusConnection* bus = NULL;
        DBusMessage* msg = NULL;
        DBusError error;

        dbus_error_init(&error);

        bus = dbus_bus_get(DBUS_BUS_SESSION, &error);

        if (bus == NULL) {
                fprintf(stderr, "bus == NULL\n");
                return;
        }

        // create a signal and check for errors
        msg = dbus_message_new_signal("/com/nokia/hildon_desktop", // path
                        "com.nokia.hildon_desktop", // interface
                        "exit_app_view"); // method str
        if (NULL == msg) {
                fprintf(stderr, "Message Null\n");
                exit(1);
        }

        // send the message and flush the connection
        if (!dbus_connection_send(bus, msg, NULL)) {
                fprintf(stderr, "Out Of Memory!\n");
                exit(1);
        }

        dbus_connection_flush(bus);
        dbus_message_unref(msg);
}
 

The Following User Says Thank You to dwaradzyn For This Useful Post: