WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
What is FASM G
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
Pages (2) [1] 2   ( Go to first unread post )

Changing Background color in a XP Style Button, Changing Background color in a XP Style Button

Danychip
Quote Post


New Member
*

Group: Members
Posts: 4
Member No.: 26205
Joined: 3-September 09


Sponsored Links
Hello to everybody,
using MASM32 I have made a simple window with an XP Style button to understand how to controls the various properties of it.
I have spent a lot of time in trying to change the background color of this button because it appears with a white frame around as showed in the attached file.

Is there anyone who knows how to do it?

Thank you in advance for your help.


Attached Image
Attached Image
PMEmail Poster
Top
ragdog
Quote Post


Extremely Active Member
******

Group: Moderators
Posts: 892
Member No.: 5019
Joined: 13-May 07


Hi

Yes this works with ButtonEx control
This Lib is from CObject and works fine


greets,
ragdog

Attached File ( Number of downloads: 169 )
 Login or Register to download
PMUsers Website
Top
Danychip
Quote Post


New Member
*

Group: Members
Posts: 4
Member No.: 26205
Joined: 3-September 09


Hello ragdog,
thank you very much for your reply and for your important help.
I went thrugh the asm code you attached and I found full reconstruction of the buttons behaviours. This is great because I can learn many things about windows controls.
In my simple code I haven't used the dialog window construction but the CreateWindowEx function for the window creation. Attached you can find the source code.
I think that there is a simplest way to obtain the white frame around the XP Style Button to be in the same color of the window background.
Looking to the MSDN I found that when an XP Style Button is being used in a window, the NM_CUSTOMDRAW notification should occurs to the parent window procedure. If this happen then many button behaviours can be controlled.
I have spent a lot of time to find out the way to obtain this notification without result.
I know that I'm making something wrong but I don't understand what.
Can you give me any help about?
Thank you in advance.
Danychip

Attached File ( Number of downloads: 69 )
 Login or Register to download
PMEmail Poster
Top
Danychip
Quote Post


New Member
*

Group: Members
Posts: 4
Member No.: 26205
Joined: 3-September 09


Dear ragdog,
still me.
I would like to tell you that I have found the solution on my first question.
I have handled the NM_CUSTOMDRAW notification and I have invoked the DrawThemeParentBackground function to have the gray frame beside the button to be in the same color of the window background.
Below is showed the result.
I'll write another answer to attach the source code.
Thank you again for your kind help.
Danychip

Attached Image
Attached Image
PMEmail Poster
Top
Danychip
Quote Post


New Member
*

Group: Members
Posts: 4
Member No.: 26205
Joined: 3-September 09


Here is the source code.


Attached File ( Number of downloads: 139 )
 Login or Register to download
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (2) [1] 2  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google