Jan 8th, 2007, 01:08 AM
#1
Thread Starter
Lively Member
always on top
i am using SetWindowPos function to set my application on top but my form starts flashing for 2-3 times when loads(may be other app try to get focus) how can stop my form from flashing?
i am using these values
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
Jan 8th, 2007, 01:14 AM
#2
Re: always on top
Have you tried just loading the form as vbModal until the user does whatever they need to?
Jan 8th, 2007, 01:20 AM
#3
Thread Starter
Lively Member
Re: always on top
yes i am loading the form as vbModal.
Jan 8th, 2007, 05:08 AM
#4
Thread Starter
Lively Member
Jan 8th, 2007, 05:16 AM
#5
Re: always on top
can you show the code in loading proc..
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
Jan 8th, 2007, 05:41 AM
#6
Thread Starter
Lively Member
Re: always on top
everything is fine but after flashing for 2-3 sec my form lost it's focus. Is there any way so that my form always load in focus?
Last edited by xor83; Jan 8th, 2007 at 05:46 AM .
Jan 8th, 2007, 05:55 AM
#7
Re: always on top
But you dint show us the code to analyse...anyway check the attached zip file to load a form as Always on Top....
Attached Files
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
Jan 8th, 2007, 07:16 AM
#8
Thread Starter
Lively Member
Re: always on top
there is no problem with always on top code i want my app to be always in focus.
Jan 8th, 2007, 12:03 PM
#9
Hyperactive Member
Re: always on top
Try this:
VB Code:
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Public Sub ActivateWindow()
With FrmMain
If Not .Visible Then .Visible = True
.WindowState = vbNormal
BringWindowToTop .hWnd
SetWindowPos .hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
SetWindowPos .hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End With
End Sub
Jan 9th, 2007, 12:08 AM
#10
Thread Starter
Lively Member
Re: always on top
no help ... app doing the same thing
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