PDA

Click to See Complete Forum and Search --> : Which API call...


Violenza
Jan 31st, 2001, 11:28 PM
You know when something happens in an application thats not on the foreground, it flashes blue on the windows taskbar? Is there an API call to make that happen?

Also which property of the main form tells you if it is currently the top level application (screen-wise)

Thanks

YoungBuck
Feb 1st, 2001, 12:46 AM
There isn't really a property that tells you if the form is the top-level window you need to use the GetActiveWindow API call for this and the FlashWindow API call is what you need to use to have your window flash in the TaskBar....

You need a timer to test the following code


Option Explicit

Private Declare Function FlashWindow Lib "user32" (ByVal hwnd As Long, ByVal bInvert As Long) As Long
Private Declare Function GetActiveWindow Lib "user32" () As Long

Private Sub Form_Load()

Timer1.Interval = 500

End Sub

Private Sub Timer1_Timer()

' if the current window is not the active window then flash the title bar
If Not Me.hwnd = GetActiveWindow Then

FlashWindow Me.hwnd, CLng(True)

End If

End Sub

DarkJedi9
Feb 1st, 2001, 06:36 PM
What does Option Explicit mean?

Feb 1st, 2001, 09:07 PM
Option Explicit - Forces explicit declaration of all variables in a script.


Means you have to Dim everything or you will get an error.


-------
'No error
Option Explicit

Dim MyString As String
MyString = "Hello World"
--------

-------
'Error
Option Explicit

MyString = "Hello World"
--------

-------
'No error

Dim MyString As String
MyString = "Hello World"
--------

-------
'No error

MyString = "Hello World"
--------

KrishnaSantosh
Feb 9th, 2001, 06:52 PM
A Language Can Be Strongly Typed. Or Weakly Typed.

One Of The Features Of Strongly Typed Languages if That All Variables Needs To Be Declared As A Specific Data Type Before The Instance Of The Variable In That Program.

On The Other Hand In Weakly Typed Languages You Need Not Declare Variables Prior To The Use. The Type Of the Variables Will Be Determined With The Value You Provide For This.

Strong Typing Has A Lot Of Advantages Over Weak Typing.

VB Provides Strongly Typed As Well As Weakly Typed Language Features. If Option Explicit Is Not Included, The Variables Are Weakly Typed, Or Else It Is Strongly Typed.

DarkJedi9
Feb 9th, 2001, 08:21 PM
woah, lay off on the capital letters, there. :cool:

Sastraxi
Feb 10th, 2001, 08:43 AM
You can type faster if you only use capital letters some of the time. Therefore, more posts. :)

So try to lay off the capital letters and u will improve your WPM and your post #.

Of course, that's only a thought. :)