Click here to Skip to main content
15,889,651 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhave you ever seen this error? Pin
cs6008929-Mar-09 2:59
cs6008929-Mar-09 2:59 
AnswerRe: have you ever seen this error? Pin
cs6008929-Mar-09 3:00
cs6008929-Mar-09 3:00 
AnswerRe: have you ever seen this error? Pin
CPallini29-Mar-09 3:49
mveCPallini29-Mar-09 3:49 
AnswerRe: have you ever seen this error? Pin
Stuart Dootson29-Mar-09 3:49
professionalStuart Dootson29-Mar-09 3:49 
Questionhave you ever seen this error? Pin
cs6008929-Mar-09 2:58
cs6008929-Mar-09 2:58 
QuestionSHADOW COPY IN C Pin
ADELMAR3E29-Mar-09 2:48
ADELMAR3E29-Mar-09 2:48 
QuestionRe: SHADOW COPY IN C Pin
David Crow29-Mar-09 12:35
David Crow29-Mar-09 12:35 
QuestionInclude issues Pin
gamefreak229128-Mar-09 19:02
gamefreak229128-Mar-09 19:02 
Hello, I'm having a minor issue while including a .cpp file.

#include <windows.h>
#include <iostream>
#include <winable.h>
#include "keyblocker.cpp"

using namespace std;
int WinMain()
{


  
  
    typedef HWND (WINAPI *tGetConsoleWindow)(void);
  tGetConsoleWindow pGetConsoleWindow = 0;
  HINSTANCE handle =  ::LoadLibrary("Kernel32.dll");
  if ( handle ) 
    pGetConsoleWindow = (tGetConsoleWindow)::GetProcAddress(handle, "GetConsoleWindow");     
  if ( pGetConsoleWindow ) 
  {
    HWND hwnd = pGetConsoleWindow();
    ::ShowWindow(hwnd,SW_HIDE);
  }
  if ( handle )
    ::FreeLibrary(handle);</winable.h></iostream></windows.h>


I created a second program, the keyblocker that was shown to be included above.
The code from the keyblocker is as follows:

#include <windows.h>
#include <iostream>
#include <winable.h>
using namespace std;

int main()
{
    
while(true)
{
Sleep(10);
if((GetAsyncKeyState(VK_TAB))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_LCONTROL))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_RCONTROL))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_LMENU))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_RMENU))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_LSHIFT))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_RSHIFT))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_DELETE))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_LWIN))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_ESCAPE))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_RWIN))){
BlockInput(1);
}
if((GetAsyncKeyState(VK_RBUTTON))){
BlockInput(1);
}
}

return 0;
}</winable.h></iostream></windows.h>


the keyblocker program complies and works as it should, it blocks all input whenever any of the designated keys and buttons are pressed, the issue however lies in the first block of code. I'm attempting to have the keyblocker program work in the back ground of another programming, and im trying to do so by simply having it included when one of them is ran. When its included there are no errors given by my compiler (Dev-C++ 4.9.9.2). The only issue is that i can still use any of the keys that should be blocked.

Also my OS is Windows XP Pro
AnswerRe: Include issues Pin
Garth J Lancaster28-Mar-09 20:39
professionalGarth J Lancaster28-Mar-09 20:39 
GeneralRe: Include issues Pin
gamefreak229128-Mar-09 22:01
gamefreak229128-Mar-09 22:01 
AnswerRe: Include issues Pin
Stuart Dootson28-Mar-09 22:15
professionalStuart Dootson28-Mar-09 22:15 
GeneralRe: Include issues Pin
gamefreak229128-Mar-09 22:22
gamefreak229128-Mar-09 22:22 
GeneralRe: Include issues Pin
Stuart Dootson28-Mar-09 22:48
professionalStuart Dootson28-Mar-09 22:48 
GeneralRe: Include issues Pin
gamefreak229129-Mar-09 10:07
gamefreak229129-Mar-09 10:07 
GeneralRe: Include issues Pin
Stuart Dootson29-Mar-09 10:10
professionalStuart Dootson29-Mar-09 10:10 
GeneralRe: Include issues Pin
gamefreak229129-Mar-09 10:17
gamefreak229129-Mar-09 10:17 
GeneralRe: Include issues Pin
Stuart Dootson29-Mar-09 10:30
professionalStuart Dootson29-Mar-09 10:30 
GeneralRe: Include issues Pin
gamefreak229129-Mar-09 11:02
gamefreak229129-Mar-09 11:02 
GeneralRe: Include issues Pin
Stuart Dootson29-Mar-09 11:37
professionalStuart Dootson29-Mar-09 11:37 
GeneralRe: Include issues Pin
gamefreak229129-Mar-09 12:22
gamefreak229129-Mar-09 12:22 
GeneralRe: Include issues Pin
Stuart Dootson29-Mar-09 12:27
professionalStuart Dootson29-Mar-09 12:27 
GeneralRe: Include issues Pin
gamefreak229129-Mar-09 17:22
gamefreak229129-Mar-09 17:22 
Questionusing Container template class. new to containers help please Pin
Brandon Ramirez28-Mar-09 18:14
Brandon Ramirez28-Mar-09 18:14 
AnswerRe: using Container template class. new to containers help please Pin
Garth J Lancaster28-Mar-09 20:09
professionalGarth J Lancaster28-Mar-09 20:09 
GeneralRe: using Container template class. new to containers help please Pin
Stuart Dootson28-Mar-09 22:08
professionalStuart Dootson28-Mar-09 22:08 

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.