|
it is not very proper to combine such operations on the same line, especially when you do not / cannot know in which order it is executed...
in your :
SendMessage(GetDlgItem(hwnd,IDD_PIN_BUTTON + (intPinChkCtr)), WM_MOVE, 0, MAKELPARAM( (WORD)rectDialog.left, (WORD)rectDialog.top++) );
are you sure the rectDialog.top++ is executed before the GetDlgItem() funciton is executed ?
wouldn't it be better to write ++(rectDialog.top) , or better extract it before the line, then pass the value ?
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
thanks for the suggestion.
i tried it but it seems that the incremented top position was not kept.
during debug the top value would change but if i would be going back to the break point
again the previous top value was retained.
GetWindowRect( GetDlgItem(hwnd,IDD_PIN_BUTTON + (intPinChkCtr)), &rectDialog );
sizeDialog.cx = rectDialog.right - rectDialog.left;<br />
sizeDialog.cy = rectDialog.bottom - rectDialog.top;<br />
SendMessage(GetDlgItem(hwnd,IDD_PIN_BUTTON + (intPinChkCtr)), WM_MOVE, 0, MAKELPARAM( (WORD)rectDialog.left, (WORD)(++rectDialog.top)) );
it seems like the control was not keeping the changes from the SendMessage()
|
|
|
|
|
and what about SetWindosPos() instead of SendMessage() ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
daydremer wrote:
I have a problem in changing the position of a checkbox control during runtime
What about [MoveWindow] and [SetWindowPos] Api!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
it seem that alok have some trouble...
do you also click with your nose ?
or did you just forget the [Modify] link ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
do you also click with your nose ?
No Using Hand these days, After Cedric lost control!
toxcct wrote:
it seem that alok have some trouble...
DAMM 500 error doing this, i think my message is not posted , so i post it again
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
and what about [Delete] link now ?
(toxcct, looking at his watch : "Oh no, it's time to 3... the school's gonna disconnect the servers for 3 hours && 1/2 ... like every days how will i write my posts???)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
and what about [Delete] link now ?
YES OFFICER, IT WILL BE DONE, OVER AND OUT!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
toxcct wrote:
(toxcct, looking at his watch : "Oh no, it's time to 3... the school's gonna disconnect the servers for 3 hours && 1/2 ... like every days how will i write my posts???)
Ah yes, Alok we have an advantage the next hours...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
Ah yes, Alok we have an advantage the next hours...
Nope 3 and 1/2 hr (Oops 1/2 hr already passed )
Any way Now you are alone as i am logging off tooo, have nice DAY
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
LOL. I have to wait a few hours before I finish work and go home...
Have a nice day too
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
well, have a nice evening
i'm back, but not for a long time
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Well, I'm finished with my work so I head home now.
See you tomorrow
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
MoveWindow worked for me although it took me a while to figure out how the command works.
thanks a lot!
|
|
|
|
|
Hi all,
I got two unsigned chars that I need to convert into a unsigned short whereby the two chars act as the upper and lower bytes of the short. How do I go about this. It seems in my head to be a simple matter but I just can't figure it out.
Thank you in advance
Rich
|
|
|
|
|
<font color=blue>unsigned char</font> ucMSB = 0x6F,
ucLSB = 0xA4;
<font color=green>
<font color=blue>unsigned short</font> usVal = (((<font color=blue>unsigned short</font>)ucMSB) << 8) | ((<font color=blue>unsigned short</font>)ucLSB);
easy isn't it ?!
pssst: it seems that you have some troubles with bytes manipulation ; as it is not the first time you ask such question... what are you trying to do with all these ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks for the help guys.
What am I doing? I'm converting user input ( from gui ) into the smallest possible form ( hence the splitting of data ), transmit it to another source via serial comms which then sends a message back. The message then has to put back into a readable form so it can be displyed in the gui. I've got the Tx side of things sorted now but I'm just tying up the Rx data.
I knew it was simple but I just couldn't figure it out. Time to blow brains out I think.
|
|
|
|
|
short nYourShort = cYourChar1;
(&nYourShort) + 1 = cYourChar2;
Or:
short nYourShort = ((short) cYourChar1) + ((short) cYourChar2) * 255;
why multiply cYourChar2 with 255 you ask. Well its the same as shifting all the bits 8 places to the left (towards the MSB). The equivilant would be: ((short)cYourChar2) << 8 .
There are many solutions to this problem, these are just a few.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
with 255 you ask. Well its the same as shifting all the bits 8 places
isn't it 256 instead ???
however, it is not a so good habit to code bits and bytes manipulation..
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
isn't it 256 instead ???
I'm wrong 1 bit once again... And it was you who corrected me the first time too, if I remember correctly.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
I'm wrong 1 bit once again...
remember that 8 bits shifting equal to 2^8 (2 for base-2, 8 for 8 bits), or better equals to 0x100 ...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I thought that odd value was a little bit strange! Anyway, thanks for notifing me.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Can we use mbtowc instead
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
Hi
Is there anyway to handle the forced exit of an application by task manager?
Regards
|
|
|
|