|
-
May 13th, 2000, 03:18 AM
#1
Thread Starter
Junior Member
I have an app i am making that is supposed to make itself small and dock in the upper right of the screen, its supposed to bring itself tot he top every 500 milsec by using
form1.zorder
now this works when I test it running in visual basic itself, but once I make it into an exe it doesnt come to the top AT ALL!!!! please help!!
-
May 13th, 2000, 03:28 AM
#2
What OS are you using/targeting ?
-john
-
May 13th, 2000, 06:56 AM
#3
Thread Starter
Junior Member
win 9x primarily. Eventually i hope to make a win2k and me version
-
May 13th, 2000, 08:09 AM
#4
With ZOrder you put your form at the top or bottom of the forms of your application.
It seems to me you want to keep your form as the topmost window systemwide. To do this use the API function SetWindowPos with HWND_TOPMOST as parameter. Search this forum for examples. There must be plenty. If you don't find them tell me, and I will post one.
-
May 13th, 2000, 11:17 AM
#5
Member
Maybe the form is there, but not on "top". Try the following.
Add the following code to a .bas file in the project. (A new .bas file can be added by selecting a new "module". Make sure you right click on the new module and "save as" into the working directory.)
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
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
When you want, for example, Form1 visible and on top of all screens, use the following code
success% = SetWindowPos(Form1.hWnd, HWND_TOPMOST, 0, 0, 0, 0, flags)
When you want Form1. on the bottom, use
success% = SetWindowPos(Form1.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, flags)
-lp
-
May 14th, 2000, 08:59 PM
#6
The reason I asked about your OS
I think I read somewhere that under 95/nt4 SetWindowPos will bring the window to the top, but under win 98/nt5 it will just flash on the task bar. Is this true? (i haven't tried it)
[Edited by RoyceWindsor1 on 05-15-2000 at 10:20 AM]
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
|