Miranda IM

Results 1 to 3 of 3

Thread: API for XStatus messages?

  1. #1
    Join Date
    August 2006
    Posts
    11

    API for XStatus messages?

    Hi! I'm relatively new to coding for Miranda. I was wondering if there is a special API for setting xstatus messages for Miranda protocols.
    What I want to do is write a procedure in nnCron that would change xstatus for icq protocol (as far as I know, other protocols don't support xstatus) according to the track names played in foobar.
    I know that I can change the general status to DND for example by sending the message
    Code:
    SendMessage(hwnd, 273, 171146, 0)
    or the same in nnCron format:
    Code:
    0 171146 273 WIN-HWND SendMessageA DROP
    So, my question is if there is the same way to set an xstatus message from outside Miranda.
    Last edited by Elk; 28 Nov 2012 at 6:50 AM.

  2. #2
    Join Date
    June 2005
    Location
    Germany
    Posts
    2,315
    Hm, I think you may have a wrapper plugin around that, and define your own way for that. Look in m_icq.h
    Code:
    /* Custom Status helper API *
     - to set custom status message & title use PS_ICQ_GETCUSTOMSTATUS to obtain
       DB settings and write values to them (UTF-8 strings best). (obsolete)
     - use PS_ICQ_GETCUSTOMSTATUSEX and PS_ICQ_SETCUSTOMSTATUSEX for controling Custom Status
     - custom messages for each user supported - ME_ICQ_STATUSMSGREQ with type MTYPE_SCRIPT_NOTIFY
     */
    #define CSSF_MASK_STATUS    0x0001  // status member valid for set/get
    #define CSSF_MASK_NAME      0x0002  // pszName member valid for set/get
    #define CSSF_MASK_MESSAGE   0x0004  // pszMessage member valid for set/get
    #define CSSF_DISABLE_MENU   0x0020  // disable default custom status menu, wParam = bEnable
    #define CSSF_DISABLE_UI     0x0040  // disable default custom status UI, wParam = bEnable
    #define CSSF_DEFAULT_NAME   0x0080  // only with CSSF_MASK_NAME and get API to get default custom status name (wParam = status)
    #define CSSF_STATUSES_COUNT 0x0100  // returns number of custom statuses in wParam, only get API
    #define CSSF_STR_SIZES      0x0200  // returns sizes of custom status name & message (wParam & lParam members) in chars
    #define CSSF_UNICODE        0x1000  // strings are in UCS-2
    
    #if defined(_UNICODE)
      #define CSSF_TCHAR  CSSF_UNICODE
    #else
      #define CSSF_TCHAR  0
    #endif
    
    
    typedef struct {
      int cbSize;         // size of the structure
      int flags;          // combination of CSSF_*
      int *status;        // custom status id
      union {
        char *pszName;    // buffer for custom status name
        TCHAR *ptszName;
        WCHAR *pwszName;
      };
      union {
        char *pszMessage; // buffer for custom status message
        TCHAR *ptszMessage;
        WCHAR *pwszMessage;
      };
      WPARAM *wParam;     // extra params, see flags
      LPARAM *lParam;
    } ICQ_CUSTOM_STATUS;
    
    
    // Sets owner current custom status (obsolete)
    //wParam = (int)N   // custom status id (1-32)
    //lParam = 0        
    //return = N (id of status set) or 0 (failed - probably bad params)
    #define PS_ICQ_SETCUSTOMSTATUS "/SetXStatus"
    
    // Sets owner current custom status
    //wParam = 0                          // reserved
    //lParam = (ICQ_CUSTOM_STATUS*)pData  // contains what to set and new values
    //return = 0 (for success)
    #define PS_ICQ_SETCUSTOMSTATUSEX "/SetXStatusEx"
    But there is ListeningTo Plugin for Miranda, that does exactly what you want:
    http://code.google.com/p/merlins-miranda/downloads/list
    Last edited by FREAK_THEMIGHTY; 28 Nov 2012 at 10:44 AM.

  3. #3
    Join Date
    August 2006
    Posts
    11
    Well, thank you. I know there's this and other plugins for this purpose, but I wanted to kind of work directly with the statuses using the API. I guess I just didn't make myself clear.

Similar Threads

  1. [resolved] xStatus
    By exoomer in forum Technical Support
    Replies: 5
    Last Post: 25 Aug 2010, 1:31 PM
  2. mToolTip and my own XStatus
    By MadCatX in forum Technical Support
    Replies: 0
    Last Post: 16 May 2009, 11:59 AM
  3. xStatus problems
    By Radek02 in forum Technical Support
    Replies: 0
    Last Post: 4 Sep 2007, 6:08 PM
  4. XStatus notification
    By nekeda in forum Technical Support
    Replies: 4
    Last Post: 27 Oct 2006, 10:08 AM
  5. xStatus messages
    By Guris in forum Technical Support
    Replies: 0
    Last Post: 8 Jun 2006, 2:49 PM

Bookmarks

Posting Permissions

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