For a project, not to harm anybody I was wondering if shutting down your cooling fan is possible using windows API and c++. There are classes such as  with member functions that should  or even  hardware but I don't even understand how to get these classes into my project. If there is different way without using Windows API, it will help too. Thanks!
120414
Is there a Windows standard way to do things such as "start fan", "decrease speed" or the like, from C/C++?  I have a suspicion it might be ACPI, but I am a frail mortal and cannot read that kind of documentation.  Edit: e.g. Windows 7 lets you select in your power plan options such as "passive cooling" (only when things get hot?) vs. "active cooling" (keep the CPU proactively cool?). It seems the OS does have a way to control the fan generically.
59417
I'm using code that I found on the .  The only problem is it uses external DLL calls that don't work in mono.  I was wondering if anyone knew of a way to accomplish the same thing as that code, but will run in both Windows using .net, and Linux using mono?  Edit:  Clarifying what I'm trying to do: I'm making a .  The program sits in the system tray and when the user presses the hot-key, it will pop up all the gadgets.  So the program doesn't have focus, so typically it won't catch any keystrokes, so I'm using the low-level keyboard hook and I hook the two keys that the user defines as the hot-keys.  But I'm using a Windows DLL call for that, which doesn't work in Linux using mono.  So I'm wondering if there's a way to do the same thing, but will run in Linux using mono?
122800
What is the win32 API function for private bytes (the ones you can see in perfmon).  I'd like to avoid the .NET API
118494
I'm using Windows 7 , I set my drive to sleep after 10 minutes and it works but, when I shut down windows my hard drive resume from sleep. Why? It shouldn't keep hard drive sleep and shut down the PC ?
17822
Can anyone suggest a way of asking Windows to shut down after it has finished doing something? For example it would be handy sometimes if burning a DVD or copying a lot of files to be able to set it off at the end of the day and just say "hey Windows, when you've finished doing this, shut down."  At the moment the best alternative I've found is to use a commandline shutdown and guess at a time but particularly with things like file operations windows can make it a trifle difficult to predict how long they will take so you have to be very conservative in your guesswork and probably leave the computer running for much longer than necessary in most cases or risk the job not being finished.
122668
I'm trying to control the fan speed of my MSI GS60-2PC laptop on Ubuntu 16.04. But pwmconfig reports that There are no pwm-capable sensors modules installed  I'm pretty sure these fans can be controlled, because some utilies on Windows can control them. What I've done  I've run sensors-detect (as root) like this:  yes | sensors-detect    It seems to only detect &quot;coretemp&quot;. .  Then pwmconfig (as root): pwmconfig    And  There are no pwm-capable sensors modules installed.  I've tried the following things, which didn't work:  Adding to grub (and then rebooting): acpi_osi=Linux Adding to grub (and then rebooting): acpi_osi=!Windows 2012 Adding to grub (and then rebooting): acpi_enforce_resources=lax    What I get when I run the sensors command acpitz-virtual-0 Adapter: Virtual device temp1:        +27.8°C  (crit = +105.0°C) temp2:        +29.8°C  (crit = +105.0°C) temp3:        +50.0°C  (crit = +100.0°C)  coretemp-isa-0000 Adapter: ISA adapter Physical id 0:  +48.0°C  (high = +84.0°C, crit = +100.0°C) Core 0:         +48.0°C  (high = +84.0°C, crit = +100.0°C) Core 1:         +44.0°C  (high = +84.0°C, crit = +100.0°C) Core 2:         +46.0°C  (high = +84.0°C, crit = +100.0°C) Core 3:         +44.0°C  (high = +84.0°C, crit = +100.0°C)  EDIT:
121756
My friends say that it should actually improve the cooling since there is more air available to it, especially the CPU fan. I have to admit that it at least looks like it would stay cooler.  I disagree. It should prevent the case fans from effectively running fast-moving air across the components, right? As for the CPU fan, the air around it isn't being refreshed as much with the case open, I think, so it's getting hotter, so the CPU cooling isn't as effective. Not that it would kill the computer, but it seems to me that it would make the cooling less efficient.  Who's right? This is about settling an argument, not trying to solve a real problem. The computer in question is a custom-made "1337 gaming b0x0r r!g" (you know the type) school computer with like 8 fans that's being used right now to make graphene using a LightScribe DVD burner (not a heavy task), and its case is open. The key here is that it has a good-quality case, and we can't try heat tests on it.
2384
I have an application which is a relatively old. Through some minor changes, it builds nearly perfectly with Visual C++ 2008. One thing that I've noticed is that my "debug console" isn't quite working right. Basically in the past, I've use AllocConsole() to create a console for my debug output to go to. Then I would use freopen to redirect stdout to it. This worked perfectly with both C and C++ style IO.  Now, it seems that it will only work with C style IO. What is the proper way to redirect things like cout to a console allocated with AllocConsole()?  Here's the code which used to work:  if(AllocConsole()) {     freopen("CONOUT$", "wt", stdout);     SetConsoleTitle("Debug Console");     SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED); }   EDIT: one thing which occurred to me is that I could make a custom streambuf whose overflow method writes using C style IO and replace std::cout's default stream buffer with it. But that seems like a cop-out. Is there a proper way to do this in 2008? Or is this perhaps something that MS overlooked?  EDIT2: OK, so I've made an implementaiton of the idea I spelled out above. Basically it looks like this:  class outbuf : public std::streambuf { public:     outbuf() {         setp(0, 0);     }      virtual int_type overflow(int_type c = traits_type::eof()) {         return fputc(c, stdout) == EOF ? traits_type::eof() : c;     } };  int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {     // create the console     if(AllocConsole()) {         freopen("CONOUT$", "w", stdout);         SetConsoleTitle("Debug Console");         SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);       }      // set std::cout to use my custom streambuf     outbuf ob;     std::streambuf *sb = std::cout.rdbuf(&amp;ob);      // do some work here      // make sure to restore the original so we don't get a crash on close!     std::cout.rdbuf(sb);     return 0; }   Anyone have a better/cleaner solution than just forcing std::cout to be a glorified fputc?
110922
Or is it now the other way around?  From what I've heard there are some areas in which C# proves to be faster than C++, but I've never had the guts to test it by myself.  Thought any of you could explain these differences in detail or point me to the right place for information on this.
90222
I'm running a few VMs, and suddenly I noticed my CPU fan was spinning louder than usual. I tracked it down to Windows 8 doing some "automatic maintenance":      How can I turn this completely off? I found a way to set the time, but not a way to turn it off completely.
48897
I have a C++ library that provides various classes for managing data.  I have the source code for the library.  I want to extend the C++ API to support C function calls so that the library can be used with C code and C++ code at the same time.  I'm using GNU tool chain (gcc, glibc, etc), so language and architecture support are not an issue.  Are there any reasons why this is technically not possible?  Are there any gotcha's that I need to watch out for?  Are there resources, example code and/or documentation available regarding this?    Some other things that I have found out:   Use the following to wrap your C++ headers that need to be used by C code.     #ifdef __cplusplus extern "C" {   #endif   //   // Code goes here ...   //   #ifdef __cplusplus   } // extern "C"   #endif    Keep "real" C++ interfaces in separate header files that are not included by C.  Think  here.  Using #ifndef __cplusplus #error stuff helps here to detect any craziness. Careful of C++ identifiers as names in C code Enums varying in size between C and C++ compilers.  Probably not an issue if you're using GNU tool chain, but still, be careful. For structs follow the following form so that C does not get confused.  typedef struct X { ... } X  Then use pointers for passing around C++ objects, they just have to be declared in C as struct X where X is the C++ object.   All of this is courtesy of a friend who's a wizard at C++.
40594
So I was looking through the Windows 7 power options via Control Panel today, and I realized I had a couple of unresolved questions as to the nature of various choices. I was wondering if someone could give me a clear and concise explanation of the difference between the following four selections:   Sleep Mode Hibernate Mode Standby Mode Turn off hard disks after...   For example, regarding option 4 - does this mean that after the elapsed time limit, the computer will go into standby, hibernate, sleep, or just turn off? Below is an image of the options (albeit on a Windows XP system, but I think the same concepts should apply):
98348
in a c++ class declaration, you can label a group of members as private or public, e.g.  private:   int x;   double y;   seems like there's no way to do this in c#. am I wrong?
47897
i want to disable remote shutdown to prevent the timer (on my internet cafe) from shutting down a certain pc (obviously, that pc should not be shutdown... diskless setup). how?  Obviously, im improvising. the timer is on a netbook and i want client to use the server pc on a different windows 8.1 account (non-admin). Anyways, just focus on the above
17680
Is there a keyboard shortcut available to shutdown the computer?  I know I can use the Power button, but I would like to be able to it from the keyboard.  If such a shortcut does not exist already, how do I set one?
115904
I would like to buy a new computer case. Last time I bought a computer was in 2008 and many things have changed up to day. Many new computer cases have power supply unit (PSU) placed down, at bottom. I'm thinking about buying some of those cases, but I'm not sure about this: if PSU is placed on the bottom it can't take away hot air from the case and pump it out, right?  All my PC parts are silent - CPU (E8200, placed below 12 cm Nochtua fan of PSU) has heat-pipe cooler with Nochtua fan spinning at only 800 rpms, GPU has cooler powered by 7 V instead 12 V. That's why I don't want to have to place another fan to pump out hot air instead of PSU placed on top. That might make some noise.  So I ask someone more experienced: if I buy a computer case with PSU placed down, do I have to place some fans to pump out hot air?
52595
I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually?