|
// /////////////////////////////////////////////////////////////
// File: UtilityMethods.cpp Class: none
// Date: 2/25/2004 Author: Michael Kennedy
// Language: C++ Framework: Win32
//
// Copyright: Copyright (c) Michael Kennedy, 2004-2005
// /////////////////////////////////////////////////////////////
// License: See License.txt file included with application.
// Description: See compiled documentation (Managed Hooks.chm)
// /////////////////////////////////////////////////////////////
#include "stdafx.h"
#include <windows.h>
#include "SystemHookCore.h"
bool GetMousePosition(WPARAM wparam, LPARAM lparam, int & x, int & y)
{
MOUSEHOOKSTRUCT * pMouseStruct = (MOUSEHOOKSTRUCT *)lparam;
if (pMouseStruct == NULL)
{
return false;
}
x = pMouseStruct->pt.x;
y = pMouseStruct->pt.y;
return true;
}
bool GetKeyboardReading(WPARAM wparam, LPARAM lparam, int & vkCode)
{
KBDLLHOOKSTRUCT * pKeyboardStruct = (KBDLLHOOKSTRUCT *)lparam;
if (pKeyboardStruct == NULL)
{
return false;
}
vkCode = pKeyboardStruct->vkCode;
return true;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Michael Kennedy is a founding partner and software engineer at United Binary, LLC (
http://www.unitedbinary.com [^]) and he is active in the agile software development community. Michael has been developing software for over 10 years. The last 4 of those years have been solidly focused on .NET development. For more information, please visit his website
http://www.michaelckennedy.net [^]
In a previous life, Michael was pursuing a fairly successful career in mathematics before he saw the True Light and chose The Way of Programming.