Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / DBC: Color Selection Dialog Box (Windows API)

Author
Message
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Nov 2006 12:44 Edited at: 24th Dec 2006 20:05
[EDIT - Update]

I've modified the code somewhat, changed and repositioned a couple of functions, and corrected a couple of bugs.

For this to work properly, your application has to have SET WINDOW ON and it also has to have a window title that the color dialog box can reference. Here's the updated example code and functions:



[Old ]
Here's a function to use the Windows color selection box where you can click on a color and use the color in your DBC application. I think it will probably work in DB Pro too.

For DBC, you have to have your app SET WINDOW ON before the function is called. Without that, you won't see the dialog box and it will appear as if your application is not responding - it is responding but it's just waiting for you to select a color from an invisible dialog box!

This code contains an example of what variables to set up ahead of time and 2 additional functions . Part of the example creates a cube whose color can be changed using the dialog.

Let me know if there are any problems.




Enjoy your day.
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 24th Dec 2006 13:05
I had to replace these lines


which would appear to be missing the slashes for some reason with



Worked very well apart from that, nice one.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 24th Dec 2006 20:08
Thanks for catching that Robot!

Everytime I edit a post, the slashes disappear. I always forget that I have to re-edit it to put the slashes back. I don't know why that happens.

Thanks again!

Enjoy your day.
Gamers for sale
19
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 1st Jan 2007 05:55
Wow, you have gone into the world of windows api! I know a few things about it that I can show you if you like. I have several windows api functions documented and functional.

I have just released Dark World beta!

I also have a question if you can get to it about application communication.

GFS

Your signature has been erased by a mod because it's larger than 600x120
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 2nd Jan 2007 05:45


I do have a question about winapi menus. I can actually get them to work, but it is a bit buggy. The hardest part is getting the proper WM_COMMAND. I have to use a work around but I'd prefer not to. In the end, it seems simpler just to make my own menu program - unless you have some ideas...

Enjoy your day.
Gamers for sale
19
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 2nd Jan 2007 22:31
Yah, I do have an idea. If you search for api guide it has a list of functions. It has a list of useful functions.

citybee
17
Years of Service
User Offline
Joined: 27th Jan 2007
Location:
Posted: 28th Jan 2007 06:03
my dungeon has been having a lot of problems and i need help figuring out why.



thx

Login to post a reply

Server time is: 2024-11-22 23:06:29
Your offset time is: 2024-11-22 23:06:29