Shoutbox

pParam ... - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: pParam ... (/showthread.php?tid=30591)

pParam ... by Orkblutt on 08-28-2004 at 02:25 AM

Hi Patchou,

I'm trying to code a little plugin in C++ ...
I want to use the struc PLUGIN_PARAM in the ParseCommand function.

pParam is give in input parameter... but isn't it initialised ?

thanks


RE: pParam ... by Mnjul on 08-28-2004 at 04:01 AM

In ParseCommand, pParam is probably used for retrieving a conversation window (iConversationWnd). Is that what you need? ;) Also, iConversationWnd may sometimes be a null pointer if Plus! can't pass it, for example, a Windows Messenger conversation window when WM is opened after MSNMsgr.


RE: pParam ... by Orkblutt on 08-28-2004 at 04:20 AM

:( No... thanks for your anwser but I'm needing sContactName ...
It's not really important cause I can do what I want to do with another way... But why sContactName isn't initialised ? :|


RE: pParam ... by Mnjul on 08-28-2004 at 04:34 AM

sContactName is only used for ReceiveNotify. If you want to know who the user is talking to in the conversation window, you need to use iConversastionWnd :)


RE: pParam ... by Orkblutt on 08-28-2004 at 05:01 AM

Ok ok :)
thanks
(6)

just an other question? how to distrib a plugin ?
Any public FTP where I can put it ?


RE: pParam ... by Mnjul on 08-28-2004 at 05:39 AM

You can announce your plugin here just in the Plug-Ins forum, and/or go to here: Official Plugin Database


RE: pParam ... by Yousef on 08-28-2004 at 09:13 AM

anyone knows how patchou gets the iConversastionWnd without using the api? cause that's exactly what I need 2 know...


RE: pParam ... by RaceProUK on 08-28-2004 at 01:36 PM

I think he searches the memory for it or something. I remember on IRC being told Patch gets the IMessenger3 pointer by searching the memory using ASM written by wtbw.


RE: pParam ... by Orkblutt on 08-29-2004 at 06:20 AM

You have the best avatar picture I've never seen !!!! :o)

Any good (clear) tutorial on Messenger API ?


RE: pParam ... by RaceProUK on 08-29-2004 at 10:21 AM

Take a look at this attachment.


RE: pParam ... by Orkblutt on 08-30-2004 at 01:58 AM

Oki!
Thank you!


I want to display a dialog box :^)

I'm proceding like that... but it's not the good method :(
quote:

LRESULT CALLBACK MyDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
   switch (message)
   {
        case WM_INITDIALOG:
           return TRUE;
        case WM_COMMAND:
            if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
            {
                EndDialog(hDlg, LOWORD(wParam));
                return TRUE;
            }
         break;
    }
    return FALSE;
}
....
....
....
...
if(stricmp(sCommand, "/xdialog") == 0)
{       
   HWND hWnd=GetActiveWindow();
   HINSTANCE hInst = (HINSTANCE)GetModuleHandle(NULL);         
   DialogBox(hInst , (LPCTSTR)IDD_DIALOG1, hWnd, (DLGPROC)MyDlg);
   return TRUE;
}




Could you help me please ?


       

RE: pParam ... by RaceProUK on 08-30-2004 at 01:58 PM

Change DialogBox(hInst , (LPCTSTR)IDD_DIALOG1, hWnd, (DLGPROC)MyDlg);
to DialogBox(hInst , MAKEINTRESOURCE(IDD_DIALOG1), hWnd, (DLGPROC)MyDlg);

This works with VC++: not sure about others though. Also, make sure that you include the 'resource.h' file in all cpp files that deal with the dialog.


RE: pParam ... by Orkblutt on 08-31-2004 at 12:57 AM

Hi,

thanks for your answer...

but it's the same thing... when i'm trying /xdialog, that's doing nothing at all :S


RE: pParam ... by RaceProUK on 08-31-2004 at 09:21 AM

You clould also try using strcmp() instead of stricmp().

Basically, just try all sorts.


RE: pParam ... by Orkblutt on 08-31-2004 at 10:09 AM

yes yes :)
but the problem isn't here...

the DialogBox fails... but don't know why :s


RE: pParam ... by RaceProUK on 08-31-2004 at 10:58 AM

You may want to check the return value of DialogBox, and you may also like to look at GetLastError().


RE: pParam ... by Orkblutt on 08-31-2004 at 03:18 PM

DialogBox is failed and return -1
GetLastError give the error number 1813
1813 The specified resource type cannot be found in the image file.  ERROR_RESOURCE_TYPE_NOT_FOUND.

I've created my dialog with the Visual Studio editor. Just a basic window without new control.
The wizard have created and insered resource.h automaticaly in the project.
In MPPluginC.h, I have add  #include "resource.h"

my .rc file:

quote:
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_DIALOG1 DIALOGEX 0, 0, 206, 134
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
    WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,149,7,50,14
    PUSHBUTTON      "Annuler",IDCANCEL,149,24,50,14
END




I'm not undrstanding why this error? :s
RE: pParam ... by RaceProUK on 08-31-2004 at 09:50 PM

quote:
Originally posted by Orkblutt
GetLastError give the error number 1813
When I tried getting DialogBox to work, I kept getting that. Never did find out why though.
RE: pParam ... by Orkblutt on 09-01-2004 at 12:34 AM

hummm :(

All people here is coding in VB ? No one in C++ ?

Patchou!! please!! help me :D


RE: pParam ... by RaceProUK on 09-01-2004 at 09:23 AM

Maybe TB could shed some light on this, as I've had this problem too.
Although I got round it by using VB :undecided:


RE: pParam ... by Orkblutt on 09-01-2004 at 07:15 PM

no. I can't do that I want to do with VB... (and I'm hating VB too...lol)

quote:
Maybe TB could shed some light on this

Who's TB ? any mail to join him directly ?
RE: pParam ... by RaceProUK on 09-01-2004 at 09:48 PM

TB = TheBlashphemer.
And he probably won't react well to a PM tbh.


RE: pParam ... by Orkblutt on 09-01-2004 at 10:04 PM

quote:
And he probably won't react well to a PM tbh.
:|
what would you mean ?