47 lines
2.1 KiB
C
47 lines
2.1 KiB
C
// stdafx.h : include file for standard system include files,
|
|
// or project specific include files that are used frequently,
|
|
// but are changed infrequently
|
|
#pragma once
|
|
|
|
// Compiler Error Messages that we want to disable:
|
|
#pragma warning ( disable : 4793 ) // Compiling functions as native code
|
|
#pragma warning ( disable : 4996 ) // 'strncpy': This function or variable may be unsafe
|
|
|
|
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
|
|
|
#include <windows.h>
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
//********************************************************************
|
|
// Global Enums
|
|
//********************************************************************
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// Logging Detail Settings
|
|
typedef enum _LoggingDetail{LOGGING_NONE,LOGGING_LOW,LOGGING_MEDIUM,LOGGING_HIGH,LOGGING_DEBUG} LoggingDetail;
|
|
|
|
// Enable Logging and if so, which detail (default = none)
|
|
static LoggingDetail g_LoggingDetail = LOGGING_NONE;
|
|
static wchar_t g_LogPath[MAX_PATH + 1] = {0};
|
|
static const wchar_t g_LOG_FILE_NAME[] = L"ButtonHook.log"; // Log File for now is just hardcoded
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
//********************************************************************
|
|
// Global Functions
|
|
//********************************************************************
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// Logs to Ooganizer.log in temporary folder if no log path is set
|
|
// %USERPROFILE%\AppData\Local\Temp\Ooganizer.log
|
|
//void log(LoggingDetail detail, char * pFmt, ... );
|
|
void log( LoggingDetail detail, HWND hWnd, wchar_t* str); // Logs Window Text
|
|
void log( LoggingDetail detail, wchar_t * pFmt, ... );
|
|
|
|
// At Startup we clear the log
|
|
void clearLog();
|
|
|
|
// Set the global (for this dll instance) Logging Detail Setting
|
|
void SetLoggingDetail(LoggingDetail detail, wchar_t* logPath);
|
|
|
|
// Get Logging Detail for custom debug behavior
|
|
_LoggingDetail GetLoggingDetail(); |