All pastes #335141 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-01 03:49 UTC
rendered paste body
/*	main.cpp
 */////////////////////////////////////////////////////////
#include <windows.h>
#include "resource1.h"
#include "base.h"

bool ImplementHooks();

HWND hWnd;
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);

// Entrypoint
/////////////////////////////////////////////////////////////////
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)
{
	//Lets see what's going on .. ;o
	switch (dwReason)
	{
	case DLL_PROCESS_ATTACH:
		{	//We've been loaded by the process
			/////////////////////////////////////////////////////

			//Set our hooks in place
			if (!ImplementHooks())
				return FALSE;

			//Open Dialog
			DialogBox(hInstance, MAKEINTRESOURCE(IDD_ITM), hWnd, reinterpret_cast<DLGPROC>(DlgProc));
		}
		break;
	}

	return TRUE;
}

LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
	switch(Msg)
	{
	case WM_INITDIALOG:
		{
			return TRUE;
		}

	case WM_COMMAND:
		switch(wParam)
		{
		case IDOK:
			EndDialog(hWndDlg, 0);
			return TRUE;
		}
		break;
	}

	return FALSE;
}