How to customize buttons?

Pages: 12
Hi,

I have created some buttons on my main window as well as in dialog-boxes.
But these buttons are looking like Windows 98(I mean the style).

The problem occurs also for menu, dialog boxes etc.,

What should I add in my code to make my buttons,menu, etc., look like windows 10 one.

By the way, I am using a Windows 10 PC

Thank you
Last edited on
What libraries are you using? And more importantly, what code are you using? It is hard to tell the problem now, since it could be anything.
Hi,
I have not added anything to change the look.
Sorry my English is bad so I try to explain everything briefly,

I referred my book(hard copy) to gain knowledge but the code is quiet older so I updated my knowledge by referring the msdn documentation.

I have coded as specified in the msdn to my compiler(Visual Studio 2015).

Everything works fine but looks quiet very ugly.

So could you please give me some links, codes to add something to make my program a fair look.

Thank you

What code exactly are you using? Could you give a short example that represents the problem. It's fairly hard to find the problem when there's no code provided.

The only thing I can think of is that you are using a manifest for an older windows version. Try taking a look at https://msdn.microsoft.com/en-us/library/bb773187%28VS.85%29.aspx. It addresses how to use different visual styles, which might give you a clue as to how to change the visuals.
Normally Visual Studio will pick the right manifest. Did you create the project yourself or copied from somewhere else?
Try to create a new project in VS and paste your code in. It might make a difference.
@ Shadowwolf & Thomas1965

Kindly consider the about box(Dialog box) created by Visual studio on its own I just converted into modeless so why does it looks old??
1
2
3
4
5
6
7
 case IDM_ABOUT:
               // DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
				 about = CreateDialog(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
				 if (about != NULL) {
					 ShowWindow(about, SW_SHOW);
				 }
                break;



Here is the resource file
1
2
3
4
5
6
7
8
9
10
IDD_ABOUTBOX DIALOGEX 100, 50, 190, 91
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "About"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
  
    LTEXT           "About",IDC_STATIC,8,52,166,14
    DEFPUSHBUTTON   "OK",IDOK,130,70,50,14,WS_GROUP
END


It looks like window 98 ??
Last edited on
I agree it looks quite old-fashioned on my Windows 7.
@Thomas1965

What should I do now?
Is there any code to do this??
Any ideas, help?

Thank you
@ Thomas1965

As you have already suggested me this(In my different question) for menus I tried that too which makes my program to look still uglier.

In windows 10 buttons look like "tiles" consider default calculator came along with windows when I see its buttons I can see no difference between its main window and the numerical buttons.This is how every windows 10 apps looks like.
Even when I use BS_FLAT in the style of my buttons that is not even a near worthier
like the real windows 10 desktop applications.
Buttons are not my only problem, Even my progress bar, check boxes will also look like windows 98. How can I can that for all.

It is like re-inventing the wheel! Even if I draw for all the things a simple resource editor will find all my stuffs on buttons and thus reveals the truth
Thank you for your reply.
Any suggestions?
Honestly, I am running out of ideas. Since I don't have Windows 10 I can't try anything myself.
If you have MFC available on your VS version you could try to build a quick dialog based app and drag some controls on it and see if it looks different.
Another option would be to give C++/CLI a try.
@Thomas1965
Could you please give me your code so that I can make my buttons to look like windows 7 at least.
Thank you for your help!
closed account (E0p9LyTq)
@V07,

You might want to take a look at this:

Creating a UI
https://msdn.microsoft.com/en-us/library/windows/apps/br211362.aspx

and this:

Design UWP apps
https://dev.windows.com/en-us/design
@V07

you got a PM.
@FurryGuy

Sorry for a late reply.

Should I learn HTML??

Thank you
closed account (E0p9LyTq)
By the look of the way Windows app programming is going you should look into Microsoft's variant of XML, XAML.

Win32 API programming is tied very tightly to desktops, the Windows Runtime framework looks to be designed to create apps that run on different platforms without any changes.

I am someone that personally prefers the Win32 API, but I know that is going the way of OS/2 and the Amiga.
@FurryGuy

Could you please explain me more details on how to make my program look like Windows 10

should I add an xml file to my project?
How I did that in VStudio6:

1. Create a file named "vo7.manifest" (change "vo7" to your application name), save it in the \res\ subfolder of your project folder

2. After building the application, run the following commands (replace "vo7" with your EXE file name and manifest file name):

1
2
set path="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin";%PATH
mt.exe -manifest shop\res\vo7.manifest -outputresource:Release\vo7.exe;1


3. Under win10, it will look like win10 application :)

Now I checked my VS2010 projects and looks like it is not necessary anymore, but maybe in your case this will help...

The contents of the manifest file should be:
-------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
<assemblyIdentity 
version="1.0.0.0" 
processorArchitecture="X86" 
name="vo7app.Common-Controls" 
type="win32" 
/> 
<description>vo7app description</description> 
<dependency> 
<dependentAssembly> 
<assemblyIdentity 
type="win32" 
name="Microsoft.Windows.Common-Controls" 
version="6.0.0.0" 
processorArchitecture="X86" 
publicKeyToken="6595b64144ccf1df" 
language="*" 
/> 
</dependentAssembly> 
</dependency> 
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">,
  <security>,
  </security>,
</trustInfo>,
</assembly> 

----------------------------------------------------------
Free report designer tool for C++ developers
http://www.oxetta.com
@sushko

Thank you for your reply,

"set path="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin";%PATH
mt.exe -manifest shop\res\vo7.manifest -outputresource:Release\vo7.exe;1"

Where to run this command??

Do you mean to run this on command prompt
Yes, I mean that you run this command from the command prompt.

Actually, I compile the debug version without adding the manifest (without running this command) many times per day, and when I compile the release version to send it to the test engineers or to the users (once a week or something like that), I compile the application with a .BAT file which not only compiles the release version and copies all necessary files (release .EXE, database file, etc.) to one folder, but also runs that command that adds the manifest to the release EXE.
----------------------------------------------------------
Free report designer tool for C++ developers
http://www.oxetta.com
Pages: 12