|
O yes ! thx you !
it works great !
|
|
|
|
|
if (wParam & MK_LBUTTON) //left button down
if (wParam & MK_RBUTTON) //right button down
Joel Lucsy
|
|
|
|
|
Thx ! your solution is grat for PreTranslateMessage !
Thx again
|
|
|
|
|
Arf i have a problem ;(
Your solution works great when the view is derived from CView, but when is derived from CListCtrl it doesn't work !
You know why ?
Thx
|
|
|
|
|
I'm new to this. I want to be able to send a command from the client application to the server application. For example to call the one of the servers dialog box or menu item. Which calls do I need to do achieve this.
Thanks
|
|
|
|
|
Ok,
I don't know the official word for doing this, but in windows, if you have a box with text and the text spans further than what the box can display (i.e. on the taskbar at the bottom of the screen), if you hold the mouse over the box, a yellow box pops up displaying the full text. How would I implement this into a dialog control that i have? I have an input form with several static text boxes, which sometimes get overloaded because I fill them with more text than what the user can normally see.
Thanks,
Mike Mathers
|
|
|
|
|
Its called a tooltip. There are several classes available her on CP.
Note that for a static text control to have a tooltip, it must have a unique ID and have the Notify style set in its resources.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Thank you for the quick response. I was looking more to do this myself if possible, I've been reading up on CToolTipCtrl, and I've set the Notify Styles on all the static controls that need this. But what is the next step, do I include a CToolTipCtrl object in my dialog class? I'm a little stumped and MSDN is not helping.
|
|
|
|
|
I wouldn;t bother with the tooltip control. If your doing this on a dialog, follow these steps (which work on form views etc as well).
1. Call EnableToolTips(TRUE) in the OnInit dialog.
2. Add the function prototype
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT * pResult);
3. Add this MESSAGE_MAP entry
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify)
4. Add your funtion
BOOL CYourDialog::OnToolTipNotify(UINT , NMHDR *pNMHDR, LRESULT * )
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
static char tooltiptext[256] = "";
if (pTTT->uFlags & TTF_IDISHWND)
{
UINT nID = ::GetDlgCtrlID((HWND)pNMHDR->idFrom);
pTTT->lpszText = NULL;
switch (nID)
{
case IDC_TITLE :
pTTT->lpszText = "Tray setup title";
break;
}
if (pTTT->lpszText != NULL)
{
return(TRUE);
}
}
return(FALSE);
}
Then just write your tooltips text for each control.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I'm writing an editor, and I want to have current Line and Column displayed.
Line is working fine, but column doesn't always work right.
if I try to get the CharIndex of the beginning of the line this way,
long int nStartChar = SendMessage(EM_LINEINDEX,-1,0);
I eventually hit a problem after 88x lines, where (nCurrChar - nStartChar) is 65xxx
if I try to get the CharIndex of the beginning of the line this way,
long int nStartChar = LOWORD(pEdit->CharFromPos(ptLineBegin));
where ptLineBegin is based on GetCaretPos() and x forced to 0, then the column is based on the left of the window, and not the actual beginning of the line.
Can anyone give me some help, please? Thanks!
BW
"We get general information and specific information, but none of the specific information talks about time, place or methods or means..."
- Tom Ridge - US Secretary of Homeland Security
|
|
|
|
|
Turns out it wasn't the start of line I had issues with, it was getting a reliable Curr CharIndex.
I got it this way.
<br />
DWORD dwStart, dwEnd;<br />
pEdit->SendMessage(EM_GETSEL,(WPARAM)(&dwStart), (LPARAM)(&dwEnd));<br />
<br />
return dwStart;<br />
BW
"We get general information and specific information, but none of the specific information talks about time, place or methods or means..."
- Tom Ridge - US Secretary of Homeland Security
|
|
|
|
|
Hello
I am looking for function to stop and continue the message processing of processes.
Is there a function like StopMessageProcessing(...) to stop
a process processing its messages? This does not mean to kill its messages in its message queue, it means just to stop the processing for a certain time I want to define.
-Dominik
|
|
|
|
|
Check SuspendThread and ResumeThread
an article
http://www.codeproject.com/threads/pausep.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
You might be able to use SuspendThread and then ResumeThread, but I'm not sure if you can do this cross-process. Note that you might have to suspend all the threads of the process, not just the base one.
The only other alternative is to somehow pass a particular message to the app that you have a hook into. When the message is received you would do a sleep or something that doesn't return control till you need it to.
Joel Lucsy
|
|
|
|
|
Hi!
I have inserted an activex control in my Win32 API application, and when i try to compile it, my application doesn't have any errors and it's not visible....
What's wrong?....
|
|
|
|
|
Hi !
Are you sure your ActiveX is well registered and installed (not only added to the C++ compiler)?
I had the same problem when I ran my application on a computer wher the ActiveX was not installed.
Hope it helps!
|
|
|
|
|
Is there anything equivalent to DoEvents of VB in VC++ 6???
Mahesh
|
|
|
|
|
Mahesh Perumal wrote:
Is there anything equivalent to DoEvents of VB in VC++ 6???
I would assume it's along the lines of SendMessage[^].
-Nick Parker
|
|
|
|
|
More along the lines of a non-blocking message loop;
while (::PeekMessage(&msg,NULL,0,0,PM_NOREMOVE))
{
AfxGetThread()->PumpMessage();
}
or similar
Steve S
[This signature space available for rent]
|
|
|
|
|
It doesn't exist, but you can certainly write it:
void DoEvents()
{
for (MSG msg; ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); )
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
}
Regards,
Alvaro
Quitters never win. Winners never quit. But those who never win and never quit are idiots. -- despair.com
|
|
|
|
|
Thanx a lot.
I have got it working...
|
|
|
|
|
I program by MFC. How to write an application that can open a web site? It is wonderful if I can do that by clicking on a button.
Thank you.
|
|
|
|
|
Look at InternetOpenUrl().
You should save yourself and your company years of grief by shooting yourself through the head immediately. Believe me, in the long run it'll turn out better for everyone. - Tyto (at arstechnica)
Awasu 1.0[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Try something like:
ShellExecute( hWnd, _T("open"), _T("http://www.mywebsite.com/default.htm"), NULL, _T(""), SW_SHOW );
The parameters are described in detail in MSDN.
Dave
|
|
|
|
|
You can use ShellExecute() function with the site address as argument.
|
|
|
|