Blizzardo1 icon

Dwm Transparency

Blizzardo1 | PRO | 07/24/12 07:26:51 AM UTC | 0 ⭐ | 582 👁️ | Never ⏰ | []
C++ |

1.06 KB

|

None

|

0 👍

/

0 👎

/** * 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

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎