April 18, 2024, 08:40:41 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Push Buttons

Started by ExMember001, August 08, 2006, 09:22:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ExMember001

August 08, 2006, 09:22:05 PM Last Edit: August 12, 2006, 07:54:31 PM by krypt
Here is How you can use PushButton..
a PushButton is a button but when you click it, it stay pushed

to get the state i use custom variables set to 1 for push and 0 for normal (UnPush)

you just need to add this file in your project and add the proper extern declaration.


////////////////////////////////////////////////////////////////////////////////
//ButtonAPI.src
////////////////////////////////////////////////////////////////////////////////

//Add to the src file where these functions are used
//declare extern PushButton(Unsigned int Button);
//declare extern UnPushButton(Unsigned int Button);
//#define BS_PUSHBUTTON       0x00000000
//#define BS_DEFPUSHBUTTON    0x00000001

//Uncomment if Undeclared
//#define BM_SETSTATE         0x00F3
//declare import,SendMessage alias SendMessageA(unsigned int hWnd,unsigned int Msg,int wParam,int lParam),int;

////////////////////////////////////////////////////////////////////////////////
//You need to add BS_DEFPUSHBUTTON or BS_PUSHBUTTON flag when you create the control
Global Sub PushButton(Unsigned int Button)
{
SendMessage(Button, BM_SETSTATE, true, NULL);
}

////////////////////////////////////////////////////////////////////////////////
//You need to add BS_DEFPUSHBUTTON or BS_PUSHBUTTON flag when you create the control
Global Sub UnPushButton(Unsigned int Button)
{
SendMessage(Button, BM_SETSTATE, false, NULL);
}