Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. FlashWindowEx

FlashWindowEx

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dody_DK
    wrote on last edited by
    #1

    Why I can't use the FlashWindowEx() with MFC based dialog... it gives me that FlashWindowEx is not declared, any way to use it? thanks in advance...

    PJ ArendsP 1 Reply Last reply
    0
    • D Dody_DK

      Why I can't use the FlashWindowEx() with MFC based dialog... it gives me that FlashWindowEx is not declared, any way to use it? thanks in advance...

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      FlashWindowEx is declared in WinUser.h. If you open WinUser.h and do a text search for FlashWindowEx you will see that FlashWindowEx is wrapped in a pre-processor conditional statement "#if(WINVER >= 0x0500)". So to use FlashWindowEx you have to #define WINVER 0x0500 at the top of your stdafx.h file.


      "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!

      Within you lies the power for good; Use it!

      D 1 Reply Last reply
      0
      • PJ ArendsP PJ Arends

        FlashWindowEx is declared in WinUser.h. If you open WinUser.h and do a text search for FlashWindowEx you will see that FlashWindowEx is wrapped in a pre-processor conditional statement "#if(WINVER >= 0x0500)". So to use FlashWindowEx you have to #define WINVER 0x0500 at the top of your stdafx.h file.


        "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!

        D Offline
        D Offline
        Dody_DK
        wrote on last edited by
        #3

        the problem is I don't have FlashWindowEx in the WinUser.h here is what I have FlashWindow( HWND hWnd, #if(WINVER >= 0x0500) DWORD dwFlags); #else BOOL bInvert); #endif #if(WINVER >= 0x0500) #define FLASHW_STOP 0 #define FLASHW_CAPTION 0x00000001 #define FLASHW_TRAY 0x00000002 #define FLASHW_ALL (FLASHW_CAPTION | FLASHW_TRAY) #define FLASHW_TIMER 0x00000004 #define FLASHW_TIMERNOFG 0x0000000C #endif /* WINVER >= 0x0500 */ any help with it? thanks....

        G 1 Reply Last reply
        0
        • D Dody_DK

          the problem is I don't have FlashWindowEx in the WinUser.h here is what I have FlashWindow( HWND hWnd, #if(WINVER >= 0x0500) DWORD dwFlags); #else BOOL bInvert); #endif #if(WINVER >= 0x0500) #define FLASHW_STOP 0 #define FLASHW_CAPTION 0x00000001 #define FLASHW_TRAY 0x00000002 #define FLASHW_ALL (FLASHW_CAPTION | FLASHW_TRAY) #define FLASHW_TIMER 0x00000004 #define FLASHW_TIMERNOFG 0x0000000C #endif /* WINVER >= 0x0500 */ any help with it? thanks....

          G Offline
          G Offline
          Gavin Taylor
          wrote on last edited by
          #4

          You've probobly still got a REALLY old version of the platform SDK, you've got two options, either download[^] the latest version or access the FlashWindowEx function on the fly using GetProcAddress[^]. If you choose the later option, you'll need something like:

          /* Taken from the MSDN website*/
          typedef struct {
          UINT cbSize;
          HWND hwnd;
          DWORD dwFlags;
          UINT uCount;
          DWORD dwTimeout;
          } FLASHEXINFO, *PFLASHEXINFO;

          #define FLASHW_STOP 0
          #define FLASHW_CAPTION 0x00000001
          #define FLASHW_TRAY 0x00000002
          #define FLASHW_ALL (FLASHW_CAPTION | FLASHW_TRAY)
          #define FLASHW_TIMER 0x00000004
          #define FLASHW_TIMERNOFG 0x0000000C

          typedef BOOL (WINAPI *PSFLEX)(PFLASHEXINFO);

          static PSFLEX pFlashWindowEx = NULL; // Pointer to actual function
          static BOOL initFlash = FALSE; // Loaded status

          BOOL uiFlashWindowEx( HWND hWnd, UINT uCount /* Flash Count */, DWORD dwFlags /* check SDK */ )
          {
          if ( ! initFlash )
          { // Not loaded yet
          HMODULE hDLL = NULL;
          hDLL = LoadLibrary( TEXT( "user32.dll" ) );
          if( hDLL )
          {
          pFlashWindowEx = ( PSFLEX ) GetProcAddress( hDLL, "FlashWindowEx" );
          initFlash = TRUE; // Loaded OK
          }
          }

          if ( pFlashWindowEx == NULL ) 
          	return FALSE; // Not Supported
          
          FLASHEXINFO fwi;
          ZeroMemory( & fwi, sizeof( FLASHEXINFO ) );
          fwi.cbSize = sizeof( FLASHEXINFO );
          fwi.dwFlags = dwFlags;
          fwi.hwnd = hWnd;
          fwi.uCount = uCount;
          fwi.dwTimeout = 0L;
          return pFlashWindowEx ( & fwi );
          

          }

          Once done, just use uiFlashWindowEx( hWnd, 3, FLASHW_TRAY ); or whatever Gavin Taylor w: http://www.gavspace.com -- modified at 12:37 Tuesday 3rd January, 2006

          D 1 Reply Last reply
          0
          • G Gavin Taylor

            You've probobly still got a REALLY old version of the platform SDK, you've got two options, either download[^] the latest version or access the FlashWindowEx function on the fly using GetProcAddress[^]. If you choose the later option, you'll need something like:

            /* Taken from the MSDN website*/
            typedef struct {
            UINT cbSize;
            HWND hwnd;
            DWORD dwFlags;
            UINT uCount;
            DWORD dwTimeout;
            } FLASHEXINFO, *PFLASHEXINFO;

            #define FLASHW_STOP 0
            #define FLASHW_CAPTION 0x00000001
            #define FLASHW_TRAY 0x00000002
            #define FLASHW_ALL (FLASHW_CAPTION | FLASHW_TRAY)
            #define FLASHW_TIMER 0x00000004
            #define FLASHW_TIMERNOFG 0x0000000C

            typedef BOOL (WINAPI *PSFLEX)(PFLASHEXINFO);

            static PSFLEX pFlashWindowEx = NULL; // Pointer to actual function
            static BOOL initFlash = FALSE; // Loaded status

            BOOL uiFlashWindowEx( HWND hWnd, UINT uCount /* Flash Count */, DWORD dwFlags /* check SDK */ )
            {
            if ( ! initFlash )
            { // Not loaded yet
            HMODULE hDLL = NULL;
            hDLL = LoadLibrary( TEXT( "user32.dll" ) );
            if( hDLL )
            {
            pFlashWindowEx = ( PSFLEX ) GetProcAddress( hDLL, "FlashWindowEx" );
            initFlash = TRUE; // Loaded OK
            }
            }

            if ( pFlashWindowEx == NULL ) 
            	return FALSE; // Not Supported
            
            FLASHEXINFO fwi;
            ZeroMemory( & fwi, sizeof( FLASHEXINFO ) );
            fwi.cbSize = sizeof( FLASHEXINFO );
            fwi.dwFlags = dwFlags;
            fwi.hwnd = hWnd;
            fwi.uCount = uCount;
            fwi.dwTimeout = 0L;
            return pFlashWindowEx ( & fwi );
            

            }

            Once done, just use uiFlashWindowEx( hWnd, 3, FLASHW_TRAY ); or whatever Gavin Taylor w: http://www.gavspace.com -- modified at 12:37 Tuesday 3rd January, 2006

            D Offline
            D Offline
            Dody_DK
            wrote on last edited by
            #5

            thanks alot, I download the last PSDK and linked the vc++ compilter to the new dorectories, and it works great now, thanks alot...

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups