I made a simple app to turn off a monitor. The entire program consists of just this:
monoff.cpp

#include "windows.h"
#define MON_OFF 0x2
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,  LPSTR lpCmdLine, int nCmdShow)
{
	SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, MON_OFF);
	return 0;
}

For some reason it still wont run without msvcr100.dll!

how do I compile this that it will run with the standard dlls that windows ships with?

thanks for any help

I knew about the /MT thing. But I have to try that win32_lean_and_mean thing. I just need to find a computer somewhere that I know hasn't already had the vc++ redistributable installed on it already so I know for sure. Also, I downloaded a version of of "Pelles C", so I'm going to try compiling it as regular old C too and see what happens.

edit: using the /MT in pelles C gives me a small 18kb file instead of the 32.5kb that I get with VC++ 2010. If I choose the single threaded option in pelles, the file compiles to 8.5kb

#define WIN32_LEAN_AND_MEAN 
#include "windows.h"
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2);
	return 0;
}

Edited 6 Years Ago by VBNick: n/a

>>I just need to find a computer somewhere that I know hasn't already had the vc++ redistributable installed on it already

That should be quite easy -- just do a fresh install of the Windows operating system.

I know that..lol
I only have one computer though. I do start school in October though...
I'm sure they have got some old junker computers hanging around.

Edited 6 Years Ago by VBNick: n/a

This article has been dead for over six months. Start a new discussion instead.