Click here to Skip to main content
15,892,768 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Secondary Desktop Pin
trioum20-Feb-10 21:44
trioum20-Feb-10 21:44 
AnswerRe: Secondary Desktop Pin
WoutL20-Feb-10 2:32
WoutL20-Feb-10 2:32 
QuestionRepeat a typedef or include a header with the typedef? Pin
asincero19-Feb-10 13:22
asincero19-Feb-10 13:22 
AnswerRe: Repeat a typedef or include a header with the typedef? Pin
«_Superman_»19-Feb-10 15:35
professional«_Superman_»19-Feb-10 15:35 
AnswerRe: Repeat a typedef or include a header with the typedef? Pin
cmk20-Feb-10 12:21
cmk20-Feb-10 12:21 
QuestionKeyBoard Hook Pin
devidmorton19-Feb-10 9:22
devidmorton19-Feb-10 9:22 
AnswerRe: KeyBoard Hook [modified] Pin
Abhi Lahare19-Feb-10 10:05
Abhi Lahare19-Feb-10 10:05 
GeneralRe: KeyBoard Hook [modified] Pin
devidmorton20-Feb-10 8:31
devidmorton20-Feb-10 8:31 
SIR thanks for responce.
What i do in DllMain?
#include "stdafx.h"
#include "keydll3.h"

#pragma data_seg(".HOOKDATA")//Shared data among all instances.
HHOOK hook = NULL;
HWND hwnd = NULL;
#pragma data_seg()

#pragma comment(linker, "/SECTION:.HOOKDATA,RWS")//linker directive

HINSTANCE hinstance = NULL;

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
			break;
    }

	hinstance = (HINSTANCE)hModule;
	hook = NULL;

    return TRUE;
}


KEYDLL3_API void installhook(HWND h)
{
	hook = NULL;
	hwnd = h;
	hook = SetWindowsHookEx(WH_KEYBOARD,hookproc,hinstance,NULL);
	if(hook==NULL)
		MessageBox(NULL,"Unable to install hook","Error!",MB_OK);
}

KEYDLL3_API void removehook()
{
	UnhookWindowsHookEx(hook);
}

KEYDLL3_API LRESULT CALLBACK hookproc(int ncode,WPARAM wparam,LPARAM lparam)
{
	if(ncode>=0)
	{
		if((lparam & 0x80000000) == 0x00000000)//Check whether key was pressed(not released).
		{
			hwnd = FindWindow("#32770","Keylogger Exe");//Find application window handle
			PostMessage(hwnd,WM_USER+755,wparam,lparam);//Send info to app Window.
		}
	}
	return ( CallNextHookEx(hook,ncode,wparam,lparam) );//pass control to next hook in the hook chain.
}

or give me some other dll web address.
Please help me....
modified on Saturday, February 20, 2010 2:49 PM

GeneralRe: KeyBoard Hook Pin
Abhi Lahare22-Feb-10 5:13
Abhi Lahare22-Feb-10 5:13 
QuestionFast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Kiran Satish19-Feb-10 9:05
Kiran Satish19-Feb-10 9:05 
AnswerRe: Fast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Chris Losinger19-Feb-10 12:09
professionalChris Losinger19-Feb-10 12:09 
AnswerRe: Fast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Jonathan Davies20-Feb-10 1:17
Jonathan Davies20-Feb-10 1:17 
GeneralRe: Fast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Stephen Hewitt20-Feb-10 3:33
Stephen Hewitt20-Feb-10 3:33 
GeneralRe: Fast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Kiran Satish20-Feb-10 11:05
Kiran Satish20-Feb-10 11:05 
GeneralRe: Fast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Jonathan Davies20-Feb-10 11:30
Jonathan Davies20-Feb-10 11:30 
QuestionList of installed applications (as shown by "Open With" dialog box of windows.) Pin
Aseem Sharma19-Feb-10 1:10
Aseem Sharma19-Feb-10 1:10 
AnswerRe: List of installed applications (as shown by "Open With" dialog box of windows.) Pin
KingsGambit19-Feb-10 2:10
KingsGambit19-Feb-10 2:10 
AnswerRe: List of installed applications (as shown by "Open With" dialog box of windows.) Pin
fat_boy19-Feb-10 2:40
fat_boy19-Feb-10 2:40 
AnswerRe: List of installed applications (as shown by "Open With" dialog box of windows.) Pin
David Crow19-Feb-10 4:00
David Crow19-Feb-10 4:00 
QuestionConfusion Pin
john563218-Feb-10 23:41
john563218-Feb-10 23:41 
AnswerRe: Confusion Pin
Rajesh R Subramanian18-Feb-10 23:45
professionalRajesh R Subramanian18-Feb-10 23:45 
GeneralRe: Confusion Pin
john563218-Feb-10 23:56
john563218-Feb-10 23:56 
GeneralRe: Confusion Pin
Maximilien19-Feb-10 0:32
Maximilien19-Feb-10 0:32 
GeneralRe: Confusion Pin
Richard MacCutchan19-Feb-10 3:41
mveRichard MacCutchan19-Feb-10 3:41 
AnswerRe: Confusion Pin
KingsGambit19-Feb-10 2:21
KingsGambit19-Feb-10 2:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.