I think WMI will be your thing. Take a look at 'Win32_OperatingSystem', there's an InstallDate property.
Don't think you are, know you are... custom hardware & software - olloc.be
I think WMI will be your thing. Take a look at 'Win32_OperatingSystem', there's an InstallDate property.
Don't think you are, know you are... custom hardware & software - olloc.be
Well, the error says it all...;) WSAECONNREFUSED 10061 No connection could be made because the target machine actively refused it. Don't think you are, know you are... custom hardware & software - olloc.be
Damn you guys were fast :-D Don't think you are, know you are... custom hardware & software - olloc.be
There are 2 places in the registry that you can use for this: If you only want to run your application once on the next startup then add a new key to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\" If you want your exe to run every time windows is started then make a new key in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" Don't think you are, know you are... custom hardware & software - olloc.be
You could use a return code instead of using 'void' everywhere. The return code would indicate if the method succeeded... Your code would become:void event1(...) { //this event is called first if (method1()) { //more stuff } } public bool method1() { //some stuff if (method2()) { //more stuff return true; } return false; } public bool method2() { //some stuff if (method3()) { //more stuff return true; } return false; } public bool method3() { //some stuff if (x == 0) { //now exit return false; } //more stuff return true; }
another way would be to use exceptions which would make your code look like:void event1(...) { try { //this event is called first method1(); //more stuff } catch (Exception e) { // something went wrong... } } public void method1() { //some stuff method2(); //more stuff } public void method2() { //some stuff method3(); //more stuff } public void method3() { //some stuff if (x == 0) { //now exit // create an exception Exception e; // blablabla... throw e; } //more stuff }
Hope this helps... RicoH Don't think you are, know you are... custom hardware & software - olloc.be
Just use ShellExecute like this: ShellExecute(NULL, _T("open"), "C:\\MyFolder\\MyPdf.pdf", "", "", SW_SHOW); RicoH Don't think you are, know you are... custom hardware & software - olloc.be -- modified at 10:48 Friday 12th May, 2006
Hi, If you call 'GetDeviceCaps' on your device context you can get the width and height, in millimeters, of your physical screen. You can also get the resolution of the screen in pixels this way, so you should be able to do some calculations based on these values... Don't think you are, know you are...
Hi, to log the users keyboard and mouse activity you'll have to take a look at the 'SetWindowsHookEx' function. This allows you to set system-wide keyboard and mouse hooks which will receive all keyboard and mouse activity. Once you have captured the events you can make use of the 'SendInput' function to send the events to the OS which will handle them as if you were really typing or moving the mouse... Don't think you are, know you are...
It's not because there is a null character in your string that the rest of your data isn't read from the serial port. What you can do is read the data (all at once) in to a char[] and then copy character per character into a string if you want to... Something like this: int i, index=0; char DataBuffer[], StringBuffer[]; ReadFile(...) for (i=0; i < NumberOfBytesRead; i++) { if (DataBuffer[i] != '\0') StringBuffer[index++] = DataBuffer[i]; } This way you don't have to worry about communication timing and so on. Don't think you are, know you are...
I don't think that you can hide your application completely, but you can definitely hide it enough so the average user won't find it. If you don't show the main window of your application "ShowWindow(SW_HIDE)" then you won't have an entry on the taskbar. It will however be visible in task manager. If you don't want it in the task manager you'll have to make a service of your application. (search for 'service' on CP and you'll find a bunch of articles on how to do this...) In the event viewer you'll still be able to see that your service is started, but I guess the average user won't go looking there. Hiding your app from the user might not be a nice thing to do as they have a right to know what's going on... Don't think you are, know you are...
you should check out the SetWindowsHookEx[^] function which is supported on WinNT, 2000 and XP. This will let you set a low-level keyboard hook. There is an article[^] on MSDN which describes the use of a low-level hook. Enjoy! Don't think you are, know you are...
First of all, you'll have to make a dll to set a system-wide hook. In this dll you'll have to register your keyboard hook procedure. Your hook function will be called on every keypress the user makes, so at that point you check what key has been pressed and with the function 'GetAsyncKeyState' you can see wether ctrl, alt or one of the shift keys is down as well. Next, you'll have to create an application which loads the dll and call a function in the dll to register the hook procedure (if not done by loading the dll). If you want to keep things clean you should have a funtion in your dll to unhook your thing if you no longer need it, or close your app... Don't think you are, know you are...
There is a dll that can help you with that MSXML4.DLL maybe you should check out these docs http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmmscXML.asp[^] Don't think you are, know you are...
It depends on what properties you're looking for GetWindowText will give you the name in the titlebar GetWindowRect and GetClientRect will get size GetWindowLong can be used the see what styles the window has... you can enumerate all the child windows with EnumChildWindows There are lots of things you can do, so maybe you should check the msdn docs hope this helps Don't think you are, know you are...
ATL has a CImage class which lets you load an image from file and do whatever you want with it... Just check out the CImage class in MSDN to get you on the road. Don't think you are, know you are...
I'll have a look at the CreateRemoteThread thingy... Thanx Don't think you are, know you are...
The problem is that I can't modify the sources of the original exe.:( That's why I was wondering if it is possible the hook an 'internal' function, given that you know the name of it (if this is even relevant). Don't think you are, know you are...
Yes, I do have the source of that exe. What I would like to do is make some sort of program that hooks several functions of the specific exe so I can extract internal information. We have lots of version of this exe and we can't put lots of debugging information in them... Don't think you are, know you are...
Hi, I know it is possible to hook a function which is exported in a dll, but I was wondering if it is possible to hook a function in an exe? thanx Don't think you are, know you are...
I don't think it is possible to forbid an application from executing. Allthough I know that in XP there is something ( group policies I think ) where you can block certain applications. What you could do if you want to block an application is use a system-wide hook in a dll and check when a window is created. From that window you can easily get the executable's name and end the process if you don't want it to run... Don't think you are, know you are...