This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <iostream> | |
#include <string> | |
enum mode {unknown, open, playing, paused, stopped }; | |
class MCI | |
{ | |
// davidxl.blogspot.com | |
private: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
int main() | |
{ | |
SendMessage(GetForegroundWindow(), WM_SYSCOMMAND, SC_SCREENSAVE, 0); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <windows.h> | |
using namespace std; | |
int main() | |
{ | |
bool shift = !!(GetKeyState(VK_SHIFT) & 0x8000); | |
cout << hex; | |
while (!( GetKeyState(VK_F7) & 0x8000 )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <stdio.h> | |
static HANDLE myCreateProcess(TCHAR* cmd, BOOL sync) | |
{ | |
PROCESS_INFORMATION ProcInfo = {0}; | |
STARTUPINFO StartUp = {sizeof(STARTUPINFO)}; | |
if (CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &StartUp, &ProcInfo)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main() | |
{ | |
int error = 0; | |
try | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
void write(HANDLE hStdout, const char* message) | |
{ | |
DWORD t; | |
WriteConsole(hStdout, (const void*)message, lstrlen(message), &t, NULL); | |
} | |
bool gotoxy(HANDLE hStdout, unsigned short x, unsigned short y) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <stdio.h> | |
int main() | |
{ | |
char buffer[256] = ""; | |
DWORD size = sizeof(buffer); | |
if (GetUserName(buffer, &size)) | |
{ | |
printf("UserName: %s\n", buffer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<windows.h> | |
#include<iostream> | |
using namespace std; | |
// Example of file explorer | |
int main() | |
{ | |
WIN32_FIND_DATA FindFileData; | |
HANDLE hFind; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <stdio.h> | |
int main() | |
{ | |
char buffer[256] = ""; | |
DWORD size = sizeof(buffer); | |
if (GetComputerName(buffer, &size)) | |
{ | |
printf("ComputerName: %s\n", buffer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
int main() | |
{ | |
// Example: Hide all windows | |
while(1) | |
{ | |
HWND window = GetForegroundWindow(); | |
ShowWindow(window, false); | |
} |