|
Randor wrote: You can check if SM_CYFIXEDFRAME returns the correct value. Interestingly enough I did not have this problem
Okay, I will check it tomorrow. Btw, GetCount()[^] returns not a zero based index.
Thanks again... time to get some sleep.
|
|
|
|
|
Moak wrote: Btw, GetCount()[^] returns not a zero based index.
Ahhh yes you are correct again.
Its the CB_GETCOUNT Message[^] that returns the zero based index.
Best Wishes,
-David Delaune
|
|
|
|
|
To know the size of the border you could try this trick:
CRect Outer, Inner;
list.GetWindowRect(&Outer);
list.GetClientRect(&Inner);
list.ClientToScreen(&Inner);
int LeftBorder = Inner.left - Outer.left;
int TopBorder = Inner.top - Outer.top;
int RightBorder = Outer.right - Inner.right;
int BottomBorder = Outer.bottom - Inner.bottom;
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
A window called GetCapture() first, then calls ReleaseCapture() when mouse-down (on WM_LBUTTONDOWN message).
If mouse-down is not clicking on the window, how do we dispatch WM_LBUTTONDOWN message to that window clicked?
The question is similar to Window's menu - WM_LBUTTONDOWN is correctly dispatched if clicking outside of menu, acturally the window I asked is similar to menu for displying some information.
|
|
|
|
|
Convert the position given in the WM_LBUTTONDOWN message to screen co-ordinates. Use GetWindowFromPoint to get the window at that position. Post the WM_LBUTTONDOWN message to that window, remembering to convert the screen co-ordinates to client co-ordinates for that window.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks, all are fine now.
the function is WindowFromPoint(...) - first time I use it.
|
|
|
|
|
I am a major newbie to window API and coding in C C++. I'm having a major problem with character variables. In other languages you can just say
variable char x = "Hello"
variable char y = "I'm stupid"
x="No, I'm really not stupid"
x=y
but in c a char is basically a number from the ASCII table
and if you define char x[112] you then can't say x="Hello" because I guess x must be 112 chacters. But you can say x[]="Hello" which is ok if you just want a variable for "Hello" but if you want use a variable and assign it to different values and/or concatenat different values to it what do you do.
Anyone have any simple answers as to how to use character variables in c c++?
What I want to do is create a text file that's 112 characters on each line.
1-2= a two digit code
3-12=yyyy/mm//dd
13-20=hh:mm:ss
21-40=a barcode retrieved from an editbox
41-60=blank
61-80=blank
81-81=a single digit code
82-92=a decimal 10,2 retrieved from an editbox
92-102=a number retrieved from an edit box
103-112=a number
if numbers / values are less than allowed their padded with spaces
something like this is easy in other languages but in windows api c c++ seems to be very difficult
thanks for any help
|
|
|
|
|
There's not going to be all that simple an answer for you. What you are asking for is the stuff you learn in a lesson, or from a book - not from a quick post.
But here's a start.
char means char acter. In those other languages, "Hello" is a string, not a char either.
Another work for character is letter. So, 'H' is a char, "Hello" is a string, or bunch of characters one after another.
char message [] = "Hello";
That means that the message variable is an arrach of characters - or an array of letters. In this case, 'H' followed by 'e', 'l', 'l', 'o', and lastly a char value of 0, to denote the end of a string.
And that's all I'll reply - otherwise I'll write a book for you - and other people have already done that.
But hopefully ot will get you started on your journey.
I learned from Kernigan & Richie - small language, small book.
Now, if you want to *pay* me to write you a book...
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
egerving wrote: if you define char x[112] you then can't say x="Hello" because I guess x must be 112 chacters
No - it's because a C string, when referred to by name, is a pointer, not an array. You can use strcpy and strcat (and many other functions) to build strings.
For your situation, I'd probably use fprintf to write each record to the file, using width specifications - something like:
fprintf(fileHandle, "%-2d%-4d/%-2d/%-2d%-2d%-2d:%-2d%-20s %-1d%-11.2f%-11d%%-10d\n", firstCode, year, month, day, hour, minute, second, barcode, secondCode, decimal, firstNumber, secondNumber);
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
egerving wrote: ...and if you define char x[112] you then can't say x="Hello" because I guess x must be 112 chacters.
Valid:
char x[112] = "Hello"; Invalid:
char x[112];
x = "Hello";
egerving wrote: ...if you want use a variable and assign it to different values and/or concatenat different values to it what do you do.
For C, use functions like strcpy() and strcat() . For C++, use the string class.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thank you all very much for your posts. Every little bit helps. I think I'm really starting to like this site as this is the second time I've made a post and got responses both times!
Thank you.
|
|
|
|
|
One thing to understand is that in ALL languages a character is a number. With C/C++ it's just more obvious about it. In pure C/C++ and Assembly, you are simply doing manually what high level languages do behind your back. (With CString and string in C++, you can also treat strings as "abstract" objects.)
* * *
For the text file question, look at cout , and its cousins, though I vastly prefer printf()/fprintf() and its cousins.
printf("%02d%04d/%02d/%02d%02d:%02d:%02d and so on
(One variant of this is printf("%.2d%.4d/%.2d/%.2d%.2d:%.2d:%.2d . I prefer the former, but you will run into the latter and should be aware of it.)
|
|
|
|
|
I need to remove security descriptors from certain registry keys.
What functions would be of interest for this operation?
( The problem is that even the administrator is being denied access to change key values, and I am going to try to manually remove all descriptors, hoping that this might fix it. )
|
|
|
|
|
Seems unlikely that'll work - you'll get 'access denied' status returns, I would have thought.
However, I think these should be of use - GetNamedSecurityInfo[^] to retrieve something's ACL, SetEntriesInAcl[^] to create a new ACL from that ACL, DeleteAce[^] to delete an ACE from an ACL and SetNamedSecurityInfo[^] to set the new ACL on the object.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you for the information.
|
|
|
|
|
|
Thanks very much for those links. I'll read them carefully.
|
|
|
|
|
Hi All
i am posting one url with setting this "x-microsoftajax;Delta=true" header but i am getting "400" http error code, can someone please give me suggestions on it.....
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Can anybody tell my why MDI framework do not cross over through OnActivateFrame(int nCmdShow) ? I build a MDI test application ( doesn't matter CView based on ) and I override CMainFrame::OnActivateFrame(int nCmdShow) where I put a TRACE0("\n Here cross over OnActivateFrame \n"); statement and compile in Debug version , but Output window doesn't show anything ... can you tell my why ?I mention that SDI framework haven't this problem ...And for what I need that handler : to memorate window position ...
|
|
|
|
|
OnActivateFrame is an overridable method of CView, NOT the frame window class.
You may find OnActivate is the overridable method you're look for.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Good catch ! And in case that I not load a child window like this :
if(CCommandLineInfo::FileNew == cmdInfo.m_nShellCommand)
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
where should I load WINDOWPLACEMENT structure ? Anyway , thanks for answer !!
|
|
|
|
|
In the main frame's OnCreate, after you've called the base classes OnCreate handler, I would have thought.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Ok, I will try that , and let you now what I settle down ... thanks again !
|
|
|
|
|
Hello,
When I enter the left arrow key or the right arrow key nChar = 39 or 38 for the OnKeyDown() but nChar = 13 for OnKeyUp()
void CRICH::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
}
void CRICH::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
}
Why there is a change in nChar value for both the functions
Thanks
Pritha
|
|
|
|