|
How I can get item text when mouse cross over item?....
When exactly you wnat to retrieve text from List control?
Please write in brief
|
|
|
|
|
When mouse holds for a brief time my item is hilited, at that time I need to get index of that item so I can get items text!
Thanks.
P.S.
The question is can I monitor some message. I cant just use GetHotItem function I need to do so on a special moment (when hilited)!
|
|
|
|
|
I don't know how to do it with the messages that you are trying, but what do you think about...
If you move the mouse, reset a timer that counts while the mouse is quiet.
If the timer ends its count and the pointer is in the ListCtrl area (you can easyly make a PtInRect with the corners of the ctrl) you can emulate the click of the mouse
and then you get the hitlited and the row number with the NM_CLICK like:
int CView::OnClickListCtrl(NMHDR* pNMHDR, LRESULT* pResult)
{ int nRowNum = -1;
POSITION pos = m_clcMyListCtrl.GetFirstSelectedItemPosition();
while (pos)
{ int nPos = m_clcRuleList.GetNextSelectedItem(pos);
nRowNum = nPos;
}
return nRowNum;
}
With this you have the number of the row, and can use it to get the item text and anything you want
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
The Messages which are post,they are synchronized due to message queue.What about the messages which are sent?
never say die
|
|
|
|
|
I am not sure what you mean by synchronized. Window messages are placed into a FIFO stack and each message has a priority level. They are processed and removed from the stack based on location in the stack and priority level of the message type.
This is a part of MS Windows that has evolved over the years, working slightly differently in older versions.
However with that being said, currently in Windows XP and Windows Vista The Send* message functions bypass the standard message que and are pushed onto a seperate FIFO stack of nonqueued messages. These messages are processed with higher priority than messages which are in the standard message que.
To read more about messages and message queues, the MSDN has an excellent article located here:
http://msdn2.microsoft.com/en-us/library/ms644927.aspx[^]
Best Wishes,
-Randor (David Delaune)
|
|
|
|
|
By Synchronization I mean that if 2 threads post a message to a 3rd Thread (which is owning a window)then execution is synchronized that is which ever message comes first in the message queue is executed first.But in case of Send Message the thread directly call the WndProc , so how the synchronization takes place
-- modified at 0:41 Thursday 20th September, 2007
never say die
|
|
|
|
|
I just read in the msdn Messages sent between threads are processed only when the receiving thread executes message retrieval code.May be the message retrieval code does the synchronization .If any body knows more than this please share it
never say die
|
|
|
|
|
Do you know what a message queue is?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It is a thread specific message queue for GUI/non-GUI application. It stores the messages post by system or some other application.The thread retrieves the messages from its message queue using GetMessage or PeekMessage .If i m wrong somewhere pls rectify it.
never say die
|
|
|
|
|
The MSDN is somewhat misleading in that it states: "directly calls the WndProc"
This is only true if the window belongs to the same thread executing SendMessage()
In other words... if Thread1 executes SendMessage() to a window it owns, the WndProc is directly executed.
If Thread1 executes SendMessage() to a window owned by Thread2, the message is placed into a seperate que. This special que contains messages of extreme high priority. This que is not the same as the standard message que.
Hope it helps,
-Randor (David Delaune)
|
|
|
|
|
Thanks a lot
never say die
|
|
|
|
|
Hi All,
I want to insert smiley faces in the Rich Edit Control (like Yahoo Chat)...can anyone help me in this issue..
just tell me how to load the smiley and display it in the Rich Edit control.
Thanks in advance,
Shiva
|
|
|
|
|
Said smiley face is a graphic, so you'll need to load it like any other graphic, or from the clipboard.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
How can I increase/decrease the size of the property page?
Thanks in advance
- NS -
|
|
|
|
|
There are several article here to solve this problem.
Greetings from Germany
|
|
|
|
|
NS17 wrote: How can I increase/decrease the size of the property page?
The size of the sheet is governed by the size of the smallest and largest pages.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I use a customized tab in the property sheet. I need to extend the page to the border of the tab control. That is what I actually needed.
FYI: I solved the issue by handling the WM_WINDOWPOSCHANGING in the page.
But this solution has disadvantage that i need to do it in all the pages.
- NS -
|
|
|
|
|
And why dont you make a generic function using the identifier of the sheet as parameter? and then call the function changing the parameter when a sheet is becoming visible.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I am sorry. I didnt get you.
- NS -
|
|
|
|
|
If your problem is that you have to change the size in every sheet. Insteads of coding one function per every sheet, you can make it with just a function and calling it when a sheet changes before the datas are shown.
To do that, you can take a pointer/handler to every sheet and give it as parameter to the function. Then code the change of size to the concrete sheet.
for example:
void ChangeSheetSize (CWnd* pWnd)
{
}
CPropertyPage::OnSetActive ()
{
CWnd* pWnd = GetActiveWindow ();
ChangeSheetSize (pWnd);
}
Im not sure if there is a better way, but I think it can work
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I did not tried it, but it should be done in each page. I was seeking for a solution, that is independant from page. Means it should be done in the sheet or elsewhere, so that no repeated coding is needed.
- NS -
|
|
|
|
|
With the idea I gave you, the only lines of code you should repeat are:
CPropertyPage::OnSetActive ()
{
CWnd* pThisPropPageWnd = GetActiveWindow ();
ChangeSheetSize (pThisPropPageWnd);
}
The function of changing size needs to be written just once. In the parent window/view that is containing the different property pages.
so it should be somthing like:
pParentWnd->ChangeSheetSize (pThisPropPageWnd);
But... I'm not 100% sure about.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
NS17 wrote: I use a customized tab in the property sheet. I need to extend the page to the border of the tab control.
Sorry, but I'm not following.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Actually there is a little gap ( approximately 3 pixels ) between tab control border in the property sheet and border of property page. So I need to enlarge the property page to fit to the tab control borders.
Hope you got what I meant.
- NS -
|
|
|
|
|
NS17 wrote: So I need to enlarge the property page to fit to the tab control borders.
So enlarge it in the resource editor. What's hard about that?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|