Transparency

This is a discussion on Transparency within the Windows Programming forums, part of the Platform Specific Boards category; hi, A just saw a program and the window was transparent. You could see your desktop through it, it was ...

  1. #1
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744

    Transparency

    hi,

    A just saw a program and the window was transparent. You could see your desktop through it, it was pretty cool. You could also adjust the transparency.
    How can I do this. (win32 api, no MFC)

    The program also said that it was for win2k or better. When I implement this function in my program is it possible to run the program on 98 or millennium, if I first test which OS is on it and use en if statement to bypass this function.

    thx

  2. #2
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    This link might help.
    zen

  3. #3
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    yes, this is what I was looking for.

    thanks Zen

  4. #4
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    They talk about SetLayeredWindowAttributes(),WS_EX_LAYERED,...
    My compiler (VC++6),doesn't know them (error:WS_EX_LAYERED' : undeclared identifier)

    are there libraries and heatherfiles that I don't have?
    Does anyone ever used these functions or styles?
    can't find any info on msdn or google about which files to include

    thx

  5. #5
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    You'll need this before you include windows.h -

    #define _WIN32_WINNT 0x0500

    You may also need an update of the platform SDK from MS.
    zen

  6. #6
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    I've done that and it still doesn't work.

    I also doawloaded service pack 5 for vc++ and that doesn't help either.(maybe stupid question but:are service packs the same as an sdk update)

    got any other ideas?

  7. #7
    Registered User
    Join Date
    Aug 2001
    Posts
    72
    ok this can help you
    Code:
    #ifndef WS_EX_LAYERED 
    #define WS_EX_LAYERED           0x00080000 
    #define LWA_COLORKEY			0x00000001
    #define LWA_ALPHA               0x00000002 
    #endif // ndef WS_EX_LAYERED 
    
    typedef BOOL (WINAPI *lpfnSetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
    and also
    Code:
    	lpfnSetLayeredWindowAttributes pSetLayeredWindowAttributes; 
    
    	HMODULE hUser32 = GetModuleHandle(_T("USER32.DLL")); 
    
    	pSetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes)GetProcAddress(hUser32, "SetLayeredWindowAttributes");

  8. #8
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    yes,yes,yes. It works finaly. thanks a lot Zen and damyan

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 06-17-2008, 05:00 PM
  2. Transparency thing
    By Gordon in forum Windows Programming
    Replies: 2
    Last Post: 04-23-2008, 11:34 AM
  3. Nonclient & client area transparency
    By TheDan in forum Windows Programming
    Replies: 0
    Last Post: 03-27-2007, 03:19 PM
  4. How do you print on a transparency ?
    By Zeeshan in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 02-25-2003, 02:29 PM
  5. GIF Transparency
    By dbaryl in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 04-20-2002, 06:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21