Change min/max/close buttons theme - windows

im currently overiding the WM_NCPAINT, WM_NCCALCSIZE and WM_NCACTIVATE to paint my own color/themed title bar for an application im working on. Now this is working great however the min, max and close buttons still are xp default theme.
I looked into what controls them and the mouse messages do. However they also contol resizing and other functions that I dont want to lose.
Is there an easy way to just change the theme of these buttons?
Windows XP
MFC Forms
Visual studio 2005

I think your best bet here is to disable the buttons and redraw them with something akin to to the code I posted in this answer. It's in C# with WinForms, but the vast majority of it is overloaded WndProc() anyway, which you should be able to use almost copy/paste into MFC.
Implementing click handlers to do what you want them to do is trivial.
Note: The asker of that question said the code didn't work in Vista. I don't have a Vista box, but it works for me in XP.

This also helped: http://www.catch22.net/tuts/titlebar

You can also check out how it's done in MFC Next (VS2008 SP1). The theming support there does custom draw of the whole title bar, you can get a few ideas from that. I presume they tested it on Vista, too ;)

Related

What sort of GUI controls are used in Windows Resource Monitor?

I am new to GUI programming in Windows.
The Windows Resource Monitor (perfmon.exe /res) has four bars (CPU/Disk/Network/Memory) that have gradient backgrounds, as well as charts on the right for displaying recent CPU/Disk/Network/Memory usage.
I am wondering what kind of controls were used in this application. Are they readily available in C++ or in C#?
They are custom controls that are not available for external use, sorry.
You can use the Spy++ window finder tool (Spy++ is included with DevStudio) to find the window class names (and window boundaries).
http://msdn.microsoft.com/en-us/library/aa266028(v=vs.60).aspx
It shows that the overall window is a DirectUIHWND, the graphs are windows but the bars labelled CPU/Disk/Network, etc are not windows at all, the appear to be drawn directly in the resource monitors client area.
The implementation is not public for these controls, but I'm pretty sure they are incorporated using Windowless Controls.
Those bars remind me of Outlook bars. One old implementation is described in Code Project, and that one also has no windows on its own. Everything is painted inside.
Edit: That Code Project article was C# port. For C++ original go to Code Guru.

VB6 Focus Glow Effects

I have a form in VB6 with text fields and I would like to create a focus glow like you see in modern web browsers.
Is it possible to make a Glowing Effect in a Textbox using VB6.0?
Kindly give me some advice or way to accomplish this one! Thanks...
I've noticed you are asking other questions regarding modification of the visuals of your VB6 application, too, but you have to face it: VB6 is old, very old and many of the newer UI concepts are very hard to implement in VB6.
Your best shot to make your old VB6 look better is to use a set of more current controls than the original VB6 ones. (Although better look controls are no magic bullet, it's still possible to screw up the UI by making bad layout decisions, for example)
At work we have made good experiences using CodeJock to polish our UI, but even the latest version (15.0.2 at this time) doesn't have a glow effect for text boxes.
You can enable the text box "glow" in Vista/7 by using a manifest. This manifest creator will handle some of the dirty work for you. Note that the effect will only appear in your compiled app, not running from within the IDE.

Preview Handlers (Office 2007, Vista & Win7) - issue w/ reisize

Greetings,
I'm working on a preview handler for Office 2007, Vista and Windows 7. I'm basing my code off the following
MSDN article.
The "guts" are done as it was pretty straight forward. I've been testing in Windows 7 (64-bit) Explorer. One thing I've noticed is the preview handler appears to "lock" the Explorer window and doesn't allow it to resize.
My handler derives from FileBasedPreviewHandler, the Control from FileBasedPreviewHandlerControl. The #Load override simply does:
MyViewer viewer = new MyViewer();
viewer.Dock = DockStyle.Fill;
viewer.SetFile( file.FullName );
Controls.Add( viewer );
A couple things I've tried, a variety of times is to set, in the design view, the AutoSize and AutoSizeMode to true and GrowAndShrink
Now, the funny thing, i swear it worked once. Now, I can't get it to work at all.
If anyone has any input, that would be great. I think I posted all the relevant info, but if I missed something vital, let me know. I appreciate your attention to this question.
-Cheers!
Apparently, by setting the AutoSize and AutoSizeMode as state above, does work. Explorer is simply temperamental. What I found was if you get strange behavior, you can use task manager to close the explorer process than relaunch it.
For the record, what I found works 99% of the time is to to:
make sure all Explorer windows areclosed (w/ preview panel off)
unregasm/remove from ga
build
add to gac/regasm
run Explorer and check preview panel
rinse & repeat
I'm also using a throw-away win forms app to test changes that don't involve the integration.
Hope this helps someone looking.
-Cheers!

VB6: enabling mousewheel for controls

can someone tell me if there's an easy way to enable mousewheel for controls (in runtime)?
i want to use the wheel for scrolling controls as soon as the mouse is over them.
thx
Karl E Peterson shows how to make any control respond to the mousewheel in this nice article in Visual Studio Magazine, with VB6 code you can just drop into your project.
Have you looked at this vbforums example code: Enabling MouseWheel Support with any control
Ref.
One very easy way is to install VBScroll by Shahin Gasanov. This is to enable scroll bars in the VB6 IDE. Even if that's no what you meant by 'the runtime' then it's worth having anyhow ;)
This solution works fine for me. Method 1 http://support.microsoft.com/kb/837910

Screenshot of window

I'm trying to take screenshots of all open windows, also the minimized ones. Currently I'm using this code:
http://www.developerfusion.com/code/4630/capture-a-screen-shot/
But it doesn't work for minimized windows and the areas where there is a Glass effect since Vista like the explorer title bar are black. Can anyone help me out?
My objective is to create something similar to Flip 3D; it would be great if someone also knew something about how to create a live preview.
For the glass effect areas: I think it doesn't work because those areas may be drawn with some strange DirectX method instead of normal GDI.
For the minimized windows problem: if a window is minimized, its DC isn't painted (conceptually, it doesn't even have a reason to exist); you should try to send to such windows a WM_PRINT message, asking them to paint themselves on the DC you'll provide them. The problem with this approach is that not all the windows handle correctly WM_PRINT.
I've found the API that is used for the taskbar previews a.s.o.:
DWM Thumbnail Overview
Pretty awesome, it even allows you to do live previews!

Resources