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
|
#include "dll.h"
#include <windows.h>
DWORD WINAPI CreateGUIThread(LPVOID lParam);
INT_PTR CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
HINSTANCE g_h_main_instance;
DllClass::DllClass()
{
}
DllClass::~DllClass ()
{
}
DWORD WINAPI ThreadProc(LPVOID lpParam)
{
DialogBox(g_h_main_instance, MAKEINTRESOURCE(IDD_ABOUT), 0, DialogProc);
}
INT_PTR CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch(uMsg) {
case WM_INITDIALOG: //To initiate the dialog box
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
EndDialog(hwndDlg, IDOK);
break;
case IDCANCEL:
EndDialog(hwndDlg, IDCANCEL);
break;
}
break;
case WM_CLOSE:// end your dialog if you click the X button.
EndDialog(hwndDlg, 0);
break;
}
return 0;
}
BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
DWORD dwThreadID=0;
g_h_main_instance=hInst;
switch (reason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hInst);
CreateThread(NULL,0,ThreadProc,0,0,&dwThreadID);
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;
}
|