|
How do i get a tooltip displaying the coordinate values of the client view area next to the cursor while moving the mouse?
|
|
|
|
|
Capture mouse when it is in your window.
Process WM_MOUSEMOVE notificaiton messages.
Decode lParam (already in client coordinates)
Update text in ToolTip window
Move your ToolTip window to desired location
Have fun
|
|
|
|
|
Hello,
I tried the below line to make my dialog start at a certain position, with certain size, and prevent the user from moving it afterwards.
SetWindowPos(&this->wndTopMost,StartXPos,StartYPos,DlgWidth,DlgHeight,SWP_NOSENDCHANGING|SWP_NOZORDER|SWP_SHOWWINDOW);
There is no problem with the start position and the size, but I can move it. Also there is some problem with CClientDC::LineTo() function. It sometimes draws after SetWindowPos is called, and sometimes not.
I also want to write a function to enable moving again.
Thanks in advance...
|
|
|
|
|
I'm sure there is an article in the Dialogs section somewhere about this, but off the top of my head...
Handle the WM_NCHITTEST message (OnNcHittest). If you want the normal behaviour, fall through to the standard behaviour.
If you want the dialog locked, return HTCLIENT.
...
ON_WM_NCHITEST()
...
UINT CMyDialog::OnNcHitTest( CPoint point )
{
if (m_bLocked)
return HTCLIENT;
return CWnd::OnNcHitTest (point);
}
Tada!
Iain.
|
|
|
|
|
WM_NCHITTEST did the trick.
thanks a lot!
caykahve
|
|
|
|
|
Override WM_MOVING and WM_SIZING to control how the window can be moved (or resized) by the user.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
i am encountering the following problem when making a dll in VC++ which contains functions using apache API.I have added the libraries available with apache installation to the input lib's.it is giving error in linking.
/*******
testfindna.obj : error LNK2001: unresolved external symbol _ap_log_error
testfindna.obj : error LNK2001: unresolved external symbol _ap_rwrite@12
testfindna.obj : error LNK2001: unresolved external symbol _ap_send_http_header@4
testfindna.obj : error LNK2001: unresolved external symbol _ap_set_content_length@8
testfindna.obj : error LNK2001: unresolved external symbol _ap_reset_timeout@4
testfindna.obj : error LNK2001: unresolved external symbol _ap_get_client_block@12
testfindna.obj : error LNK2001: unresolved external symbol _ap_hard_timeout@8
testfindna.obj : error LNK2001: unresolved external symbol _ap_should_client_block@4
testfindna.obj : error LNK2001: unresolved external symbol _ap_setup_client_block@8
Debug/testfindna.dll : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.
*******************/
thanks in advance
pi
|
|
|
|
|
You need to link with the library the contains the mentioned functions (e.g., _ap_log_error ).
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
And, if you find you are already linking with the appropriate library, then you need to accomodate the function declarations like this:
extern "C" {<br />
#include "ApacheApiHeader.H"<br />
}
So the C-Style function names don't get mangled.
|
|
|
|
|
I am working in VC++ for the first time.I suppose adding the lib's to project settings->Links->input lib's and setting the path of additional lib's would be enough.i have added the provided lib's over there and still it is not working.if i have to do anything else please help me.
actually they have provided some '.so' files with the installation and these '.so's does contain the functions.but i don't have any idea as to if these can be used in windows or how to use it
|
|
|
|
|
ALOK
EVEN IF I USE _declspec(dllexport) ,it is of no use to define the exported function with extern"C".AS THERE IS NO INTERFACE PROBLEM BETWEEN DLL EXTENSION AND APPLICATION
but it is must in DLL Regular as the interface uses "C".IF I AM WRONG ALOK PLS RECTIFY IT.
I HAVE DOWNLOADED AN .EXE FILE USING OPENURL().NOW I HAVE TO DO SILENT SET UP(ie.,IF I DOWNLOAD A WINZIP FILE ,WHILE SETUP IT SHOULDNOT ASK ANY INFORMATION FROM USER)I USED CREATE PROCESS FOR AUTORUN BUT IT IS ASKING FOR THE SETUP OF THE FILE
|
|
|
|
|
on behalf of thatsalok,i m posting his reply...
sunit5 wrote:
EVEN IF I USE _declspec(dllexport) ,it is of no use to define the exported function with extern"C".AS THERE IS NO INTERFACE PROBLEM BETWEEN DLL EXTENSION AND APPLICATION
but it is must in DLL Regular as the interface uses "C".IF I AM WRONG ALOK PLS RECTIFY IT.
why are you concerning about 'C',when you are developing app in MFC?, just go for DEF file Solution with ordinal
sunit5 wrote:
I HAVE DOWNLOADED AN .EXE FILE USING OPENURL().NOW I HAVE TO DO SILENT SET UP(ie.,IF I DOWNLOAD A WINZIP FILE ,WHILE SETUP IT SHOULDNOT ASK ANY INFORMATION FROM USER)I USED CREATE PROCESS FOR AUTORUN BUT IT IS ASKING FOR THE SETUP OF THE FILE
you have to use custom zip extractor , search for zlib wrapper here
keep smilling.....b'coz smile is the shortest distance between people....
|
|
|
|
|
Hello,
I have an application that has a simple dialog with CListCtrl windows.
I have an Microsoft IME editor for Japanese with suitable Font enabled on my
machine.
But I want to application is supposed to display Chinese and Japanese each column in one CListCtrl.
for example first column language setting is Japenese, second column language setting is Chinese in CListCtrl.
Can anyone point me as to how I can achieve this ?
Thank You
|
|
|
|
|
Hi!
I have an application that starts a service application when it starts. This works when I start the application in an admin account, but if I run the program in a non-admin account I'am not able to start the service with the method StartService().
Here is my code:
void startmyService()
{
SC_HANDLE myManager;
SC_HANDLE myService;
myManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
myService = OpenService(myManager, "myService app", SERVICE_ALL_ACCESS);
if (myService == NULL)
{
return false;
}
if (!StartService(myService,0,NULL))
{
return false;
}
CloseServiceHandle(myService);
return true;
}
|
|
|
|
|
Your account does not have the privilege to start a service.
Impersonate an account that has the privilege and then RevertToSelf when done.
|
|
|
|
|
I need following information from Windows Machine.
1.Total CPU utilization
2.Total CPU user time
3.Total CPU sys time
4.Total CPU idle time
5.CPU load average (1, 5, 15min)
6.CPU run queue length
7.# of Active processes
8.Interrupts per second
9.System calls per second
10.CPU utilization of the custom process 1, 2, …
Which API can use to get the above info? Pl Give an Example.
Advance Thanks,
|
|
|
|
|
Well, maybe most of information that you need can be retrieved from the performance counters.
I published a sample How to get CPU usage by performance counters (without PDH)
. In that projects i wrote a general class that gets counters by object index,counter index and instance name.
Look at my code how i use that class and try to use it for retrieving more information.
|
|
|
|
|
hiii....
this is very interesting......wht i am trying to do is to RECREATE a window (it can b any apllication window) by grabbing all its properties n properties of all its childs..... on another REMOTE TERMINAL......
but i hav had limited success till now....means i am able to recreate only some of the windows.......i hav tried creating the NOTEPAD and CALCULATOR windows but hav failed in the process...
i am using the CreateWindowEx function do it...and other callback functions to obtain the properties...
can neone plzzz suggest any reasons why this is not possible??? or is it?
i need some urgent replies for this....any help is welcome...
regards,
kedar.
|
|
|
|
|
Hi,
I am attaching a piece of code here:
CTest is derived from CWnd.
LRESULT CTest::WndProc(HWND hWnd, UINT message,WPARAM wParam, LPARAM lParam)
{
CWnd *pWnd;
// create a new instance if the window handle is not yet associated
// with a CTest object
if ((pWnd = CWnd::FromHandlePermanent(hWnd)) == NULL)
{
pWnd = new CTest();
pWnd->Attach(hWnd);
}
// otherwise, let default message processor handle it
return ::AfxCallWndProc(pWnd, hWnd, message, wParam, lParam);
}
The WndProc() gets invoked for the first time for the WM_NCCREATE message.
The control passes inside the if block and a new object is instantiated. The CWnd::Attach() puts the (CWnd,HWND) into the CHandleMap pMap.
For the consecutive messages the FromHandlePermanent() returns the valid CWnd pointer from the CHandleMap.
After a sequences of messages, for a particular WM_PAINT message, the FromHandlePermanent() returns NULL!!! For no reason!!! The CWnd::Detach() was never called nor the CHandleMap::RemoveHandle(). Then how is it that the entry got deleted from the CHandleMap when the hWnd is still the same and valid???
Can someone solve my problem???
Thanks,
Reji
|
|
|
|
|
Hello,
Can any 1 pls tell me how to convert WMV to MPEG2 using graphedit so that i can use directshow in my application to do the conversion. Cud someone please tell me where can i find the encoder codec for mpeg2.
Any web link also will be helpful.
Thanks in advance!
John.
|
|
|
|
|
I need to write a application that has to launch any process and track all the Socket messages sent by the child process.
How to do that. Is there any socket function available that can track all the child process outgoing socket messages.
|
|
|
|
|
Good people,
If anybody seen any links on other good people’s experience on migrating large VC++ 6.0 projects to .NET, could you please send the links to me.
Thanks,
Serge
|
|
|
|
|
It comes down to how good your programming team is. A lot of stuff that compiled in VC6 does not compile in VC7, because of improvements to the standard adherance. So, if the project is written in good C++, then fine. If the programmers leaned on old VC hacks, then you could have some work in front of you.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi Christian,
Considering changes to the compiler, I completely agree with your comment; but there’s more than just a compiler: changes in MFC between version 6 and version 7. Just a couple of them to give you an idea on the amount of work when migrating large MFC based projects from VC6 to VC7.
1. Changes in CFile class interface:
virtual DWORD CFile::GetLength( ) const; // MFC6 (Visual C++ 6.0)
virtual ULONGLONG CFile::GetLength( ) const; // MFC7 (.NET 2003)
so that compiling code like this:
CFile f;
DWORD dwLength = f.GetLength();
will now produce compiler warnings on loosing data; and certainly, this kind of warnings can’t be ignored. Add millions user-defined specialisations of the CFile class in a large MFC based project to complete the picture (actually, it is a good example of when inheritance bites and aggregations should be used instead);
2. Changes in CTime class: in the interface (similar to the 1.) and in size: size of objects of the CTime class is now 8 bytes, instead of 4 bytes; our software serialises objects of the CTime class through sockets; therefore the backward compatibility issue. The change in the CTime class breaks backward compatibility with the legacy systems that can’t be upgraded to run applications built under VC7 with MFC 7; even our non-legacy systems can’t be upgraded in one go, so this backward compatibility issue will exist for a transition period of time.
Also consider the backward compatibility requirement (support for both VC6 and VC7 for a transition period of time) so source code now looks like this:
CFile f;
#if _MFC_VER >= 0x0700 // represents MFC version 7 and later
ULONGLONG llLength = f.GetLength();
#else
DWORD dwLength = f.GetLength();
#endif
and requirements for unit, build, factory etc. testing for two versions - so you’ve got the picture…
Serge
|
|
|
|
|
Oh, OK. I use standard library components where-ever possible, I don't use anything like CArray, or CFile. As a result, I've not been exposed to these sort of problems. I've moved a bit of code from VC6 to VC7, and I only had one problem, and I knew beforehand I would. I once used an iterator as a pointer, which was dumb, but I felt petulant about dereferencing an iterator and then getting the returned item's address, as in &(*it); But you're obviously more exposed to Microsoft changes between versions. I wish you luck
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|