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
// Hide cursor | |
LRESULT CALLBACK dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) | |
{ | |
switch(msg) | |
{ | |
// put this in your dialogProc | |
case WM_SETCURSOR: | |
SetCursor(NULL); | |
return TRUE; |
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() | |
{ | |
//allocate a data | |
INPUT *data = new INPUT[3]; | |
// Move to position. data | |
data->type = INPUT_MOUSE; | |
data->mi.dx = 0; // Position x |
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> | |
// Get Current Folder | |
void GetFolder(char *folderName) | |
{ | |
GetModuleFileName(GetModuleHandle(NULL), folderName, MAX_PATH); | |
*(strrchr(folderName, '\\')) = 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 <stdio.h> | |
#include <windows.h> | |
// If have compile errors: | |
// Replace TokenElevation by (TOKEN_INFORMATION_CLASS)20 | |
// Uncomment next struct | |
/* | |
typedef struct _TOKEN_ELEVATION { | |
DWORD TokenIsElevated; | |
} TOKEN_ELEVATION, *PTOKEN_ELEVATION; |
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); | |
} |
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> | |
#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 (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> | |
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 <iostream> | |
#include <string> | |
using namespace std; | |
int main() | |
{ | |
int error = 0; | |
try | |
{ |