|
Hey,
I have appended a new menu item at the end of the existing menu
i.e after Help Menu.
Now i want to create its submenu tried not not successful.
Pls help me out
Regards,
Pankaj Sachdeva
|
|
|
|
|
See this thread "How to close the running appliaction" "Creating and Adding Menu at runtime" below the forum.
|
|
|
|
|
|
It was a syntax error;) oh I think you are a new asker.After make it whats problem what you are not successful?
|
|
|
|
|
I have appended a new menu item at the end of the existing menu
i.e after Help Menu.
Now i want to create its submenu using InsertMenu tried not not successful.
I basically want to create the submenu that is the main task
|
|
|
|
|
|
As we know,all the project based MFC has a main thread object theApp.
For some reason,I have to send messages to it,but how should I return messages to the posters?
Thanks.
|
|
|
|
|
kcynic wrote: For some reason,I have to send messages to it
That's fine.
kcynic wrote: but how should I return messages to the posters?
Well, it depends on the posters nature (for instance, it maybe the main thread itself).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Would you like to explain it more clearly?
I think I did not understand you very well.
Thanks
|
|
|
|
|
I think you should describe with more details your problem.
It isn't difficult to post messages to the main thread of an application. As result, the main thread will perform some actions, if you want the main thread to communicate with the message poster then the kind of the performed action will depend on the nature of the poster itself (for instance, if the main thread itself posted the message, the related answer maybe a function call; on the other hand, if the message posting happens in another thread then the main thread may answer by changing some shared data value, etc..).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I have thread which has a socket member,and I should using such thread to send data to the others in different windows.But if I simply pass the thread pointer there would something go wrong.So,I want to create the thread in the theApp.So,other dialog would send messages to it and also should get the returned messages from the theApp.
That is my task.
Thanks very much.
|
|
|
|
|
Hi,
I use a global mouse hook(WM_MOUSE_LL) to capture all mouse action.
This lead to my mouse delay and the mouse is not sensitive.
You'll feel very bad when you use move the mouse.
How can i deal it?
Or is there other smart way to capture mouse action?
I must capture all mouse action in my system,Like,
LRESULT CALLBACK MouseProc(int iCode,
WPARAM wParam,
LPARAM lParam
{<br />
process... ... <br />
return CallNextHookEx(m_hMouseHook, iCode, wParam, lParam) ;<br />
}
Thanks!
Avril-Sun
|
|
|
|
|
This link may help you out.
http://www.flounder.com/hooks.htm
I don't know how much effective it will be.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
|
Hi,
How can i close a running apllication through programming.
I have a application ,i want whenever i run my application MS-Outlook should be clode,if running.
How can i do this.
|
|
|
|
|
Send WM_CLOSE to that program.
|
|
|
|
|
But sir how can i catch the running OutLook.
|
|
|
|
|
|
I elborate the problem:
Whenever i run my Program.exe file .I should check for running OutLook.exe file.If OutLook.exe is running ,close it otherwise nothing.
|
|
|
|
|
You can use of FindWindow (or better use of EnumWindows instead FindWindow) to retrieves a handle to this program if its exist if its exist it return a HWND/CWnd* to this window and then use of SendMessage.
|
|
|
|
|
I am cunfused to passing the parameters.
When i run OutLook if Task Manager it shows OUTLOOK.EXE .So what should i pass in FindWindow(..,..);
|
|
|
|
|
This code is of MSDN about FindWindow
To check if the Microsoft® IntelliType version 1.x software is running, call FindWindow as follows:
FindWindow("MSITPro::EventQueue",NULL);
To check if the IntelliType version 2.0 software is running, call FindWindow as follows:
FindWindow("Type32_Main_Window", NULL);
but better use of EnumWindow instead FindWindow.
|
|
|
|
|
I use EnumWindows.
And if WM_CLOSE doesn't work, try WM_SYSCOMMAND with a wParam = SC_CLOSE, or something like that (explorer windows, like 'My Computer', close like that).
There probably is a better way, there must be, if u can afford to search.
|
|
|
|
|
hai...
for each and every process if its starts running then,the name like"outlook.exe" is getting displayed in task manager.
using "CreateToolhelp32Snapshot" you can able to take a snapshot for the process which are running in task manager.
then using this...you do string compare function with the "outlook.exe"...
if both are matches...
then for closing a process "Terminate process " API is available...
use that ....thats all....
|
|
|
|
|
D.Mani wrote: then for closing a process "Terminate process " API is available...
It's sad that you would even suggest this.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|