Author Topic: Custom MessageBox  (Read 4966 times)

guga

  • Moderator
  • Member
  • *****
  • Posts: 1451
  • Assembly is a state of art.
    • RosAsm
Custom MessageBox
« on: July 24, 2013, 04:14:15 AM »
I know this maybe an old thing, but i´m getting troubles creating a customizable messagebox (everything is customizable, since the background of the dialog (with colors or a bitmap), or making it be transparent, and changing the color of the static control of the main text (that can change the color text and the background color of the static and put a new bitmap on it´s background too), untill changing the colors of each button( which also can use bitmaps, changing the default text "Yes/No Cancel", changing them to Flat etc, untill setting new colors for the push button and for the background of the text itself, without changing the font format of the system)

The problem is that WM_CTLCOLORBTN works ok, but, when you pres the pushbutton, the background color remains grayed (i mean with the colors of the default system), instead coming back to the user selected color.

The technique is using by hooking the messagebox api on a similar way i did for the customizable progressbar. I´m not using the same technique as Ewayne, because on his he created his own pushbuttons, instead hooking what is already in the system. This causes the font to change, whereas hooking don´t cause this.

This i an interesting techique, because with further developments we may use it for changing the layout of any control without too much efford and without having to create new ones. For Rosasm it would be specially interesting because on this user´s can be able to build a control builder biased on the resources of a file , such as a delphi or vb one that have the controls in colors, brushes etc. This can be used when you are disasembling a delphi or VB file or simply if i create a sort of RAD for RosAsm (at least in what the concerns to the controls)

I´ll post the results i made so far once i come back home.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Custom MessageBox
« Reply #1 on: July 24, 2013, 04:44:54 AM »
i have played with custom message boxes, a lot - lol

if you want to use the system message box and change the text in the buttons - no problem

beyond that, i find that you are better off to create your own buttons if you want them to work under different OS's/themes
that's because the window hierarchy may change from OS to OS
you sometimes have a worker window between the window you want to alter and the one you get a handle for   :redface:

writing code for a button isn't all that bad - and you get to customize it any way you like


guga

  • Moderator
  • Member
  • *****
  • Posts: 1451
  • Assembly is a state of art.
    • RosAsm
Re: Custom MessageBox
« Reply #2 on: July 24, 2013, 05:36:04 AM »
Maybe...But, it seems we can use the simpler WM messages to work with with all OSes, i guess

I didn´t tested on other OSes (Since i have only XP here), but this is what i got so far











They works with themed too

The color text problem above seems to be the same one as i´m finding when i push the button.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Custom MessageBox
« Reply #3 on: July 24, 2013, 10:13:22 AM »
have someone test it under windows 7, with and without the "aero" glass theme