Platform question
-
I made an app that can run on Win9x/Win2k. I want that on Win2k my dialog become transparent, so I used the fonction SetLayeredWindowAttributes(...). It won't compile, I've added /D "_WIN32_WINNT=0x0500" to the compiler additional Options, now it compils but don't work on Win9x... Is it a way to make my app work on all Windows ?
-
I made an app that can run on Win9x/Win2k. I want that on Win2k my dialog become transparent, so I used the fonction SetLayeredWindowAttributes(...). It won't compile, I've added /D "_WIN32_WINNT=0x0500" to the compiler additional Options, now it compils but don't work on Win9x... Is it a way to make my app work on all Windows ?
-
Yes I know, but I thought that the app can run on Win9x and the fonction simply ignored.... And I know I can load SetLayeredWindowAttributes directly from "User32.dll" with LoadLibrary blabla, but I was asking if there is a solution to simply use SetLayeredWindowAttributes (I don't need to load it from User32.dll because I have the last Platform SDK) and make my app run on all Windows (and the fonction does nothing on Win9x). Ouch sorry for my english I hope someone will understand what I want to say ;o) Anyway, Lakitu thanks for your answer.
-
I made an app that can run on Win9x/Win2k. I want that on Win2k my dialog become transparent, so I used the fonction SetLayeredWindowAttributes(...). It won't compile, I've added /D "_WIN32_WINNT=0x0500" to the compiler additional Options, now it compils but don't work on Win9x... Is it a way to make my app work on all Windows ?
OSVERSIONINFO os;
::GetVersionEx(&os);if ( os.dwMajorVersion>=5 )
SetLayeredWindowAttributes(...).
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
-
OSVERSIONINFO os;
::GetVersionEx(&os);if ( os.dwMajorVersion>=5 )
SetLayeredWindowAttributes(...).
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
-
Yes I know this code, but it doesn't solve my problem ! To compile it I have to set /D "_WIN32_WINNT=0x0500" but when I set that it doesn't work on Win9x :-/
Put this code in a separate DLL. And make two versions of this DLL, one without _WIN32_WINNT=0x0500. From your main app, you then just need to load the appropriate DLL depending on the os version. This DLL remains small, which is may be a better approach than having two whole apps compiled for each target os.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
-
Put this code in a separate DLL. And make two versions of this DLL, one without _WIN32_WINNT=0x0500. From your main app, you then just need to load the appropriate DLL depending on the os version. This DLL remains small, which is may be a better approach than having two whole apps compiled for each target os.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
The alternative is to write a wrapper function for the one you're trying to use, which detects the OS version and if it's Win2000/XP or later, gets the address of the function from USER32 and calls it, otherwise does nothing. Your problem is two things; You don't have the function declaration unless you have _WIN32_WINNT set to 0x0500, and with that in place, you have a reference to the function in your EXE. When the EXE runs on an earlier (NT,9x) system, the function cannot be located by the import lib code you pulled in when you built. You can either do what Stephane suggests, what I suggest, or not use the function :) Steve S [This signature space available for rent]
-
I made an app that can run on Win9x/Win2k. I want that on Win2k my dialog become transparent, so I used the fonction SetLayeredWindowAttributes(...). It won't compile, I've added /D "_WIN32_WINNT=0x0500" to the compiler additional Options, now it compils but don't work on Win9x... Is it a way to make my app work on all Windows ?