|
Thank you for your response, this certainly proves that there's always someone who knows more that can shame those arrogants that mocked those who knew less... great lesson.
|
|
|
|
|
Hi
Sorry to interfere with this discussion. As a novice programmer, I come to this boards to ask for advice about things that I don't know or don't understand. Very often I get invaluable help but unfortunately also very often I only get replies like this... "That would never work"... "Anyone coding like this should be fired"... etc etc etc. If we come to ask a question is not because we are stupid but because we don't have the knowledge, and actually whoever claims that he or she knows everything about C, C++, C#, etc. and is infallible MUST actually be fired.
Bottom line, if you want to help, make constructive comments, explain why things would work or wouldn't, provide sample code and refrain yourself from the impulse to riducule those who know less than you... there's always someone out there that knows more than you.
Cheers
Carlos
|
|
|
|
|
Is there a way to prevent a window within which some child controls( such as button, edit ect.)in it from being actived?
I created a custom window with a custom window procedure, and then I created some child controls (a exit control, a listbox control ect.) within it.
and I want to prevent this window from being actived (or says : I want to make the parent of this window to keep focus even I click anywhere within this window),
so I intercept the WM_MOUSEACTIVATE message and return MA_NOACTIVATE. by this way,
I can prevent this window from being activated when I pressed mouse whithin the client area of it. but when I clicked any child control within it,
the parent of this window was lost focus ....
In this scenario, what I need to do to prevent the parent of this window from losting focus when I click any child control within it???
Best regards!
JERKII, from china
Welcome to my site:
http://www.cntomorrow.com:3310
|
|
|
|
|
See if the WM_ACTIVATE or WM_ACTIVATEAPP messages are of any help.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
sorry, but I can't get any help from WM_ACTIVATE or WM_ACTIVATEAPP...
|
|
|
|
|
Why can't you get help from either of those messages?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Assume note pad is running. The API EnumWindows will return the window title
such as "Untitled - Notepad".
I am looking for an API that will tell me "notepad.exe" is running.
In short I am looking for the same information the task manager displays.
thanks
|
|
|
|
|
See the Process32First() /Process32Next() pair. There's also EnumProcesses() .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
Try using GetModuleBaseName() or GetModuleFileNameEx() through u can get handle of the process and the file name that is being executed.
"Don't forget to rate the reply, if it finds the solution for you".
|
|
|
|
|
|
How to get mouse position?
plz
/\|-||\/|/\|)
|
|
|
|
|
Provide a handler for the WM_MOUSEMOVE message. The position is in the LPARAM parameter.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
at last u came david thx
/\|-||\/|/\|)
|
|
|
|
|
Halawlaws wrote:
at last u came david thx
if you had asked this better from the beginning, you would certainly get the correct answer earlier...
void CDlgStatusBarDlg::OnMouseMove(UINT nFlags, CPoint point) {
CString s;
s.Format("X=%d Y=%d",point.x,point.y);
m_bar.SetPaneText(0,s);
CDialog::OnMouseMove(nFlags, point);
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
if you had asked this better from the beginning, you would certainly get the correct answer earlier...
The same question was asked here. No one responded.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
Does anyone know how to access a file's properties in C++? For example, I need to get the time stamp off of some files in my program. (Any other properties would be helpful for me in the future as well.)
Danny
|
|
|
|
|
Try GetFileAttributesEx() .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
File Management[^]:
GetFileSize, GetFileTime, GetFileAttributesEx, GetFullPathName, GetFileType, ...
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
I take it there's a header file that is needed for the above functions?
Danny
|
|
|
|
|
no, you don't need to include any other header. They are all already in the standard platform win32 sdk.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
marcdev wrote:
GetFileSize, GetFileTime, GetFileAttributesEx, GetFullPathName, GetFileType, ...
When using, for example, GetFileTime, MSDN says I need to get a handle to the file by opening it with GENERIC_READ only. I tried both fstream.open() and fopen() ways of opening the file, both with read only selected. It doesn't seem to work (The call to GetFileTime always fails). How am I to get GetFileTime() to work?
Danny
|
|
|
|
|
You need to open the file with the CreateFile Win32 function and it will return a handle to use with the other functions.
Don't intermix the different stream, FILE*, etc. families of file function calls together.
|
|
|
|