Hi all,
Here's a lil code to open a website with C++
Code:
#include <windows.h>
int main()
{
ShellExecute(NULL, "open", "http://dreamincode.net",
NULL, NULL, SW_SHOWNORMAL);
}
In combination with this code, u could make a funny virus for your friends
Code:
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// Turns the monitor off
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
// Higher number is longer monitor off.
Sleep(500);
// Turns monitor on
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) -1);
return 0;
}
Tested in Dev C++