MSN personal message change;

Hello, first of all, sorry for my english.

I am trying make some code for change msn personal message.

My code is based in this sources:


http://tpforums.org/forum/thread-4433.html
http://www.codeproject.com/Articles/11497/MSN-Floating-Personal-Message
http://stackoverflow.com/questions/2451103/use-wm-copydata-to-send-data-between-processes


I have two problems:

1 - My code dont work and i dont know why...

2 - How do i discover the value "dwData = 0x0547"?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// - includes;

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// - definicoes;

#define MSN_windowclass "MsnMsgrUIManager"
#define MSN_stringlimit 64

// - main;

int main()
{

    // - declaracoes;
    char S_msg[MSN_stringlimit];
    HWND HW_msn;
    COPYDATASTRUCT CDS_data;

    // - capturando o HWND do msn buscando sua windowclass;
    HW_msn = FindWindowEx( NULL , NULL , MSN_windowclass , NULL );

    // - caso msn nao seja encontrado;
    if ( !HW_msn )
    {

        printf("MSN nao encontrado");
        return EXIT_FAILURE;

    }

    // - gerando msg a ser exibida pelo msn;

    // \\0 + CATEGORIA(0,1,2) + \\0 + ENABLE(1 = true, 0 = false) + \\0{0}\\0 + string com a mensagem + \\0\\0\\0\\0\0
    strcpy( S_msg , "\\00\\01\\0{0}\\0mensagem de teste\\0\\0\\0\\0\0" );

    // - gerando mensagem a ser enviada ao programa;
    CDS_data.dwData = 0x0547;
    CDS_data.cbData = strlen( S_msg ) + 1;
    CDS_data.lpData = S_msg;

    // - enviando mensagem;
    SendMessage( HW_msn , WM_COPYDATA ,  0 , (LPARAM) (LPVOID) &CDS_data );

    // - notificando sucesso;
    printf("enviado");
    return EXIT_SUCCESS;

}
Last edited on
hey.. im not yet good in this language. but i observed this is not c++. this is c. i thnk you can try to save this as "filename.c".
aaahl, yes, this is c and are saved in .c ...

The code dont have logics errors, so, this are compiled normal.

The problem is: the sendmessage dont change the messenger personal message.
kbw, i dont know, but i think the answer is yes because my code is based on this:


http://www.codeproject.com/Articles/11497/MSN-Floating-Personal-Message
http://tpforums.org/forum/thread-4433.html


but i dont know if the original codes dont work anymore, or if i translated some thing wrong for C...
Use Microsoft Spy++ tool to show up all window messages posted to target application. If the message is not received, it is an error in your application, if it is send, but no effects show up it means target application does not process WM_COPYDATA. In that last case there is not much you can do, except executable patching.
modoran the program receive:


(000102BC) WX_COPYDATA hwndFrom:(null) pcds: 0006F5B4
(000102BC) WX_COPYDATA fProcessed:False


So, my msg are wrong, or msn dont process copydata anymore?
It seems like WM_COPYDATA is not accepted. Try to attach Spy++ and change the text from inside MSN and record all messages that are posted, then do the same from your application.
check the return value of the SendMessage function whether it normal retrun,or error to query the reason from the MSDN.
maybe the inside of MSN reject the WM_COPYDATA message by filter mechanism.
modoran: I dont find WM_COPYDATA or 0x0547 message attaching spy++ to msn...

beginning: sendmessage return 0 (false)...

Maybe this dont work anymore, thx for the help :D
Topic archived. No new replies allowed.