×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    33

    how to send message to ui?

    hello!
    every one! can you help to send a message to application ui,and in application's member function HandleCommandL( TInt aCommandL ) will catch
    the message you send.
    IDE: carbide.c++ express
    SDK:3rd
    thanks!

  2. #2
    Registered User
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747

    Re: how to send message to ui?

    Quote Originally Posted by chenqing
    hello!
    every one! can you help to send a message to application ui,and in application's member function HandleCommandL( TInt aCommandL ) will catch
    the message you send.
    IDE: carbide.c++ express
    SDK:3rd
    thanks!
    Who will send the message here? Other APP/EXE? If then you can use P&S for that. BTW your question is not clear.

  3. #3
    Regular Contributor
    Join Date
    May 2005
    Location
    Brasov, Romania
    Posts
    431

    Re: how to send message to ui?

    To catch it in HandleCommandL
    Code:
    iViewName->HandleCommandL(idOfTheCommand); //for a specific view
    //make sure the view is available and active
    
    appUi->HandleCommandL(idOfTheCommand); //for appUi
    //get appUI via:
    CYourAppUi* appUi = ((CYourAppUi*)(CEikonEnv::Static()->EikAppUi()));
    To catch it in HandleApplicationSpecificEventL
    Code:
    //get the window group ID:
    TInt windowGroupId = CEikonEnv::Static()->RootWin().Identifier()
    -use this function to send event:
    Code:
    void SendWindowEvent(TInt aEvent, TInt windowGroupID)
    {
    	TWsEvent wsEvent;
    	RWsSession wsSession;
    
    	ASSERT(windowGroupID != -1);
    
    	if ( wsSession.Connect() == KErrNone )
    	{
    		wsEvent.SetType(aEvent);
    		wsSession.SendEventToWindowGroup(windowGroupID, wsEvent);
    
    		wsSession.Close();
    	}
    	else
    	{
    		ASSERT(false);
    	};
    };
    Catch it in your appUI:
    -implement
    Code:
    void HandleApplicationSpecificEventL(TInt aType, const TWsEvent& aEvent);
    Make the call like below:
    Code:
    TWsEvent event;
    event.SetType(EIllegalUse);
    wsSession.SendEventToWindowGroup(CEikonEnv::Static()->RootWin().Identifier(), event);

  4. #4
    Registered User
    Join Date
    Aug 2006
    Posts
    33

    Re: how to send message to ui?

    Thanks!
    I solved it with the help of you.
    I solved it like this,just like what you said.
    first: get applictaion ui
    second: call applciation ui HandleCommandL(TInt aCommand ) method.

    but,I can't understand the last way you mentioned, my app ui can't catch the message from SendEventToWindowGroup(windowGroupID, wsEvent) send.

  5. #5
    Regular Contributor
    Join Date
    May 2005
    Location
    Brasov, Romania
    Posts
    431

    Re: how to send message to ui?

    Quote Originally Posted by chenqing
    but,I can't understand the last way you mentioned, my app ui can't catch the message from SendEventToWindowGroup(windowGroupID, wsEvent) send.
    Usually HandleCommandL is used for executing actions triggered from menu items, but not necessarily.

    The last way I mentioned it's just another way to communicate something to your appUi. You send an event to the entire window group and your appUi can catch it.

    The same method can be used to send a message to another application -> if you know the id of the respective window group.

Similar Threads

  1. about wma, app exit when send message
    By badgunnokia in forum Mobile Java General
    Replies: 1
    Last Post: 2006-02-14, 02:37
  2. Replies: 1
    Last Post: 2003-10-03, 08:35
  3. Render FAX message and send it
    By jorge_c in forum Symbian
    Replies: 0
    Last Post: 2003-05-19, 11:32
  4. Send message to othet phone with 7650
    By ilnokia7650 in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-11-05, 12:36
  5. Send message in the Nokia 7650 device
    By varshajohn in forum Symbian User Interface
    Replies: 1
    Last Post: 2002-10-28, 03:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×