a set of vb4.0 ?'s 
Author Message
 a set of vb4.0 ?'s

I have two ?'s

1)  How do i assign a form to "stay on top" even though it is not active?

2)  How do i assign vb to play a .wav file whenever i click on a command
button or open the program?

                                              T.I.A.
                                           ---Mike---

                           __

   -------------------^^^--\/--^^^-------------------
also, tell me if this signature looks right to you......



Sun, 30 Aug 1998 03:00:00 GMT  
 a set of vb4.0 ?'s

Quote:

>I have two ?'s
>1)  How do i assign a form to "stay on top" even though it is not active?
>2)  How do i assign vb to play a .wav file whenever i click on a command
>button or open the program?
>                                              T.I.A.
>                                           ---Mike---
>                           __

>   -------------------^^^--\/--^^^-------------------
>also, tell me if this signature looks right to you......

Here's what the VB knowledge base help file (Vbknowlg.hlp) says.

Summary:

You can create a "floating" window such as that used for the Microsoft
Windows version 3.1 Clock by using the SetWindowPos Windows API call.

More Information:

A floating (or TOPMOST) window is a window that remains constantly
above all other windows, even when it is not active. Examples of
floating windows are the Find dialog box in WRITE.EXE, and CLOCK.EXE
(when Always on Top is selected from the Control menu).

There are two methods to produce windows that "hover" or "float," one
of which is possible in Visual Basic for Windows. This method is
described below:

Call SetWindowPos, specifying an existing non-topmost window and
HWND_TOPMOST as the value for the second parameter (hwndInsertAfter):

Use the following declarations:

Declare Function SetWindowPos Lib "user" (ByVal h%, ByVal hb%,
        ByVal x%, ByVal y%, ByVal cx%, ByVal cy%, ByVal f%) As Integer
' The above Declare statement must appear on one line.

Global Const SWP_NOMOVE = 2
Global Const SWP_NOSIZE = 1
Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Global Const HWND_TOPMOST = -1
Global Const HWND_NOTOPMOST = -2

To set the form XXXX to TOPMOST, use the following code:

success% = SetWindowPos (XXXX.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
REM success% <> 0 When Successful

To reset the form XXXX to NON-TOPMOST, use the following code:

success% = SetWindowPos (XXXX.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)

REM success% <> 0 When Successful

Note: This attribute was introduced in Windows, version 3.1, so
remember to make a GetVersion() API call to determine whether the
application is running under Windows, version 3.1.



Tue, 01 Sep 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. a set of vb4.0 ?'s (simple)

2. VB4 - can't set print font or size

3. Can't set the .Tag for a form (VB4) - Testform.zip (0/1)

4. Can't set the .Tag for a form (VB4) - Testform.zip (1/1)

5. VB4 -ODBC-Jet 3.0 - Can't set Parameters

6. Printer Object VB4 still don't set Font Size - PLEASE HELP

7. Record Set Guru's - Can't Create Record Set error 429

8. Record Set Guru's - Can't Create Record Set error 429

9. setting all foreground and bkground colors to use window's current color setting

10. Don't understand 'Set'

11. Russian(Cyrillic): vb4 32-bit works, but vb4 16-bit doesn't

12. Setting the 'From' field

 

 
Powered by phpBB® Forum Software