|
-
May 7th, 2000, 04:29 AM
#1
Thread Starter
Member
Hi!
Is there any way to make my vb6 application to stay always fake-active (not always on top)...I mean the window looks like it would be active (coloured titlebar) but other programs work normally, like my app wouldn't always be active....
RubbeBubbe
-
May 7th, 2000, 05:22 AM
#2
Addicted Member
Hello again, just to straighten this out, are you aware of
the API and how to implement it? If you are not then check
out the tutorials on the main page of this site to get you
familiar with it. Anyways, to answer your question, place
this code in the Form that you want to always be "in focus"
(known as being always on top, or as the top-most window):
Code:
'Place these in the General Declarations section of your Form.
Private Const HWND_TOPMOST As Long = -1
Private Const SWP_NOSIZE As Long = &H1
Private Const SWP_NOMOVE As Long = &H2
Private Declare Function SetWindowPos _
Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Sub Form_Load()
'This API call makes your App to be the top-most Window.
Call SetWindowPos(Form1.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE)
End Sub
Dan PM
Analyst Programmer
VB6 SP3 (also VB4 16-bit sometimes  )
-
May 24th, 2000, 10:01 PM
#3
Hyperactive Member
Anyone know how to keep your titlebar colored to appear to have focus even when it doesn't? This is something I need also. SonGouki's code keeps your window on top but that doesn't sound quite like what lkivik was looking for.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|