|
Set the notify style of the picture control. You can then add a tool tip for the control by doing th following:
call EnableToolTips()
in messge map
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify)
in header file
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR * pNMHDR, LRESULT * pResult);
in .cpp file
BOOL CSamplesFloat::OnToolTipNotify(UINT /*id*/, NMHDR *pNMHDR, LRESULT * /*pResult*/)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
UINT nID = ::GetDlgCtrlID((HWND)pNMHDR->idFrom);
pTTT->lpszText = "";
switch (nID)
{
case IDC_PICTURE_CONTROL :
pTTT->lpszText = "My picture control" ;
break ;
case IDC_METHODDETAILS :
pTTT->lpszText = "The selected methods details" ;
break ;
}
if (pTTT->lpszText[0] != '\0')
{
pTTT->hinst = AfxGetResourceHandle();
return TRUE ;
}
}
return FALSE ;
}
In fact this can add a tolltip for any control in a dialog/view/floating window etc that you do this for.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Good day everyone,
I would like to know how to prevent a child window from moving from its original position when interecting with a mouse/keyboard. A good example of this would be Microsoft Visual Basic (6.0) form editor. The form in the designer window allows the user to change the width or height of the window but not the X/Y psoition at 0,0 or close to it.
|
|
|
|
|
try handling WM_MOVE and simply not passing it on to the controls window procedure
|
|
|
|
|
Actualy tried that and it still allowed it to move. What I did try and seem to work is handling the WM_WINDOWPOSCHANGING and provided the X and Y attibutes a constant value.
Thanks for your reply.
|
|
|
|
|
Hi all,
How can i add a Menu Bar to my dialog based application?.
Hope that anyone will help me.
With regards
Shibu
|
|
|
|
|
Create the menu, open dialog template in the resource editor and select menu from dropdown list on 'General' page.
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
or you can create the menu manually and call SetMenu() from within the dialogs OnInitDialog() handler.
this is useful if you intend to dynamically modify the top level menu items.
ps. whenever you call SetMenu() , msdn says you must follow up with a call to DrawMenuBar()
|
|
|
|
|
Hi all,
How can i detect mouse over a particular button say (IDC_BUTTON) programatically?
With regards
|
|
|
|
|
Handle WM_MOUSEMOVE .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Use subclass.
Have a look to http://www.codeproject.com/miscctrl/subclassdemo.asp
from our codemate Maunder.
regards.
|
|
|
|
|
I use internet sdk function to write a multi-threads program.
But I find only two or three threads can download http data,other threads is waitting.I want to know what limit the max download threads?The server or the client?
Hi
|
|
|
|
|
To the best of my knowledge, it is the bandwidth of your connection that is limiting the number of threads that are able to download data (actually, all of them are trying, so you can expect all the threads to complete their operations as the first ones stop consuming bandwidth). To prove this point, try using a server in your own LAN (which will provide much more bandwidth) or even within your local machine.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I am writting some code to add new buttons in a toolbar at runtime.
My problem:
When i create a new button, the toolbar is not big enough and the last one is no visible anymore. If i move the toolbar to another position in the window (manually, with the mouse), it resize itself automatically and all the buttons become visible again.
How to get the toolbar with the right size automatically , just after adding a new button ?
I try adding Invalidate() and AutoResize(), but it doesn't work.
void CMyAppView::OnAddNewModule()
{
CToolBarCtrl* pToolBarCtrl;
pToolBarCtrl = &(((CMainFrame*)GetParentFrame())->GetToolbar())->GetToolBarCtrl();
TBBUTTON tbButton;
tbButton.iBitmap = pToolBarCtrl->AddBitmap(1, IDB_MY_RUNTIME_ID);
tbButton.idCommand = MY_NEW_COMMAND;
tbButton.fsState = TBSTATE_ENABLED;
tbButton.fsStyle = TBSTYLE_BUTTON;
tbButton.dwData = NULL;
tbButton.iString = NULL;
if (tbButton.iBitmap==-1)
TRACE("I couldn't load the button image");
if (!pToolBarCtrl->InsertButton(1, &tbButton))
TRACE("I couldn't create the new button");
pToolBarCtrl->AutoSize();
} Thanks !
PD: I use ON_COMMAND_RANGE handler, to catch the new event with my predefined ID, thanks Saurwein
|
|
|
|
|
try calling ((CMainFrame*)GetParentFrame())->RecalcLayout();
i'm not sure that it _will_ work but CFrameWnd uses it alot internally when positioning controlbars.
|
|
|
|
|
YESSSSSSSSS!!!!!!!!
great ! it works !
Thanks a lot !
-----
Mit freundlichen Grüssen/Best Regards/Un cordial saludo.
Ing. José Manuel Hostalet Wandosell, Fraunhofer IPA, Abt.323/Robotersysteme
Nobelstrasse 12, D-70569 Stuttgart (Germany)
mailto:jose.hostalet@ipa.fhg.de, http://www.ipa.fhg.de
|
|
|
|
|
If we create a shared memory zone with CreateFileMapping(...) , we have to close it with UnMapViewOfFile(...) and CloseHandle(...) .
My question is this: Is the memory released properly doing just that? Or do I have to take some further action before closing the memory handle?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
From MSDN docs on CreateFileMapping:
To fully close a file-mapping object, an application must unmap all mapped views of the file-mapping object by calling UnmapViewOfFile, and close the file-mapping object handle by calling CloseHandle. The order in which these functions are called does not matter. The call to UnmapViewOfFile is necessary because mapped views of a file-mapping object maintain internal open handles to the object, and a file-mapping object will not close until all open handles to it are closed.
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
Hi All,
I need to create an application which disables the NT user account programmatically.How do I do this??Do I have to access registry settings from my program to perform this task?? I'm novice in this aspect,so detailed info would be required.
Can anybody help me,
Thanks,
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
Use the OpenService() function of NT.
Use its related functions to manipulate services.
Hope this helps.
Jeremy Pullicino
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
Hi,
Can you be a bit more specific.I din't get how to use this OpenService() function of NT for disabling a user account.Please explain it in detail
Thanks,
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
abhinarulkar wrote:
Learning is a never ending process of Life
In that case, take some time to learn how to use the function
Look for OpenService documentation in the MSDN - it is not very hard to use.
You are particularly interested in the ChangeServiceConfig.
Hope this helps.
Jeremy Pullicino
Professional C++ Developer
Done any hacking lately?
|
|
|
|
|
HI Abhi,
Use the foll function, its quite simple
NetGroupDelUser
|
|
|
|
|
Somebody PLEASE help me!!!
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q261003&
I found this article but it's incomplete on how to fully implement in my
application. In the example, is "CMyBrowser" an instance of "CHtmlView"?
Because :Exec is not a method of CHtmlView. Can someone
enlighten me on how to implement this code please?
Any assistance would be greatly appreciated.
Best Regards
|
|
|
|
|
Hi
Can anyone please tell me how do I color the Toolbar
Thanks,
San
|
|
|
|
|
How to display the data in mousemove event of mschart?
I need to display the value of series in mousemove event.
I need to draw crosshair in mouse move and if I have 4 series of line graph,I have to display the values at that instance for all the 4 series.
Any help would be appreciated.
Thanks in advance.
Be creative
Once your mind is streched by a new idea, it will never regain its original dimension
|
|
|
|