|
-
May 25th, 2000, 12:40 AM
#1
Thread Starter
Hyperactive Member
Hi, how can I redraw my window's title bar? I have a foreign window tied to my navigational window. The foreign window doesn't have a title bar -- so when it has focus, I want to make my window appear to have focus. I'm using subclassing and can detect when the user is in this foreign window, but what I'm using to redraw my window's title bar blue isn't working:
Code:
Option Explicit
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
Private Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
Private Const COLOR_ACTIVEBORDER = 10
Private Const WM_NCACTIVATE = &H86
If msg = WM_NCACTIVATE Then 'Foreign Window Activation/Deactivation
If wp = 1 Then 'Has focus
'Get Device Context of My Window Including Non-client Area - This Works
lhDC = GetWindowDC(Form1.hwnd)
'Set Background Color of Title Bar - This Doesn't Seem to Change Anything
Call SetBkColor(lhDC, GetSysColor(COLOR_ACTIVEBORDER))
'Release DC to My Window
Call ReleaseDC(Form1.hwnd, lhDC)
End If
End If
-
May 25th, 2000, 01:04 AM
#2
PowerPoster
Try this:
Code:
Public Declare Function FlashWindow Lib "user32" Alias "FlashWindow" (ByVal hwnd As Long, ByVal bInvert As Long) As Long
FlashWindow Me.hWnd, 1 'or even 0
-
May 25th, 2000, 01:36 AM
#3
Thread Starter
Hyperactive Member
Thanks Fox. I'd like to use FlashWindowEx so that the taskbar button isn't also flashed, but that's not supported in NT4. Know if there's any way to keep the taskbar button from flashing?
Thanks again.
[Edited by WadeD on 05-25-2000 at 02:42 PM]
-
May 25th, 2000, 03:17 AM
#4
PowerPoster
Erm, only this one: 
Code:
frmMain.ShowInTaskbar = False
No, sorry, can't help you. I think there's no way without subclassing this button (and don't ask me how to do that )
-
May 25th, 2000, 04:50 AM
#5
Thread Starter
Hyperactive Member
Thanks for the help, Fox.
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
|