[haiku-3rdparty-dev] BMessage target for replicant on desktop

  • From: Mauro de Wit <maurodewit@xxxxxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Fri, 13 Nov 2009 12:47:44 +0000

Hi all,

I want to send my desktop replicant a BMessage, but I can't find the shelf.
The docs are not clean on this and I have looked in the Haiku source
code to make sure I am right about the instance hierarchy.

In (my) theory, the following code should target the Shelf:

BMessage request(B_GET_PROPERTY);
BMessage reply;
        
request.AddSpecifier("Shelf");
request.AddSpecifier("View", "desktop"); //Name from DesktopWindow.cpp
request.AddSpecifier("Window", "Desktop");  //Name from DesktopWindow.cpp
BMessenger to("application/x-vnd.Be-TRAK", -1);
status_t s = to.SendMessage(&request, &reply);

Gives me the error:
message[0] = string("Cannot find view at/with specified index/name.", 47 bytes)
message[1] = string("Index not in range for the data set", 36 bytes)


Replacing the view name for an index like this: AddSpecifier("View",
1) gets me further, but still an error:

message[0] = string("This window doesn't have a shelf", 33 bytes)
message[1] = string("Name not found", 15 bytes)
error = int32(0x80000007 or -2147483641)

What am I doing wrong here? Am I forgetting a specifier?
Greetings
Mauro

Other related posts: