|
Has anyone done a custom-drawn caption & border using WM_NCCALCSIZE, WM_NCACTIVATE, and WM_NCPAINT? I'm trying it this way in a WTL app (as opposed to removing WS_CAPTION, and just drawing the edges of the client area to look like a border) and there are two things I can't solve.- The standard min/max/close buttons get drawn by the system when the mouse moves in the border.
- The buttons get drawn when you r-click in the caption area.
It seems no one has written about using those messages (aside from the neat MFC custom caption article, which alas only helped partway) so I'm stumped as to what to try next. Handling WM_NCMOUSEMOVE does work around problem 1, but I still have no solution to #2.
(Actually, Paul D. glossed over this problem in a C++ Q+A article, and said removing those buttons and the gray line at the bottom of the caption would take "a gazillion lines of code" )
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Did you look at the custom caption aricle by David Lorde?
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
I remember an article using these messages, written by Roger Onslow. It was about Flat toolbars, and WM_NCPAINT was used to draw grippers (in fact, no, but you will understand looking to the article).
The article may be found at codeguru.earthweb.com/toolbar/devstudio_like.shtml
Another implementation on WM_NCPAINT was the fantastic Cristi Posea's docking windows. At the time I've customized it to add a close button on it, drawn flat if mouse pointer wasn't over (the latest version of this article should have this functionnality to). If I remember well I used WM_NCHITTEST to know the mouse position and determin if it was over a "sensitive" area.
HTH,
We do not inherit the Earth from our ancestors. We borrow it from our children.
Antoine de Saint Exupéry (1900-1944)
|
|
|
|
|
Hi!
In my progect i use ListCtrl with multi selection items.If user select any items from ListCtrl and then press on button "Delete" i delete selected items from ListCtrl(i use GetFirstSelectedItem,GetNextSelectedItem).The problem is when ListCtrl lost focus.Because user after many action can again press button "Delete" and ListCtrl "Remember" selected items.I want to do if ListCtrl lost focus clear all selected items.And when ListCtrl recieve focus to do that user will can select again many items.Help me,please,how can i do this!!!
Ira.
|
|
|
|
|
Have you tried to call
CListCtrl::SetItemState(mySelectedItemIndex, !LVIS_SELECTED, LVIS_SELECTED); ?
where mySelectedItemIndex belongs to your selected items index ?
We do not inherit the Earth from our ancestors. We borrow it from our children.
Antoine de Saint Exupéry (1900-1944)
|
|
|
|
|
hi all,
I am using "mciSendString" api function to record the wave audio through
microphone.
My question is how can i capture the audio data in Integer array while recording?
Because I have to Plot the line graph(spectrum) by using these values while recording(real Time)
Please help me.
Is there any other method to Plot the graph while recording(realTime)
Thank in advance.
|
|
|
|
|
How do you open a file dialog with modern buttons like "desktop", "My documents", "Network place" etc? I can't seem to get those with CFileDialog...
|
|
|
|
|
See this article.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
i want to clear the clipboard.i used the fn Emptyclipboard.but i am able to paste the text once and then only it is emptying.why is it so.Also i am checking openclipboard().
|
|
|
|
|
Im creating an ATL Exe application, then i create an ATL object on it called CHi, but i cant create an instance of it, i dont know why, i do this
CComPtr<ichi> object;
object.CoCreateInstance(CLSID_CHi);
it compile but it fails at the moment of try to create it,any idea why?, if i do the same with an mfc project it works.
and another question, how can i add an ATL Object in a WTL App?
|
|
|
|
|
Myself wrote:
Im creating an ATL Exe application, then i create an ATL object on it called CHi, but i cant create an instance of it, i dont know why, i do this
First question comes up, did you register it? Second, what do you mean by 'fails', what kind of error or problem do you get?
|
|
|
|
|
hres = -2147221164
|
|
|
|
|
-2147221164 = "class not registered"
you might want to verify that the class really is registered correctly.
-c
Being just contaminates the void. --Robyn Hitchcock
|
|
|
|
|
if i do that with an mfc project it works, i just add a new atl object and create it in there and it works.
|
|
|
|
|
are you calling CoInitialize somewhere before trying to create the object?
-c
Being just contaminates the void. --Robyn Hitchcock
|
|
|
|
|
Yes CoInitialize(NULL), in the _tWinMain and then try to create the object
|
|
|
|
|
i have tried many things to make this function work correctly.
the problem only occurs if i have a duplicate record in the recordset. if
there are no duplicates the function is fine.
i following function deletes all the records in the recordset.
if i have a duplicate log on file i get the error
"Multiple rows were updated"
is there a way i can avoid this error. Or is there a way i can call a function
to delete all the records.
My limitations are - I am using a VFP table and can only open it as a snapshot.
m_pSet->MoveFirst();
if(!m_pSet->IsEOF()){
m_pSet->MoveLast();
m_pSet->GetBookmark(endbookmark);
}
if(endbookmark.m_iVal>0){
m_pSet->MoveFirst();
do{
m_pSet->Delete();
m_pSet->MoveNext();
}while(!m_pSet->IsEOF());
}
thank you.
|
|
|
|
|
LPTSTR GetBuffer( int nMinBufLength );
I don't understand the parameter "nMinBufLength". What's the point of this parameter? what kind of value I should pass in? "The minimum length"?? I thought asking for a "maximum length" would make a lot more sense, oh well. Any help? Thanks in advance.
|
|
|
|
|
nMinBufLength specifies the minimum size of the buffer that you can safely play with.
If you do a GetBuffer with nMinBufLength = 10, you can do whatever you want with the first 10 characters of the LPTSTR that is returned. If you do something with the 11th character, let the devil save you!!!
[newly added]Of course that's assuming the actual buffer is smaller than 10 characters. Whatever you specify for nMinBufLength , if the actual buffer is bigger, that's what is returned [/newly added]
Use nMinBufLength = 0 to get a buffer that is the current size of the underlying CString buffer
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Ok so is I'm using a CString object to store contents read from a text file, whose size is unknown yet, I'd better make it: LPTSTR lpBuffer = str.GetBuffer(A_HUGE_NUMBER_HERE); ?
|
|
|
|
|
You better Use it with
str.GetBuffer(0);
it will return all the text
|
|
|
|
|
CString has a GetSize or GetLength or something. You can get the size from that.
It's much easier to use iostreams and std::string to read in a text file, if you're saying that you're grabbing the buffer, then reading the file. That's just plain ugly.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
i have tried many things to make this function work correctly.
the problem only occurs if i have a duplicate record in the recordset.
i have a function that deletes all the records in the recordset.
if i have a duplicate log on file i get the error
"Multiple rows were updated"
is there a way i can avoid this error. Or is there a way i can call a function to delete all the records.
My limitations are - I am using a VFP table and can only open it as a snapshot.
m_pSet->MoveFirst();
if(!m_pSet->IsEOF()){
m_pSet->MoveLast();
m_pSet->GetBookmark(endbookmark);
}
if(endbookmark.m_iVal>0){
m_pSet->MoveFirst();
do{
m_pSet->Delete();
m_pSet->MoveNext();
}while(!m_pSet->IsEOF());
}
thank you.
|
|
|
|
|
You need to add a unique field to the table.
The problem that the delete method do that scannig the table, and identificating the the record to delete like a unique record, but if you have a record equal to that you want to delete, you have the problem that you said....
Only add a auntonumeric field, or a timestamp field. And that will do that the field will be unique in all the table....;)
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Algorithm void PostOrderPlus(bintree MyBinT ree )
if MyBinT ree ·is-empty then print(‘0 ’) return() endif
PostOrderPlus(MyBinT ree.lefttree )
PostOrderPlus(MyBinT ree.righttree )
print(MyBinTree.info)
end algorithm PostOrderPlus
THIS ALGORITHM creates a sequence of numbers such as:
0 0 1 0 0 3 0 0 7 4 2 0 0 8 6
I am trying to figure out a way to recreate the tree if the POST ORDER
traversal aequence is given as shown above.
This is what I am required to do:-
You will be given a sequence of symbols, and you can assume that the first symbol is the special delimiter symbol. It is then up to your program to decide whether or not the sequence is a POPS of a binary tree. If it is not a POPS, print a message to that effect. If it is a POPS, construct the binary tree and compute, for each level of the constructed tree, the number of nodes at that level. Also, find the depth of the tree, and find a node whose depth is equal to the depth of the tree (and find the right-most such node if there is more than one such node). Finally, find the frequency of the root-value in the tree: if the value is not repeated, then test to see if the binary tree happens to be a search tree. So for this project, you must design several algorithms (with supporting abstract datastructures in an algorithmic language), that solves the problem(s).
The POPS works in the following manner (reading the sequence right to
left):
1. The last number is the root
2. The previous number is the right child
- If the previous number is zero that means that there is no child
there; or if there are two zeros that the number is a leaf.
3. The number previous to the previous number (in 2.) would be th left
child to the next number that follows.
PLEASE HELP ME!!
NO
|
|
|
|