Skip to content

Instantly share code, notes, and snippets.

View AcnodeLabs's full-sized avatar

AcnodeLabs AcnodeLabs

View GitHub Profile
void DoEvents() {
MSG msg;
if(::PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
}
@AcnodeLabs
AcnodeLabs / gist:377a52851591b67a0b00151b99abe3f0
Created June 8, 2018 18:05
Spawner of Sub Process in a Windows Application
class Spawner {
STARTUPINFOA si;
PROCESS_INFORMATION pri;
bool wasOk;
string _name;
public:
Spawner(string name) { _name = name; wasOk = FALSE; }
void Activate(bool status) {
@AcnodeLabs
AcnodeLabs / gist:2cada3631cccc079f8ec4c122c120afa
Last active March 21, 2018 05:13
Toggle between two variables
int toggleV1(int v1, int v2) {
static short n = 0;
if (n==0) { n=1; return v1;}
if (n==1) { n=0; return v2;}
return 0;
}
int toggleV2(int v1, int v2) {
static bool t = false;
t = !t;
return (t ? v1 : v2);
@AcnodeLabs
AcnodeLabs / main_io.cpp
Last active September 12, 2017 04:58
cpp starter file in out
#include <stdio.h>
char line[1024];
void operateOnFiles(FILE* fin, FILE* fout) {
printf("Files Ok..\n");
while (!feof(fin)){
fgets(line, 1024, fin);
printf("%s", line); // Start Here