Recently I have been looking into creating new Control Panel applets in C.
I got this link from Msdn: Msdn Shell Stuff which seemed very helpful and tried to use their sample code. This however did not work...
I simplified their code to this, which still has a problem:
The problem is that when called from the Control Panel as it supposed to be, Explorer crashes. hmmm. Don't know why?Code:
BOOL WINAPI CALLBACK __declspec(dllexport) CPlApplet(HWND hwnd,UINT Msg,LONG lParam1,LONG lParam2)
CPLINFO * cp;
//no memory to set, so do nothing...
return 1; //only one subprogram...
cp = (CPLINFO*)lParam2;
cp->idIcon = IDMAINICON;
cp->idName = IDNAME;
cp->idInfo = IDDESCR;
cp->lData = 0;
MessageBox(hwnd,"The message was correctly processed?","status",0);
Using Messageboxes, saw that CPL_INIT was called, and that the crash was just after. There were no error logs, and I don't know how to track this down further.
The dll file generated had CPlApplet as entry-point, as I think it was supposed to...
Thanks for your time and trouble.