|
-
Nov 30th, 1999, 10:42 AM
#1
Thread Starter
Lively Member
Does Anyone Have A Code To Keep Your Program On Top? I Mean So That When They Switch Windows Your Program Is Still In Say One Corner Or Where Ever They Left It???
Also How Would You Get An App To Search a Text File For A Certain Field It Is Looking For, As In Only Add The Text From Certain Place In The Text File???
Also How Do You Get An App To Search Your Hardrive For A Certain File?
-
Nov 30th, 1999, 05:47 PM
#2
New Member
Use the following code in the form.
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 Const SWP_NOMOVE = 2
Private Const SWP_NOSIZE = 1
Private Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Sub Form_Load()
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS
End Sub
-
Nov 30th, 1999, 08:06 PM
#3
Hyperactive Member
If you would search this UBB you would have found this answer. http://www.vb-world.net/ubb/Forum1/HTML/010710.html
Serge's code give you a property, MakeOnTop, that you can set and then you don't have to mess around with SetWindowsPos.
But it uses the same code as aditya has written
------------------
On Error Goto Bed :0)
[email protected]
[This message has been edited by onerrorgoto (edited 12-01-1999).]
-
Nov 30th, 1999, 09:20 PM
#4
Lively Member
you could also do this...a little easier than serge's code and no messing with SetWindowPos
Code:
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 Const SWP_NOMOVE = 2
Private Const SWP_NOSIZE = 1
Private Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Function MakeOnTop(frm as Form)
SetWindowPos frm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS
End Function
Private Sub Form_Load()
MakeOnTop Me
End Sub
--michael
[This message has been edited by funkheads (edited 12-01-1999).]
[This message has been edited by funkheads (edited 12-01-1999).]
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
|