|
-
Nov 15th, 2001, 03:11 PM
#1
Thread Starter
Member
Form 'Flash' after msgbox
Help!
Has anyone ever found that sometimes after a messagebox is called, the Form that called the box flashes as it is refreshed? This is causing some problems in my POS system, as if there is another open program, then its window will be set to topmost instead of my app's. Does anyone know how to get around this? At the moment I use Me.SetFocus after the MsgBox command to make my app topmost, but this still makes the form flash and another window take its place as topmost.
Any suggestions? Thanks 
VbAndersonIC
-
Nov 15th, 2001, 03:18 PM
#2
Lively Member
not too sure what your getting at but theres some code that keeps your window on top, always!
Let me go dig it out!
In form_load:
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
In declarations:
Declare Sub 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)
-
Nov 15th, 2001, 03:18 PM
#3
Have you considered displaying your message in a status bar rather than a message box?
-
Nov 15th, 2001, 04:06 PM
#4
Thread Starter
Member
Thanks for the replies. I have already considered using the SetWindowPos API to keep my form on top, but this code will also prevent the user from seeing the msgbox, so I would have to set it to HWND_NOTOPMOST, call the msgbox, then reset it back to HWND_TOPMOST each time. I will try this, see if its any good 
Yeah, I could use a status bar or custom form, I was thinking about that too. That may be the answer if the above doesnt work.
Thanks very much guys! Much appreciated 
VbAndersonIC
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
|