|
-
Oct 13th, 2000, 11:22 AM
#1
Thread Starter
Hyperactive Member
how can I force a window in my app to stay on top of all other windows in the same app, sort of like a floating toolbox kinda thing??
-
Oct 13th, 2000, 12:05 PM
#2
Frenzied Member
To Stay On Top On Top put this when your app loads.
Code:
SetWindowPos hwndofthewindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_FRAMECHANGED Or SWP_NOMOVE
-
Oct 13th, 2000, 01:25 PM
#3
And of course, to do this, you will need the api function and flags as well.
Code:
Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos"_
(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
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
-
Oct 14th, 2000, 04:31 AM
#4
Frenzied Member
Sorry for not including the API declaration and the constants but i haven't written code in VB for a month.I am using VC++ right now and in VC++ these things don't have to be declared.
-
Oct 14th, 2000, 08:36 AM
#5
If the Constants are small numbers like 1, 2, -1 etc. I usually do not bother including them.
-
Oct 14th, 2000, 09:13 AM
#6
transcendental analytic
Why not? What if you don't remeber what the constants actually mean?
Actually i usally skip the constant declarations myself, but that doesn't mean small flags and large flags differ, flags are flags.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|