LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use SetLayeredWindowAttributes or alternative

I want to create a real transparent panel to place overtop of another in may application. 
 
I've tried to use the Windows SDK function SetLayeredWindowAttributes, but it is not defined in CVI's version of the windows SDK.  Is there another way to make the window transparent without using SetWindowRgn? I don't want to use SetWindowRgn since I want to the window to actually exisit and get mouse events... I just want to make it transparent.
 
I can use the real Windows SDK, but I can't complie with it in CVI without a ton of errors and can only compile Release versions of the project with an external MSVC compiler (works, but no debugger). 
 
Any of following would work, but I can seem to do any of them...
 
-Make a real transparent window with CVI functions
-Use the real Windows SDK with CVI (I understand that there are ANSI C compiler issues amoung problems)
-Compile a debuggable CVI project with an external MSVC compiler.
-something else?
 
Does anyone have any suggestion?
0 Kudos
Message 1 of 3
(4,867 Views)
I've solved this by loading the user32.dll, calling SetLayeredWindowAttributes from there and defining some missing typedefs.  This method should work for any windows SDK function not included in CVI's version.

Message Edited by gvanslyk on 02-14-2007 06:48 AM

0 Kudos
Message 2 of 3
(4,850 Views)
Hey gvanslyk,

This method is actually included in the CVI Windows SDK functions.  I believe the reason you are not seeing it is because this function requires Windows 2000 or greater.  By default, if you do not tell CVI what version of Windows you want to use it will define WINVER as 0x0400 which is Windows NT 4.0.  If you define _WIN32_WINNT=0x0500 this will force it to compile all the Windows 2000 SDK functions as well.  There is a knowledgebase below that explains this a little more.  All you should need to do is go to Options>>Build Options and place "/D_WIN32_WINNT=0x0500" in the Compiler Defines. Hope this helps!

Missing Prototype Errors with Windows SDK and LabWindows/CVI
Pat P.
Software Engineer
National Instruments
Message 3 of 3
(4,838 Views)