AnimateWindow()

This is a discussion on AnimateWindow() within the Windows Programming forums, part of the Platform Specific Boards category; I am intercepting SC_MINIMIZE at WM_SYSCOMMAND to hide my app to the SysTray. Actually all Im doing until now is ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    42

    AnimateWindow()

    I am intercepting SC_MINIMIZE at WM_SYSCOMMAND to hide my app to the SysTray. Actually all Im doing until now is a ShowWindow(Main, SW_HIDE);

    Now Im trying to create the Minimize to Tray animation, but of course I cant use WM_MINIMIZE, it would minimize to the TaskBar, not the SysTray(or the "TaskBar Notification/Status Area" according to MS ).

    So Im trying to deal with AnimateWindow(). It looks like libuser32.a (MingW3.2, W32Api2) does not handle it? Well I cant just use it like any other libuser32.a function. So, no other options left, Im loading it dinamically from User32.dll like...
    Code:
    ....
    ....
    #define AW_HOR_POSITIVE 0x00000001 
    #define AW_HOR_NEGATIVE 0x00000002 
    #define AW_VER_POSITIVE 0x00000004 
    #define AW_VER_NEGATIVE 0x00000008 
    #define AW_CENTER 0x00000010 
    #define AW_HIDE 0x00010000 
    #define AW_ACTIVATE 0x00020000 
    #define AW_SLIDE 0x00040000 
    #define AW_BLEND 0x00080000
    ....
    ....
    ....
    
    LoadLibrary(TEXT("user32.dll")); 
    typedef BOOL (WINAPI *lpfnAnimateWindow)(HWND hwnd, DWORD dwTime, DWORD dwFlags); 
    lpfnAnimateWindow AnimateWindow; 
    
    HMODULE hUser32 = GetModuleHandle(TEXT("user32.dll")); 
    AnimateWindow = (lpfnAnimateWindow)GetProcAddress(hUser32,"AnimateWindow"); 
    
    AnimateWindow(hwndm,1000,AW_SLIDE | AW_HOR_POSITIVE | AW_VER_POSITIVE);
    But it sux to load a dll just for a damned minimize action :\ I was thinking if maybe one of you knew of any other smarter way to
    do it.
    As on my Googlings around I could not find anyone complaining about MingW libs not supporting AnimateWindow() Im guessing theres a big chance that Im doing something wrong, maybe not defining something I should, any stuff like that. Maybe one of you can just confirm to me that it is possible to use it.

    Thank you!

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Looks like the header and the library are missing AnimateWindow as is the most recent def file so what you're doing is probably the simplest way to use the fn.

    If you want, you could always modify user32.def, rebuild libuser32.a and add the missing defines/typedefs to winuser.h and submit your changes to mingw cvs....
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. AnimateWindow
    By Anuradh_a in forum Windows Programming
    Replies: 1
    Last Post: 06-12-2008, 02:04 AM
  2. AnimateWindow && Dev-C++ problems
    By willc0de4food in forum Windows Programming
    Replies: 4
    Last Post: 03-13-2006, 04:34 PM
  3. AnimateWindow
    By jmd15 in forum Windows Programming
    Replies: 1
    Last Post: 07-16-2005, 04:35 PM

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