Advertisement
Blizzardo1

Dwm Transparency

Jul 24th, 2012
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. /** * Copyright © 2012 Adonis S. Deliannis
  2.     * You may use this in any way possible, but please give credit. **/
  3. #include <dwmapi.h>
  4. #include <Windows.h>
  5. #include <iostream>
  6. #include <tchar.h>
  7. #include "ErrorCodes.h"
  8.  
  9. #define Life 42
  10.  
  11. #pragma comment(lib, "dwmapi.lib")
  12.  
  13. using namespace std;
  14.  
  15. TCHAR Appname[MAX_PATH];
  16.  
  17. MARGINS *Frame(int, int, int, int);
  18.  
  19. int main ( int argc, char *argv[] ) {
  20.    
  21.     GetModuleFileName(NULL, Appname, MAX_PATH);
  22.    
  23.     MARGINS *pMargins = Frame(-1,-1,-1,-1);
  24.  
  25.     if(argc == 3) {
  26.         DwmExtendFrameIntoClientArea(FindWindow(argv[1], argv[2]), pMargins);
  27.     }
  28.     else if( argc == 2) {
  29.         DwmExtendFrameIntoClientArea(FindWindow(argv[1], NULL), pMargins);
  30.     }
  31.     else
  32.     {
  33.         cout << Appname << " [Class] [Title]" << endl;
  34.         return EXIT_FAILURE;
  35.     }
  36.     cout << GetError(GetLastError()) << endl;
  37.     return GetLastError();
  38. }
  39.  
  40. MARGINS *Frame(int xLeft, int xRight, int yBottom, int yTop) {
  41.     MARGINS *f = new MARGINS();
  42.     f->cxLeftWidth = xLeft;
  43.     f->cxRightWidth = xRight;
  44.     f->cyBottomHeight = yBottom;
  45.     f->cyTopHeight = yTop;
  46.     return f;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement