Not a Member Yet,
Click here to Register

ID: 139
Viewed: 2397
Added: Apr 28, 2002
Version:
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

Windows API Guide: GetActiveWindow Function Platforms: Win 32s, Win 95/98, Win NT GetActiveWindow returns a handle to your program's currently active window. This only works with windows created by your application -- in other words, it won't find the active window of other programs. If your program is in the background, the function will get the window that would be active if the program were active. If an error occurs, or if there is no active window to your program, the function instead returns 0.

Highlight all by clicking in box
<!---Declaration--->
none

Highlight All
<!---Code--->
'GetActiveWindow Function
Declare Function GetActiveWindow Lib "user32.dll" () As Long

' Example:

' Use FlashWindow to flash the title bar of the program's
' currently active window once.
Dim hactive As Long ' handle to the active window
Dim retval As Long ' return value
hactive = GetActiveWindow() ' get the handle of the program's active window
' The next three lines flash the window's title bar
retval = FlashWindow(hactive, 1): Sleep 250
retval = FlashWindow(hactive, 1): Sleep 250
retval = FlashWindow(hactive, 0);


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2024 snippetlibrary.com All Rights Reserved. Conditions
Do NOT follow this link or you will be banned from the site!