• Welcome to Valhalla Legends Archive.
 

How to enable|disable a dialog item (c++) *Solved

Started by LordVader, March 06, 2005, 05:19 PM

Previous topic - Next topic

LordVader

Building up my dialog in my bot, so far im able to handle check boxes and combo boxes altering states, and adding data where needed..

One thing I can't seem to find searching msdn/google/here is how to send a message to a specific dialog item, to disable/enable it..

Example when a user clicks..
Diablo II: Lord of Destruction <-- A button in my dialog..
I wish to send a message to the edit box item IDC_CONFIG_CDKEY2, to enable it.
So I can bring it from a disabled gray stay to an active state and the reverse also to disable it again when D2XP is not the selected client.

I'm assuming a sendmessage, or senddlgitemmessage to accomplish this, but unsure of the paramaters to send to enable|disable.
MF_ENABLED or BM_ENABLED maybe sent in WPARAM|LPARAM?

*Edit Problem solved:

EnableWindow(IDC_CONFIG_CDKEY2,true); //enables
EnableWindow(IDC_CONFIG_CDKEY2,false); //disables

Just place where you need to toggle things in your WM_INITDIALOG & WM_COMMANDS good deal.

*Edit fixed typo: goodle!  :P
  to google heh

Maddox

Windows GUI programming is crap. I find GTK much more intuitive.
asdf.

LordVader

I've not thought about that, is GTK platform independant and can be used in visual studio, just include core files?

If so ill look into it..

I've looked into boost, and also wxWidgets so far been thinking about trying to shift into something like that.

Maddox

Quote from: LordVader on March 07, 2005, 10:50 AM
I've not thought about that, is GTK platform independant and can be used in visual studio, just include core files?

If so ill look into it..

I've looked into boost, and also wxWidgets so far been thinking about trying to shift into something like that.

yes, yes, and yes for GTK. There is a windows GTK skin as well for those wanting their GTK apps to look like windows ones. There are GTK libraries for .NET also and glade can be used to build user interfaces.

wxWidgets is also a viable option, but you lose a lot of the advantages of using the GTK API when you use it.
asdf.

K

Quote from: LordVader on March 07, 2005, 10:50 AM
I've looked into boost, and also wxWidgets so far been thinking about trying to shift into something like that.

boost doesn't have a gui library. Qt is also going to be available for free (soon) on Windows.  You can already get Qt free on *nix.