Results 1 to 4 of 4

Thread: Updating Window Caption Without Focus

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337

    Updating Window Caption Without Focus

    I'm using FindWindow, FindWindowEx and SetWindowText to set the caption of Window1 as I click in Window2. It works fine, except the caption does not change until I set the focus back Window1.

    What API can I use to get Window1 to refresh/redraw without putting the focus back on it?

    Dan

    Outside of a dog, a book is a man's best friend.
    Inside of a dog, it's too dark to read.

  2. #2
    jim mcnamara
    Guest
    Code:
    Private Const WM_PAINT = &HF
    
    
    Private Declare Function SendMessage Lib "user32"  _ Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As _
    Long, ByVal wParam As Long, lParam As Any) As Long
    
    SendMessage(hWnd, WM_PAINT,0&,0&,0&)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337

    Thanks

    Thanks Jim.

    I did find another way though, I hhave the window object (As VBIDE.Window) which has a SetFocus method. At first, I didn't want to use that because I thought it would shift the focus to the wrong window, but it doesn't. It just repaints it. Weird.

    Dan

    Outside of a dog, a book is a man's best friend.
    Inside of a dog, it's too dark to read.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337

    Not quite....

    Jim,

    I found my method to be a little too flickery, so I tried yours. It doesn't work, I think because WM_PAINT only updates the client area of the window.

    I had to use WM_NCPAINT (with wparam = 1) to update the caption.

    Cheers,

    Dan

    Outside of a dog, a book is a man's best friend.
    Inside of a dog, it's too dark to read.

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