The MASM Forum

Projects => MASM32 => Topic started by: hutch-- on August 15, 2014, 07:28:54 PM

Title: Download fixed version of Getcolor.zip
Post by: hutch-- on August 15, 2014, 07:28:54 PM
I had never been able to duplicate the problem in the past but with a new installation of XP on my XP dev box, the app would not start. Problem was simple, on some versions of Windows, if you have a manifest file, you must also include the common control library. Added the line of code and BINGO, it seems to be working fine.
Title: Re: Download fixed version of Getcolor.zip
Post by: guga on August 16, 2014, 12:31:53 PM
Excelent little app steve !

No src ?
Title: Re: Download fixed version of Getcolor.zip
Post by: hutch-- on August 16, 2014, 01:35:06 PM
Guga,

I will get around to posting it, its very simple API code but tolerate me at the moment, I am up to my eyeballs in work cleaning up an ancient mess my young brother left behind 25 years ago.
Title: Re: Download fixed version of Getcolor.zip
Post by: Gunther on August 16, 2014, 09:08:23 PM
Steve,

Quote from: hutch-- on August 16, 2014, 01:35:06 PM
I will get around to posting it, its very simple API code but tolerate me at the moment, I am up to my eyeballs in work cleaning up an ancient mess my young brother left behind 25 years ago.

Good luck. Nice application.  :t

Gunther
Title: Re: Download fixed version of Getcolor.zip
Post by: hutch-- on August 18, 2014, 09:12:57 PM
Voila, the SAUCE.  :P
Title: Re: Download fixed version of Getcolor.zip
Post by: Gunther on August 19, 2014, 05:11:17 AM
Well done.  :t

Gunther
Title: Re: Download fixed version of Getcolor.zip
Post by: guga on September 06, 2014, 08:55:36 AM
Many thanks steve :t

May i use it in RosAsm ? I plan to modify a bit to allow showing the colors on a RGB macro form. Simple tools like this are excellent for usage on a Assembly Platform. No only in RosAsm, but in Radasm too will be usefull, i think.
Title: Re: Download fixed version of Getcolor.zip
Post by: hutch-- on September 06, 2014, 01:35:25 PM
Hi Guga,

Its simple API code so you are more than welcome to write your own version of it in RosAsm. When you get it done, post it so we can see what you have done with it.
Title: Re: Download fixed version of Getcolor.zip
Post by: Gunther on September 06, 2014, 09:11:29 PM
Hi Gustavo,

nice idea. Go forward, I'm curious.

Gunther
Title: Re: Download fixed version of Getcolor.zip
Post by: guga on September 07, 2014, 10:31:29 AM
Tks guys. I´m quite finishing it.

I need some examples of RGB macro for PowerBasic, for Masm, and for C.(I presume when you meant "Basic", you were referring to PB, right, Steve ? )

I found some for C and Masm, but i´m not sure about the syntax. Regarding to PowerBasic, i didnt found a valid RGB macro, only RGBGet Values (Retrieving red, green or blue from a  RGB)
Title: Re: Download fixed version of Getcolor.zip
Post by: guga on September 07, 2014, 05:32:36 PM
Here goes the tests i make.

There are a couple of issues i coulnd´t fix. Example i wanted to change the font and color of the controls like buttons and the static controls to make them look the same as i did for the RTF. But so far, i idn´suceed to make the font works equal.

Also, i´ll probably add an icon of a target at the lower left corner, and try to make the window vanishes when the brush is hovering near by it.

On the zip file i uploaded the exe (with the source code embeded) and also the source code separately for those who don´t have RosAsm installed.

If the font be reduced satisfatorily i´ll try to add a colorwheel on it too and perhaps at the bottom i´ll ad the corresponant gray value/color related o the picked color.

Btw. I couldn´t find the definition of the macro RGB for PowerBasic. Steve, how is the syntax for PB ? I mean, how the macro RGB is written ?

(http://i57.tinypic.com/eziofc.jpg)
Title: Re: Download fixed version of Getcolor.zip
Post by: hutch-- on September 07, 2014, 11:54:36 PM
Hi Guga,

Compliments, it works fine. Just a suggestion, you have created the app using CreateWindowEx() instead of a resource dialog so you need to set the font for all of the controls so that they display correctly, on my Win7 64 the fonts in the controls are too large and look a but clumsy, if you use,


SendMessage hCtrl,WM_SETFONT etc ....


You can set either a system defined font or with a bit more work a true type font to get the correct appearance.
Title: Re: Download fixed version of Getcolor.zip
Post by: ragdog on September 08, 2014, 01:57:47 AM
Thanks Hutch for share yor code :t
Title: Re: Download fixed version of Getcolor.zip
Post by: Gunther on September 08, 2014, 03:14:48 AM
Hi Gustavo,

works fine here. Thank you.

Gunther
Title: Re: Download fixed version of Getcolor.zip
Post by: Siekmanski on September 08, 2014, 06:37:21 AM
Hi hutch and guga,
They both work fine here ( win 8.1 64bit )
Title: Re: Download fixed version of Getcolor.zip
Post by: guga on September 08, 2014, 07:50:14 AM
Hi Steve, Thanks...i`ll give a try on the fonts.

One question, it is better setting them with CreateFontIndirect ?

I tried before with CreateFont, but it seems to not work :(
Title: Re: Download fixed version of Getcolor.zip
Post by: guga on September 08, 2014, 08:21:57 AM
Ok, i found out why it didn´t worked before with CreateFont

I did the same thing as in RTF font structure. The probelm is that when seting fonts to a RTF control, i can delete the font object on the same routne, i mean, i don´t need to deletet it after WM_CLOSe is clicked.

But, for other controls, i can´t use deleteobject on the same routine. The fonts for the controls must be deleted when the user closes the App.

I´ll try to make a routine for common controls that can set the color, font, and background of the controls on the sam way s i did for the RTF, with the difference that the user must delete the object once his app is closed.

Ill give a try.

And probably my function SetRTFFont works for both EditControls and RTF controls as well.I´ll test SetRTFFont on a regular editcontrol to see if it works the same way as in RTF
Title: Re: Download fixed version of Getcolor.zip
Post by: dedndave on September 08, 2014, 10:07:26 AM
i sometimes use GetObject or SystemParametersInfo(NONCLIENTMETRICS) to fill a LOGFONT structure
then modify the structure, as desired, and call CreateFont   :P
Title: Re: Download fixed version of Getcolor.zip
Post by: Gunther on September 08, 2014, 10:13:37 PM
Hi Marinus,

Quote from: Siekmanski on September 08, 2014, 06:37:21 AM
Hi hutch and guga,
They both work fine here ( win 8.1 64bit )

Are you happy with Windows 8.1? Is it worth to upgrading?

Gunther