|
can you tell me how to do this
Ex: I want to close "notepad.exe" with wm_close
|
|
|
|
|
If your target applciation has a window, you can find your target application using FindWidnow() API.
This will return the window handle of the target application. Using that handle you can send WM_CLOSE message.
Ex: HWND hWnd = ::FindWindow( NULL, "TargetAppName" );
::SendMessage( hWnd, WM_CLOSE );
akt
|
|
|
|
|
Thank you very much. This works fine.
But say if I have 2/3 instances of same application, how do I extend this to close particular window?
|
|
|
|
|
HI
anybody know how to remove Deprecation error.I m using mfc application that has some multilingual conversion.
i have already tried _CRT_SECURE_NO_DEPRECATE in stdAfx.h but it did not work.Is there anything else to workaround.
Varun Bhatt
|
|
|
|
|
What's the exact error message ? If you want to remove a depecrated error, the best way is probaly to fix the issue, and not getting rid of the error (thus, changing the function which causes the error by the non-deprecated version).
|
|
|
|
|
"Deprecate" errors usually result in warnings as far as I know. May be you need to change the warning levels? But as Cedric said, post the exact error message you are getting. Don't be stingy in providing information.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
VuNic wrote: "Deprecate" errors usually result in warnings as far as I know.
Yes, it's a 'warning ' error, you know...
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
lol
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
I am writing a visual c++ dll for .NET CF.
Can anyone help to teach me how to get the system time when I call a function in a dll and convert the result into char*?
Thank you very much.
|
|
|
|
|
You can use time_t & asctime (time.h)
time_t tCurrentTime;
struct tm * tmInfo;
time ( &tCurrentTime );
tmInfo = localtime ( &tCurrentTime );
cout<<asctime(tmInfo);
If you are using MFC, you can simply use CTime.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
modified on Thursday, March 5, 2009 1:27 AM
|
|
|
|
|
Thank you for your reply.
I get this after I put your code into my c++ smart device MFC dll
error LNK2019: unresolved external symbol asctime referenced in function
error LNK2019: unresolved external symbol localtime referenced in function
error LNK2019: unresolved external symbol time referenced in function
|
|
|
|
|
Looks like it's a different story in WinCE. time.h functionalities are not implemented in WinCE runtime. So it looks we need to use these APIs and build our own display format:
GetSystemTime[^]
SYSTEMTIME[^]
Use the first link to get the structure filled. Using the second link, you can make out your own formated string by taking the values out of it.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
After i have completed adding all the contols i need. Then i have added the button and the on clicking that button i have created the dialog box. But when i have excuted no dialog box is being displayed.
how to get the value stored in first dialog box to the second dialog box???
thanks a heap..
|
|
|
|
|
I don't get your question. But you want to communicate with the parent dialog, you can use custom Messages and send it through parent->SendMessage(Your_msg).
We have a neat & simple article for dialog communications. Here[^]
But, explain your question better.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Hi.. can I add two rtf string such that formatting of two rtf string remains intact. Do I need to write rtf parser or some defined function is there.
Thanks
amit
|
|
|
|
|
I need to plot a graph from the data stored in the notepad in MFC.The data stored in notepad is time information and the voltage values for 16 signals.
thanks a heap...
|
|
|
|
|
For the graph part, you can take a look at my sig, I developped a charting control. Maybe it could be useful for you.
febinelizabeth wrote: The data stored in notepad
Notepad is a program, it doesn't "store" any information. What you probably meant is that your information is stored in a file. Then what you have to do is open that file and parse it to retrieve the information you need. There are several options there, but I would suggest using ifstream (the C++ way).
|
|
|
|
|
How to parse the information,how to get the time and voltage values for plotting the graph.
Any examples...
Quick help is appreciated..
Thanks a heap..
|
|
|
|
|
That really depends on the format of your file.
You can look for tutorials about std::ifstream. This lets you read formatted data from a file.
|
|
|
|
|
I have tried with the charting control.
"Add a custom control to your dialog resource, open the Properties of the control, and specify ChartCtrl for the Class attribute. To avoid flickering on the scrollbars, you have to set the WS_CLIPCHILDREN style (0x02000000L), as shown on the image."
I don't know how toadd the custom control. I am working in VC++ 6.0, I have clicked on the insert->dialog->custom but i am not able to get any such kind of the window.As I am working in MFC ,I don't know where should I include these coding
"CChartLineSerie* pLineSerie = dynamic_cast<CChartLineSerie*>
(m_ChartCtrl.AddSerie(CChartSerie::stLineSerie));
CChartPointsSeries* pPointSerie = dynamic_cast<CChartPointsSerie*>
(m_ChartCtrl.AddSerie(CChartSerie::stPointsSerie));
" ....Please help me..
Thanks a heap.....
|
|
|
|
|
Febin Elizabeth wrote: I don't know how toadd the custom control. I am working in VC++ 6.0, I have clicked on the insert->dialog->custom but i am not able to get any such kind of the window
I replied in the other thread you started this morning.
Febin Elizabeth wrote: As I am working in MFC ,I don't know where should I include these coding
Well, that really depends on what you want to do... Usually, initialization of the chart control is done in the OnInitDialog function of your dialog class. If you only have static data (everything is known when the program starts and will never change), then you can also populate the control in the OnInitDialog function.
|
|
|
|
|
i have one exe it will run SWF.
when i run that exe file it displays the .swf file.but when i call this exe for button click in MFC it doesn't show that .swf.
What is a reason?
I have called exe for button click with
WinExec("c:\\app\\Lock.exe", SW_SHOWNORMAL);
am also tried with shellexecute.
|
|
|
|
|
You question is not clear, but I guess you are trying to open a SWF file. If you don't have a default viewer associated. It won't open. You need to specify the associated application as well.
ShellExecute(NULL,"open", "YourFalshViewer.exe", "c:\\YourSWF.swf",NULL, SW_SHOWNORMAL);
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
The history is repeated you answered to this question two or three years ago of course you said to OP that he or she needs to a activex.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I think there was an argument over Createprocess & ShellExecute also. Not sure. lol
Good memory dude!
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|