![]() |
| | #1 |
| Registered User Join Date: Mar 2008
Posts: 26
| My programs runs ar background and if any application on the windows xp system is executed (Microsoft Word, IE, calculator and etc) it should log and it's executable file's path. I've found this article : http://www.codeproject.com/KB/system...protector.aspx But it's to complicated and has stuff that I don't need. I'll appreciate any help. |
| markiz is offline | |
| | #2 |
| Registered User Join Date: Mar 2003
Posts: 3,844
| WMI is another way to monitor this: C++: http://msdn2.microsoft.com/en-us/lib...25(vs.85).aspx VBScript: http://msdn2.microsoft.com/en-us/lib...11(VS.85).aspx gg |
| Codeplug is online now | |
| | #3 |
| Registered User Join Date: Mar 2008
Posts: 26
| Thanks, But I have problems compiling the code from the example, though I didn't change anything. (Environment: Visual studio 2005, Visual C++ win32 console application) |
| markiz is offline | |
| | #4 |
| Registered User Join Date: Mar 2003
Posts: 3,844
| You'll have to be more specific if you want help your compiling problems. gg |
| Codeplug is online now | |
| | #5 |
| Registered User Join Date: Mar 2008
Posts: 26
| At first it complained about "stdafx.h" , so I included it. Now it complains about: Error 1 error C2065: 'HRESULT' : undeclared identifier strange, cause example should have all includes, shouldn't it? |
| markiz is offline | |
| | #6 | |
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,099
| #include <windows.h>?
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| |
| Elysia is offline | |
| | #7 |
| Registered User Join Date: Mar 2008
Posts: 26
| |
| markiz is offline | |
| | #8 |
| Registered User Join Date: Mar 2008
Posts: 26
| Maybe I should Create another type of project? |
| markiz is offline | |
| | #9 | |
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,099
| No. Just missing headers. Well, it's not full source code, is it? Anyway. #include <objbase.h>?
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| |
| Elysia is offline | |
| | #10 |
| Registered User Join Date: Mar 2008
Posts: 26
| |
| markiz is offline | |
| | #11 | |
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,099
| Yes, I see it's a fat example now, but Microsoft didn't include the right headers in the code. Bah. Stupid Microsoft. What other errors? HRESULT you can get from Windows.h and COM stuff from objbase.h.
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| |
| Elysia is offline | |
| | #12 |
| Registered User Join Date: Mar 2008
Posts: 26
| I still get COINIT_MULTITHREADED error! Though I've included: #include <windows.h> #include <objbase.h> Maybe, if it's not to hard, you can compile it yourself? other errors: Error 1 error C2065: 'COINIT_MULTITHREADED' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 12 Error 2 error C3861: 'CoInitializeEx': identifier not found d:\1\eventsink\eventsink\event.cpp 12 Error 3 error C2065: 'cout' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 15 Error 4 error C2065: 'hex' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 16 Error 5 error C2065: 'endl' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 16 Error 6 error C2065: 'EOAC_NONE' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 35 Error 7 error C3861: 'CoInitializeSecurity': identifier not found d:\1\eventsink\eventsink\event.cpp 27 Error 8 error C2065: 'IWbemLocator' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 51 Error 9 error C2065: 'pLoc' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 51 Error 10 error C2065: 'CLSID_WbemLocator' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 54 Error 11 error C2065: 'IID_IWbemLocator' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 57 Error 12 error C2065: 'IWbemServices' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 71 Error 13 error C2065: 'pSvc' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 71 Error 14 error C2227: left of '->ConnectServer' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 75 Error 15 error C3861: '_bstr_t': identifier not found d:\1\eventsink\eventsink\event.cpp 76 Error 16 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 90 Error 17 error C3861: 'CoSetProxyBlanket': identifier not found d:\1\eventsink\eventsink\event.cpp 101 Error 18 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 116 Error 19 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 117 Error 20 error C2065: 'IUnsecuredApartment' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 126 Error 21 error C2065: 'pUnsecApp' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 126 Error 22 error C2065: 'CLSID_UnsecuredApartment' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 128 Error 23 error C2065: 'IID_IUnsecuredApartment' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 129 Error 24 error C2065: 'EventSink' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 132 Error 25 error C2065: 'pSink' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 132 Error 26 error C2061: syntax error : identifier 'EventSink' d:\1\eventsink\eventsink\event.cpp 132 Error 27 error C2227: left of '->AddRef' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 133 Error 28 error C2227: left of '->CreateObjectStub' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 136 Error 29 error C2065: 'IWbemObjectSink' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 138 Error 30 error C2065: 'pStubSink' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 138 Error 31 error C2065: 'IID_IWbemObjectSink' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 139 Error 32 error C2227: left of '->ExecNotificationQueryAsync' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 144 Error 33 error C2065: 'WBEM_FLAG_SEND_STATUS' : undeclared identifier d:\1\eventsink\eventsink\event.cpp 149 Error 34 error C3861: '_bstr_t': identifier not found d:\1\eventsink\eventsink\event.cpp 145 Error 35 error C3861: '_bstr_t': identifier not found d:\1\eventsink\eventsink\event.cpp 146 Error 36 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 158 Error 37 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 159 Error 38 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 160 Error 39 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 162 Error 40 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 163 Error 41 error C2227: left of '->CancelAsyncCall' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 171 Error 42 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 176 Error 43 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 177 Error 44 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 178 Error 45 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 180 Error 46 error C2227: left of '->Release' must point to class/struct/union/generic type d:\1\eventsink\eventsink\event.cpp 181 |
| markiz is offline | |
| | #13 | |
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,099
| Add #define _WIN32_WINNT 0x400 To your header and using namespace std; to your source file. See if that helps.
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| |
| Elysia is offline | |
| | #14 |
| Registered User Join Date: Mar 2008
Posts: 26
| using namespace std; this one I already have. #define _WIN32_WINNT 0x400; didn't help |
| markiz is offline | |
| | #15 |
| Registered User Join Date: Mar 2003
Posts: 3,844
| You need to have _WIN32_WINNT defined before you include any header files. gg |
| Codeplug is online now | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Understanding creation of destruction and creation of data types | yougene | C Programming | 2 | 12-16-2008 02:43 PM |
| File creation date (in windows 98 and XP) | esbo | C Programming | 12 | 05-03-2006 05:27 PM |
| program not working...please look at this | JOlszewski | C Programming | 3 | 01-30-2006 10:33 PM |
| Dynamic Creation of an object | axr0284 | Windows Programming | 3 | 02-05-2005 10:27 AM |
| Newton + Einstein were wrong! | Jez | A Brief History of Cprogramming.com | 64 | 12-14-2004 02:24 PM |