Results 1 to 2 of 2

Thread: Refreshing a modeless window

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    1

    Question Refreshing a modeless window

    Hi,

    How do I stop a window from coming to the foreground whilst refreshing it.
    I have a modeless form open while I am working on my main application. Depending upon the options clicked in the main application I need to refresh the option buttons and load some pdfs in the modeless form. Whenever I try to do this the modeless window comes to the foreground.
    i tried using,
    frmmodeless.show vbmodelesss , Me
    but this didn't help.

    Any solutions?

    thanks

  2. #2
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    Did you try with SetWindowPos?

    VB Code:
    1. Const HWND_TOPMOST = -1
    2. Const HWND_NOTOPMOST = -2
    3. Const SWP_NOSIZE = &H1
    4. Const SWP_NOMOVE = &H2
    5. Const SWP_NOACTIVATE = &H10
    6. Const SWP_SHOWWINDOW = &H40
    7. Private 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)
    8.  
    9. Private Sub Form_Activate()
    10.     'KPD-Team 1998
    11.     'URL: [url]http://www.allapi.net/[/url]
    12.     'E-Mail: [email][email protected][/email]
    13.     'Set the window position to notopmost
    14.     SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
    15. End Sub
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width