|
Can someone direct me to information on how to 'activate' a button (that is either ON or OFF) without clicking on it ---- using only code to manipulate the action that would normally occur if the user clicked on it.
Thanks very much.
John P.
|
|
|
|
|
CButton m_button;
m_button.EnableWindow(TRUE);
|
|
|
|
|
Do you mean:
(1) making the button to have the Focus ?
SetFocus();
(2) making the button Enabled?
EnableWindow(TRUE);
(3) making the button (previously hidden) to appear?
ShowWindow(SW_SHOW);
(4) ...
hope that helps...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
What Language are U Using?? What Compiler, etc.!
LateNightsInNewry
|
|
|
|
|
1) Use SendInput
2) Use two SendMessage calls, one with WM_LBUTTONDOWN and one with WM_LBUTTONUP with the appropriate coordinates.
3) Use mouse_event (I think it still exists).
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Actually I have 2 bytes hexavalue and I want to convert into decimal value in C language could some one tell me how can i do that.
ikram
|
|
|
|
|
if you have two bytes worth of data that you want to interpret as an integer: __int16 i = *(__int16 *)pYour2Bytes;
if you have two strings:
char *p;
int i1 = strtol(pStr1, &p, 16);
int i2 = strtol(pStr2, &p, 16);
int i = (i1 << 8) + i2;
if you have one string:
char *p;
int i = strtol(pStr1, &p, 16);
|
|
|
|
|
thx..
I have some thing like that.
unsigned char DATA[25]; // DATA array consist of hex values.
I want to convert DATA[1] and DATA[2] contain hexadecimal values that is (0x00 0x02) into the decimal value.plz let me knw accordindly..thanks in advance.
|
|
|
|
|
__int16 i = *(__int16 *)pYour2Bytes;
FYI: unsigned chars do not contain "hexadecimal values" . a uchar contains 8 bits which can be combined to represent numeric values from 0 to 255 in decimal, or 0 to 0xff hex, or 0377 in octal, or 00000000 to 11111111 in binary, or any other base you prefer to use.
|
|
|
|
|
Please explain what you want to achieve. It appears you want to read two Text Strings, base 16, and combine them into one int.Why only shift 8 bits,etc. A lot depends on your End Pointer &p, which appears to be not modified between calls. How are you sure that p points to a valid end value in BOTH Strings. Me thinks that your code cannot make sense!
See your Standard header File for
'long strtol( const char *nptr, char **endptr, int base );'
LateNightsInNewry
|
|
|
|
|
(methinks your reply was misplaced)
|
|
|
|
|
sorry i was away-
unsigned char DATA[25];
Array contain different hexavalues(One function fills the values in DATA array). Now I want to read DATA[1] and DATA[2] values combinely.
let suppose,
DATA[1]=0x0b
DATA[2]=0x0b
The Decimal values for 16 bit(2 bytes DATA[1]& DATA[2]) is 187..
plz explain me how can i do that.thx
|
|
|
|
|
sorry..
DATA[1]=0x0b
DATA[2]=0xb0
The decimal value is 187.
|
|
|
|
|
__int16 i = *(__int16 *)&DATA(1);
|
|
|
|
|
thx for the help done.
|
|
|
|
|
if you have the string-representation of the hex number, such as "F5", the you may use strtol function, e.g.
char *pEnd;
long nVal = strtol("F5", &pEnd, 16);
hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I have following situation:
class A {...}
class B : public A {...}
can i do this:
A *a = new B;
delete a;
Thank you for reading and even more for answering
|
|
|
|
|
I cannot see any question marks, but since the written code isn't obviously wrong or bad the conclusion is this:
The written code is maybe ok.
Problems might occur if the base class destructor isn't declared virtual ; if so, the derived class destructor will never be called and memory might leak.
|
|
|
|
|
Yes of course. Why not ?
If you want the destructor of B to be called, you need to make the destructor of A virtual (take this habbit: whenever you have a class that can be inherited, declare its destructor virtual)
|
|
|
|
|
Thank you for answering. It was more annoying stuff, but i didnt noticed it:
class A {...}
class B : public A, public X {...}
class C {...}
my code:
X *x = new C;
delete x; // kabooom
Well problem solved, thank you again for answering.
|
|
|
|
|
Hello everybody,
i want to avoid the menu which pops up with a right click on the taskbar button of an application but I find no way to trap this event. Does anybody have a solution for this problem?
MS
|
|
|
|
|
|
Hello cpallini,
thanks a lot, that seems to work. The disabled close button does not affect my purpose.
MS
|
|
|
|
|
|
even you got the answer, i just wondere : why on earth do you want to remove this standard windows behaviour ?
|
|
|
|