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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
| #include "tv.h"
#include <iostream>
#include <creseau.h>
#include <windows.h>
#include <fstream>
BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
hdll=hInst; // Sauver pour le dialogbox
switch (reason)
{
case DLL_PROCESS_ATTACH:
hdll=hInst; // Sauver pour le dialogbox
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
/* Returns TRUE on success, FALSE on failure */
return TRUE;
}
SAMURIZE_PLUGIN_CHAR init()
{
return "DisplayChannel";
}
SAMURIZE_PLUGIN_CHAR getparam(char* func)
{
if (!strcmp(func,"DisplayChannel"))
return "Chaine à afficher|Nombre de résultats=5|";
else
return "|";
}
SAMURIZE_PLUGIN_INT dlltype()
{
return 1;
}
SAMURIZE_PLUGIN_CHAR getinfo(int infonum)
{
switch(infonum)
{
case 1: return "Programmes TV belges";
case 2: return "Eagleamon";
case 3: return "0.1";
case 4: return "25/08/05";
case 5: return "26/08/05";
case 6: return "http://www.jesaispasencore.be";
case 7: return "eagleamon@swing.be";
}
return "";
}
SAMURIZE_PLUGIN_INT dllstartup(HWND hwnd, int dlltype)
{
/* TODO (#1#): Changer config samurize pour recharger toutes les X
minutes */
//Save the Samurize Handle
hSamurize = hwnd;
char buf[30];
itoa((int)hdll,buf,10);
MessageBox(0,buf,"Alors?",MB_OK);
return 0;
}
SAMURIZE_PLUGIN_INT dllshutdown(int id)
{
return 0;
}
SAMURIZE_PLUGIN_INT configure()
{
char buf[30];
if (LoadString(hdll,1,buf,30))
MessageBox(hSamurize,buf,"Essai",MB_OK);
else
GetError("LoadString");
if (DialogBox(hdll, "DIALOG1" , hSamurize, (DLGPROC)Dialog1Proc)==-1)
GetError("DialogBox");
return 0;
}
BOOL APIENTRY Dialog1Proc(HWND hDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDCANCEL || LOWORD(wParam) == IDOK)
{
EndDialog(hDlg,0);
return TRUE;
}
default:
return FALSE;
}
} |
Partager