|
>> Anyway I have overmessage there <<
OK, that confirms that the reason for a deadlock is limited queue on Win98.
Hope 3 seconds is fine, but it's still not be 100% bullet prooof. I don't see any solution other then PostMessage. With PostMessage also you can check on your sending thread that only one WM_SETTEXT is travelling and Post only if nothing is in queue.
For example if your string is global and sending thread sets it and receiving empties it --> you will only PostMessage if that global string is empty...
Regards
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Hi,
How do I use threads in VC++?Please suggest a reference or sample program(s).
Karteek
|
|
|
|
|
Try these:
http://flounder.com/uithreads.htm
http://flounder.com/workerthreads.htm
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I have studied the instruction setting up a C++ project to use CxImage at http://www.codeproject.com/bitmap/cximage.asp.
But I still need help to generate/find the library files. I downloaded the source files and did a build on the project. But I do not see the library files stated in the instruction, for example, jpeg.lib.
Please help.
Elizabeth
|
|
|
|
|
I just found out how to generate the lib files. I have to select a Configuration before the build.
Elizabeth
|
|
|
|
|
How can I get a DLL's version programmically?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Assuming it has one, try VerQueryValue() , GetFileVersionInfo() , and related functions.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
So inorder to get the version I have to use all three of those functions listed in the MSDN? There's no easier way?
By the way is the answer 2?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote:
So inorder to get the version I have to use all three of those functions listed in the MSDN?
Yes, you'll need to call GetFileVersionInfoSize() , GetFileVersionInfo() , and VerQueryValue() , in that order.
Tom Wright wrote:
There's no easier way?
It's easy once you've done it a few times. Now if you have no interest in how it all works, you can always skip to this class.
Tom Wright wrote:
By the way is the answer 2?
No.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The application lost the toolbar tooltips after the SetState statement
m_wndToolBar.GetToolBarCtrl().SetState(ID_INBOX, TBSTATE_HIDDEN)
If I comment this line out, the tooltips comes back.
I tried to get the tooltips back by adding the following line
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS)
But this does not work. The tooltips are not showing up at the toolbar.
Elizabeth
|
|
|
|
|
Hi!
I am building a chat application and I'd like the main chat window to scroll down (such that the last message is at the bottom of my CRichEditCtrl) when the user enters a message.
I have not been yet able to do this. I know about LineScroll, but how many lines should I scroll with it? (Because the user can move the scroll bar upwards whenever he wants.)
Thanks!
|
|
|
|
|
How about this:
long lPos = GetRichEditCtrl().GetTextLength( );<br />
GetRichEditCtrl().SetSel( lPos, lPos );
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
This doesn't work.
From SetSel()'s help:
"This function does not scroll the contents of the CRichEditCtrl so that the caret is visible."
Other ideas?
|
|
|
|
|
Yes, you are right, SetSel function does not scroll the contents...
However, I think that the user will be annoyed if he decides to scroll up and see for example history of messages and at that time another message arrives and your code will scroll down. I think it's not right.
So, think about it: maybe you don't have to scroll. Just append new message to the end. In that case SetSel helps.
Not insisting of course:
void CChatView::AddString(LPCSTR lpszStr, COLORREF color )<br />
{<br />
LONG nStart, nEnd;<br />
GetRichEditCtrl().GetSel( nStart, nEnd );
LONG nLength = GetTextLength( );<br />
<br />
long lPos = GetRichEditCtrl().GetTextLength( );<br />
GetRichEditCtrl().SetSel( lPos, lPos );
<br />
GetCharFormatSelection();<br />
m_charformat.dwMask = CFM_COLOR;<br />
m_charformat.dwEffects = NULL;<br />
m_charformat.crTextColor = color;<br />
GetRichEditCtrl().SetSelectionCharFormat(m_charformat);<br />
Edit_ReplaceSel(m_hWnd, lpszStr);<br />
<br />
if((nStart != nEnd)&&<br />
(nLength > nEnd + 10))<br />
GetRichEditCtrl().SetSel( nStart, nEnd );
}
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
The user won't be annoyed, because I want this scrolling to take place only when HE enters the message (and not his chat partner), so that he doesn't have to scroll down to the last line and then enter his message.
Thanks anyway!
|
|
|
|
|
This doesn't work.
From SetSel()'s help:
"This function does not scroll the contents of the CRichEditCtrl so that the caret is visible."
Other ideas?
|
|
|
|
|
Here's a really late response for you, and I understand that you will probably already have a solution. But my searching around on the net didn't find much more than your question and a lack of an answer. Hope this helps someone else.
This works for me:
CRichEditCtrl results(myEditBoxHWND);
LONG lLen = results.GetWindowTextLength();
results.SetSel(lLen, lLen);
results.ReplaceSel(_T("My new bit of text\n"));
int nFirstVisible = results.GetFirstVisibleLine();
int nTotalLines = results.GetLineCount();
results.LineScroll(nTotalLines - nFirstVisible); Phil
--
All things considered, you can't really consider all things ...
|
|
|
|
|
When I select various items in a CListCtrl they are obviously selected because the background colour changes.
However, when the CListCtrl looses focus, the items are not obviously in focus. Is there anyway I can change this so it behaves more like Windows Explorer and leaves the selected items selected, but a different colour when the window is out of focus.
Many thanks,
Alan Dugdall
|
|
|
|
|
Check the list control's "Show selection always" property in the resource editor. You can also set this style programatically by doing:
DWORD dwStyle = ListView_GetExtendedListViewStyle (m_listCtrl.GetSafeHwnd());
dwStyle |= LVS_SHOWSELALWAYS;
ListView_SetExtendedListViewStyle (m_listCtrl.GetSafeHwnd(), dwStyle);
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I need a way to make my app (a dialogproject in VC++) to bee maximized at startup when running my app.
Thanks
APe
|
|
|
|
|
Add this in your OnInitDialog():
ShowWindow (SW_MAXIMIZED);
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello, all,
I am working on a project which needs to capture the mouse movement in IE browser window. How can I do it?
I think I can create a class and use SubclassWindow of IE. Is that right?
I this case, which class should my new class derive from?
And how can I get the HWnd of IE.
Or there is other ways to do it?
Thanks a lot.
bin
|
|
|
|
|
You can't subclass a window in another process without injecting code into that process.
You can however use a Windows hook. See SetWindowsHookEx in the Platform SDK documentation. You probably want one of WH_CALLWNDPROC , WH_CALLWNDPROCRET or WH_GETMESSAGE .
|
|
|
|
|
It sounds like you need to do soenthing limilar to what this article describes:
Mouse gestures in IE[^]
I have not read it, but it probably does something like you need.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Hi
Can i do so that my MFC dialog launch from WinAPI dll.
Or i can to do it only in MFC dll project????
Actually i do this but after loading of my dialog AfxGetThread()->PumpMessage was invoked from MFC code and application failed.AfxGetThread return NULL,but in my code i set AFX_MANAGE_STATE(AfxGetStaticModuleState()) and change _WINDLL to _AFXDLL macro.
Thank.
|
|
|
|