/** * Copyright © 2012 Adonis S. Deliannis
* You may use this in any way possible, but please give credit. **/
#include <dwmapi.h>
#include <Windows.h>
#include <iostream>
#include <tchar.h>
#include "ErrorCodes.h"
#define Life 42
#pragma comment(lib, "dwmapi.lib")
using namespace std;
TCHAR Appname[MAX_PATH];
MARGINS *Frame(int, int, int, int);
int main ( int argc, char *argv[] ) {
GetModuleFileName(NULL, Appname, MAX_PATH);
MARGINS *pMargins = Frame(-1,-1,-1,-1);
if(argc == 3) {
DwmExtendFrameIntoClientArea(FindWindow(argv[1], argv[2]), pMargins);
}
else if( argc == 2) {
DwmExtendFrameIntoClientArea(FindWindow(argv[1], NULL), pMargins);
}
else
{
cout << Appname << " [Class] [Title]" << endl;
return EXIT_FAILURE;
}
cout << GetError(GetLastError()) << endl;
return GetLastError();
}
MARGINS *Frame(int xLeft, int xRight, int yBottom, int yTop) {
MARGINS *f = new MARGINS();
f->cxLeftWidth = xLeft;
f->cxRightWidth = xRight;
f->cyBottomHeight = yBottom;
f->cyTopHeight = yTop;
return f;
}
Comments
0 B
|👍
/👎