|
does anyone of you know what message will be posted when a system is logged in?
if so, can you please be so kind and respond me.
thanks in advance!
thanks to one and all who respond to the questions posted here!
Shalini nair
|
|
|
|
|
As far as I know, the system doesn't send any notification upon login. But, upon logoff, it sends.
Could u tell me, why this concept is needed?
Come online at:-
jubinc@skype
|
|
|
|
|
What exactly you want to do?
|
|
|
|
|
|
I want to check that the "1234.EXE" is running or not. (This program have no windows),if so I will go to some job...
What's function use for this issue?
|
|
|
|
|
Use CreateToolhelp32Snapshot . Refer example[^] from MSDN .
|
|
|
|
|
|
I'm having a problem sending a message from one window to another in my (Win32) application. A little background:
1) It's a dialog based app
2) It consists of a tab control and several child window dialogs
I want to send the text of an edit control from one tab/child window to another tab/child window's list box using:
SendMessage(hwnd, LB_ADDSTRING, 0, (LPARAM) szString);
However I can not get them to communicate.
I can't figure this out (never attempted it before). I have a single function handling all messages of each child window of the tab control. Everything works great as long as I'm updating the window/tab in view.
Can anyone point me in the right direction? Thanks in advance.
|
|
|
|
|
You cannot do that with a string. The string is in the memory of your process, all that you are sending is the address, which the second process will not be able to read. To send a string send the WM_COPYDATA message instead. But this will not allow you to add it to a listbox like you are trying.
|
|
|
|
|
He doesn't mention two windows from two processes here.
|
|
|
|
|
Make sure your message handler is prototyped as follows:
in the header file:
afx_msg LRESULT OnHandleMyMessage(WPARAM wParam, LPARAM lParam);
and in the cpp file:
BEGIN_MESSAGE_MAP(CMyClass, CDialog)
ON_MESSAGE(LB_ADDSTRING, OnHandleMyMessage)
END_MESSAGE_MAP()
LRESULT CMyClass::OnHandleMyMessage(WPARAM wParam, LPARAM lParam)
{
return 1L;
}
Also, you should call PostMessage unless you need to wait for the message handler to return.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks for the reply. I'm quite new at coding and can't quite decipher what you provided, but are you suggesting I subclass the control?
|
|
|
|
|
He means, make sure you have correctly configured the message handler. But this is only valid if you are using MFC.
|
|
|
|
|
I see. I'm using Win32. Is there a workaround for this?
|
|
|
|
|
Not familiar with Win32, If you can, add something like the following:
BOOL MyDialog::PreTranslateMessage(MSG* pMsg)
{
// catch any WM_USER messages
if (pMsg->message == WM_USER)
{
// see if it's your message
if (pMsg->wParam == LB_ADDSTRING)
{
... process the message ....
.....
|
|
|
|
|
georgiek50 wrote: SendMessage(hwnd, LB_ADDSTRING, 0, (LPARAM) szString);
What value does this function returns ?
I assume hwnd is handle to target list box.
|
|
|
|
|
CMyListCtrl derives from CListCtrl. In CMyListCtrl, I must decide how to subclass CHeaderCtrl:
<br />
void CMyListCtrl::PreSubclassWindow()<br />
{<br />
CListCtrl::PreSubclassWindow();<br />
CHeaderCtrl* pHeaderCtrl = CListCtrl::GetHeaderCtrl();<br />
if (pHeaderCtrl && pHeaderCtrl->GetSafeHwnd())<br />
m_HeaderCtrl.SubclassWindow(pHeaderCtrl->GetSafeHwnd());<br />
}<br />
Everything seems good, but when CMyListCtrl is dynamic created, or created without visible syle, the pHeaderCtrl returned from CListCtrl::GetHeaderCtrl() is null,so subclass CHeaderCtrl failed!
now, I solved the problem, but I don't satisfied.
<br />
void CMyListCtrl::OnShowWindow(BOOL bShow, UINT nStatus) <br />
{<br />
CListCtrl::OnShowWindow(bShow, nStatus);<br />
<br />
if (bShow && !m_HeaderCtrl.GetSafeHwnd())<br />
{<br />
CHeaderCtrl* pHeaderCtrl = CListCtrl::GetHeaderCtrl();<br />
if (pHeaderCtrl && pHeaderCtrl->GetSafeHwnd())<br />
m_HeaderCtrl.SubclassWindow(pHeaderCtrl->GetSafeHwnd());<br />
}<br />
}<br />
Is there any other better resolvents?
thanks
best regards
|
|
|
|
|
How about in the OnCreate for the CListCtrl.
That way, you get to subclass even if the list control window is never shown, if that matters or not.
From MSDN:
The CWnd object receives this call after the window is created but before it becomes visible. OnCreate is called before the Create or CreateEx member function returns.
Override this member function to perform any needed initialization of a derived class.
The CREATESTRUCT structure contains copies of the parameters used to create the window.
|
|
|
|
|
thanks for your idears.
but when CMyListCtrl is based on a dialog with template, OnCreate function is not called at all!
|
|
|
|
|
In that case use:
OnInitDialog is called just before the dialog box is displayed. You must call the default OnInitDialog handler from your override — usually as the first action in the handler. By default, OnInitDialog returns TRUE to indicate that the focus should be set to the first control in the dialog box.
instead.
|
|
|
|
|
Excuse me, do you means overwriting OnCreate or OnInitDialog function of the dialog
which CMyListCtrl is based?
but CMyListCtrl will be a common control, others who want to use it will just need
to replace CListCtrl with CMyListCtrl, no matter how and where the control is created,
additional code is annoying!
best regards!
-- modified at 4:53 Wednesday 31st January, 2007
|
|
|
|
|
Sorry about that, I lost track of the thread's main goal - to handle subclassing the header control within the CList control itself.
|
|
|
|
|
Hi All,
When I double-click on a member function in the Workspace view, I get taken to the wrong place, usually in the wrong file! Any ideas on how to fix this please?! (Using VC++6.)
|
|
|
|
|
Close your project and then delete the .ncb, .aps, and .clw files.
Re-open the project and you should be OK.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi All
I have one DLL in which there aare some exported function.
Now I am using implicit linking with my console application for this DLL.
I have added .lib file to my console application.
Now my application works only when my Dll is available in Windows/system32.
I tried to load the dll using LoadLibrary also.
But it is giving me the same error.
Moreover now I am not able to delete the Dll from the folder where it is located.
I have used dependency utility and it is showing me red mark on DLL.
Can anybody help me in this regard.
1) How to delete DLL from folder.
2) Where to place the DLL(or load dynamically) for console application to access the exported function.
|
|
|
|