Sign in to follow this  
emforce

buttons

Recommended Posts

hi guys i am just starting directx 10 programming and have an app that shows a blue screen the fps and milliseconds in the top corner. i was just wondering how i would implement a button which could toggle the RECT R that i use for the text on and off? please help me and maybe give me some sample code? thanks alot guys :D

Share this post


Link to post
Share on other sites
OMG thank you soo much i was worried that this knowledge was not getting through to me when reading the book but you pointed me in the right direction and it works!

I have to admit i am feeling a kind of rush right now :D

Share this post


Link to post
Share on other sites
Quote:
Original post by emforce
btw how do you get it to only register a certain key?
The wParam value contains the virtual key code of the key being pressed:

case WM_KEYDOWN:
{
if(wParam == 'X')
{
// X was pressed
}
else if(wParam == VK_UP)
{
// Up arrow was pressed
}

// etc
}
break;

Share this post


Link to post
Share on other sites
Quote:
Original post by emforce
is there a list i could find anywhere that contains the virtual key code?
Yup: Virtual-Key Codes. The A-Z keys have the same values as the upper case ASCII representation, which is why in the above example 'X' works in the same way as other VK_* values.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this