|
I've test this, but gives an error on following code line.
CPallini wrote: if ( _tcscmp(argv[1], _T("sum") == 0 )
Error is,
'_tcscmp' : cannot convert parameter 2 from 'bool' to 'const char *'
I appreciate your help all the time...
Eranga
|
|
|
|
|
OOOPS...My bad
change
Eranga Thennakoon wrote: if ( _tcscmp(argv[1], _T("sum") == 0 )
into (mind the closing brace around the strcmp function)
if ( strcmp(argv[1], "sum") == 0 )
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.
[my articles]
|
|
|
|
|
Wow, it's work. Thanks a lot pal.
I appreciate your help all the time...
Eranga
|
|
|
|
|
I am a beginner who wants to restore the main window of a clock program that resides in the System Tray when running. What I want to do programatically is done normally by right clicking on the clock program's icon in the System Tray, then selecting "Restore Main Window" from the context menu.
I have tried many things, and the closest I can get is using SetForegroundWindow, which will only work when I have already selected "Restore Main Window" from the context menu and then minimized the restored main window.
I think I must be missing some fundamental concept about what I am trying to do.
Consider the pseudocode below...
void MyApp::OnLaunchSysTrayApp<br />
{<br />
CWnd*m_hWnd = FindWindow(NULL, "System Tray Application Name")<br />
if (m_hWnd)<br />
{<br />
m_hWnd->SetForegroundWindow();
<br />
BOOL m_bIconic;<br />
m_bIconic=m_hWnd->IsIconic()<br />
if (m_bIconic)<br />
{<br />
} etc.<br />
}<br />
}<br />
<br />
I would appreciate any suggestions about how I might achieve my goal, or information about whatever basic concept I (probably) currently fail to understand.
Thank you.
"For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash
|
|
|
|
|
Too much of this depends on the particular application to usefully answer.
Maybe the clock window is destroyed, or maybe it is the main window for the application but is hidden. Maybe, maybe...
In short, I don;t think there is a generic way of doing this.
Iain.
|
|
|
|
|
Try posting the SW_RESTORE command to the application.
|
|
|
|
|
Dear all
anyone know how to stop show when output of screen displays full screen..which function is available? thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
Can you more explain,please?
|
|
|
|
|
thanks, i mean when my program is runing, screen of output will display content continuously, no stop, so i want to see something, but passed already, how to do the screen will stop after display one full screen...thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
How do you show the content? What kind of application is yours?
|
|
|
|
|
i use win32 console application...when my program is runing..it will display something
Li Zhiyuan
5/10/2006
|
|
|
|
|
The only way of stopping the display is simply not to display anything in your code.
You'll have to manage it yourself: in your code, wait for the user to press a key before going to the next step.
|
|
|
|
|
In addition to Cedric Moonen said...
You can use GetConsoleScreenBufferInfo for getting the screen size.
|
|
|
|
|
Can't you just scroll the console window up (with the mouse) to see the older text?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi Everybody...
I have a query on SDI implementation. How can I make a SDI Document not to be dragged.
Thanks in advance
Sairam
|
|
|
|
|
What do you mean ? Could you be more precise please ?
|
|
|
|
|
We can move the window with mouse clicking on Tittle bar. I want to restrict this..
Thanks & Regards
Sairam
|
|
|
|
|
1/ There may be good reasons for resticting the size of an application. But the position? I officially don't want to use it.
2/ Have a look at WM_WINDOWPOSCHANGING to reset window movement, or override WM_NCHITTEST to tell windows this is not a draggable window bit.
3/ See (1) again. You'd better have a VERY good reason to do this, or you'll get hate vibes from customers.
Iain.
|
|
|
|
|
Hi all,
What I know about CFile::GetFileTitle(); that it gives the title(name without the extension) of a CFile. So what is happened here in this code. I found this on MSDN.
Try
{
CFile sysFile(_T("\\My Documents\\FOO.DAT"), CFile::modeRead);
_tprintf(_T("Path is : \"%s\"\n"), (LPCTSTR) sysFile.GetFilePath());
_tprintf(_T("Name is : \"%s\"\n"), (LPCTSTR) sysFile.GetFileName());
_tprintf(_T("Title is: \"%s\"\n"), (LPCTSTR) sysFile.GetFileTitle());
sysFile.Close();
}
CATCH(CFileException* pEx)
{
pEx->ReportError();
}
Output
Path is : "\My Documents\FOO.DAT"
Name is : "FOO.DAT"
Title is: "FOO.DAT"
Here output for Title is FOO.DAT, is it correct.
Here is the link I get it on MSDN Library 2004.
ms-help://MS.MSDNQTR.2004JUL.1033/dv_wcemfc4/html/aflrfcfilecolcolgetfilename.htm
I appreciate your help all the time...
Eranga
|
|
|
|
|
Have you looked at MSDN to find out what it says GetFileName and GetFileTitle actually DO?
Then you'll be able to answer the question yourself.
Iain.
|
|
|
|
|
Eranga Thennakoon wrote: Here output for Title is FOO.DAT, is it correct.
That depends on how you've got Windows configured to show file extensions. The GetFileTitle() method is simply respecting that setting. If you don't want the extension displayed, regardless of Windows' setting, you'll have to remove it yourself.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for replay. I'll go through the MSDN and still have some questions. I'll be here if I couldn't clear it up.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Dear all
the following is my part code, when i run, d[m] is minimum value of an double array named c of 150x3. actually total of num1, num2 and num3 are 150..but here why num1 = 150, num2 =151,num3=151...
for (int m = 0; m < 150; m++)
{
if ( d[m] == c[m][0])
sum1 = c[m][0];
sum1 = sum1 + 1;
num1 = num1 + 1;
if ( d[m] == c[m][1])
sum2 = c[m][1];
sum2 = sum1 + 1;
num2 = num1 + 1;
if (d[m] == c[m][2])
sum3 = c[m][2];
sum3 = sum1 + 1;
num3 = num1 + 1;
}
cout<< " "<< num1 << " " << num2 << " " << num3 << endl;
cout << " " << sum1 << " " << sum2 << " " << sum3 << endl;
but the result is following:
num1 num2 num3
150 151 151
sum1 sum2 sum3
1.87 2.89 2.89
Li Zhiyuan
5/10/2006
|
|
|
|
|
This looks wrong:
li zhiyuan wrote: sum2 = sum1 + 1;
num2 = num1 + 1;
sum3 = sum1 + 1;
num3 = num1 + 1;
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
thanks, so sorry...i corrected already, but the problem is : num1 = num2=num3 =150....actually total of num1, num2 and num3 are 150..thanks
Li Zhiyuan
5/10/2006
|
|
|
|