Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get taskbar icon to flash 2

Status
Not open for further replies.

chpicker

Programmer
Apr 10, 2001
1,316
I've seen in many Windows programs where, when a background program has some kind of activity, the taskbar icon will flash. Is there a way for VFP to do this? Perhaps an API function you can call?
 
Hmm...I'm not sure if this will do what I need or not, but I found this one:

BOOL FlashWindow(
HWND hWnd, // handle to window
BOOL bInvert // flash status
);

Now, the description says that it will change the appearance of the caption bar by making it look alternately active/inactive.

Now...how do I obtain the window handle to the main Visual FoxPro window?

Ian
 
chpicker

That looks like VB code...

The MainHWnd() function in foxtools might help you get the window handle.
 
It's actually C code...it's just showing the declaration of a Windows API function.

Thanks for the tip...I'll see if it works. :eek:)

Ian
 
Hello Ian,

Is this what your looking for?

tcWindowTitle = "Some Window Title" && Look to see if the app is running
nWinHandle = FindWindow(NULL, tcWindowTitle) && Check if running

nWindowHandle > 0 Indicates the Window was found and nWindowHandle is the reference to the active window

(For the main Visual Fox Pro Window the title is 'Microsoft Visual FoxPro'.)

WJS
 
Cool, I figured it out:
[tt]
SET LIBRARY TO foxtools ADDITIVE
DECLARE INTEGER FlashWindow in win32api ;
INTEGER wndhand,INTEGER invert

=FlashWindow(MainHWnd(),1)
[/tt]
The FlashWindow function does exactly what I was hoping for. Of course, it only does a single flash, but combined with a timer it's perfect.

Thanks for the help, Mike...I was afraid I was going to have to write another FLL to do this! LOL

Ian
 
chpicker

Excellent!

I guess you want to flash the minimized application, use a timer to continue the flashing and check for the _screen.WindowState becomes 2 to stop the timer...
 
Yep...that's the idea. :eek:)

Thanks Mike.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top