|
toxcct wrote: WM_SYSCOMMAND.
Overriding the WM_SYSCOMMAND is the best way if one should execute some code before an app is being minimized. But the WinKey+D combination will not send your application this message!
toxcct wrote: also, the IsIconic() function is there to know if an application is minimized...
The op has a two-staged problem. At first, he must detect WinKey+D. And then, he must minimize it. I suggested him how to detect WinKey+D. He could add a handler which would be executed while this combination is pressed. Now, the second stage is to put the code within this handler, which sends his app into the system tray.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
...formerly known as brahmma
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: At first, he must detect WinKey+D
i'm absolutely not sure of this.
here is what I'm thinking he has (but as long as he didn't replyed to my question, I can't know for sure).
he implemented a "Go To tray" function in his application. but he certainly throws his Apps to the tray when selecting that action on a Menu or with a button.
but what he wants is sending his apps to the tray whenever the application is minimized.
Win+D is a Windows implementation to show the desktop. it throws a Minimize event to every application in the taskbar.
so the OP doen't have to know that it is a Win+D, but only that the application is told to minimize (then, to the tray)...
get me ?
|
|
|
|
|
toxcct wrote: so the OP doen't have to know that it is a Win+D, but only that the application is told to minimize (then, to the tray)...
I agree, although it should probably be WM_SIZE /SIZE_MINIMZED that is being looked for instead.
"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
|
|
|
|
|
toxcct wrote: he implemented a "Go To tray" function in his application. but he certainly throws his Apps to the tray when selecting that action on a Menu or with a button.
Yes. I am telling the op that he has to capture Win+D and execute the same code to send his app to the tray in response. Because his app is currently not reacting to Win+D, which is what his problem is. You may want to override OnSysCommand like this to verify it:
void CDialogDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if(nID==SC_MINIMIZE)
AfxMessageBox(_T("Minimizing!"));
}
Pressing the minimize button will display the message. But if you press Win+D, the control never reaches here, but the app goes minimized.
toxcct wrote: Win+D is a Windows implementation to show the desktop. it throws a Minimize event to every application in the taskbar.
What exactly do you mean by minimize event? Windows won't throw any such minimize event when Win+D is pressed!
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
...formerly known as brahmma
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: But if you press Win+D, the control never reaches here, but the app goes minimized
so what more does he need ?
he puts his "go to tray" code in the minimizing event handler, no matter if it is a Win+D, a Win+M or any other way to minimize an application !
|
|
|
|
|
OMG, tox you are not getting it. His app is not responding to Win+D (see his original msg), for some reason and that's why I asked him to trap separately and react to it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
...formerly known as brahmma
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Mohammad Khodaea wrote: I want to send my dialog box to the system-tray...
Are you referring to the taskbar notification area?
"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
|
|
|
|
|
Mohammad Khodaea wrote: Since my dialog has no border (it has no caption) and subsequently it has no minimized property in the dialog properties, I don't know how to handle the message.
This would be trivial for a "normal" dialog box. I added the WS_MINIMIZEBOX style to one of my dialogs, and I could then respond to WM_SIZE and call Shell_NotifyIcon() appropriately. Are you indicating that this has not worked for you (I assume so but just wanted to be sure)?
"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
i run a thread to show some line in edit box and in every second thread add one line but i want to show only last added ten lines in edit box,how is this possible
thank you
|
|
|
|
|
If I understand it right, your question boils down to: "How can I update the contents in an edit box?" And the answer is, with the help of a member variable.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
...formerly known as brahmma
Codeproject.com: Visual C++ MVP
|
|
|
|
|
hi rajesh
you r absolutely right.can u tell me with the help of some code
|
|
|
|
|
There is no serious coding. Add a member variable to your edit control and name it as m_str . Now, you can alter the value of this variable like: m_str = _T("some new value"); and then call UpdateData(false); to reflect it on the screen.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
...formerly known as brahmma
Codeproject.com: Visual C++ MVP
|
|
|
|
|
i think u r not understanding my problem.i am able to show string in the edit box.but my actual problem is that in every one second i am adding on line.and only want to show 10 lines means i want to erase the one oldest line when the one new line is inserted
|
|
|
|
|
rajneshmalik wrote: and only want to show 10 lines means i want to erase the one oldest line when the one new line is inserted
Use a CStringList to accomplish the same.
Look at CStringList::RemoveHead() function. Your task would become easy with it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
...formerly known as brahmma
Codeproject.com: Visual C++ MVP
modified on Tuesday, January 08, 2008 9:44:03 AM
|
|
|
|
|
How about keeping the 10 lines in a CStringArray (or similar) object instead? Then the edit control can be updated from this object. Does this sound plausible?
"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
|
|
|
|
|
can i have a check box in the menu pane? if yes then how do i do it?
|
|
|
|
|
have you looked here[^] ?
|
|
|
|
|
yes i just did that now.. what i want is not there in the list of examples. i wnat to add the checkbox where fileopen and print option is there. is it possible?
|
|
|
|
|
its actually not menu pane. its the tool bar. and i dint see any of the articles in the given link. any other leads?
|
|
|
|
|
any leads to the above mentioned query. i need to know how to add a checkbox in the tool bar.
|
|
|
|
|
hi
i have a application to call a object in all classes.
how to make it . help me
k.guru moorthy
|
|
|
|
|
huuu, what ????
which classes ?
which object ?
what have you tried so far ?
|
|
|
|
|
You'll need to be more specific. What do you mean call an object in all classes. Functions get called on instances of classes. Do you want to call all functions on an instance or the same function on all instances or the same name function on instances of different classes?
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Usually applications don't call objects in their classes.
I think that you must should be a bit more precise.
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]
|
|
|
|
|
Hi all,
I'm looking to read a folder which contain number of files. I want to get some details of those files, like Name, Size, Date Created. Those details I can see from the details view of the folder.
To start I try to find the file name as follows.
Try to find the paths of all files included in a folder as follows.
nt CCountOne::SearchDirectory(vector<string> &refvecFiles,const string &refcstrRootDirectory, const string &refcstrExtension, bool bSearchSubdirectories)
{
bSearchSubdirectories = true;
string strFilePath;
string strExtension;
string strPattern;
HANDLE hFile;
WIN32_FIND_DATA FileInformation;
strPattern = refcstrRootDirectory + "\\*.*";
hFile = ::FindFirstFile(strPattern.c_str(), &FileInformation);
int iCount = 0;
if(hFile != INVALID_HANDLE_VALUE)
{
do
{
if(FileInformation.cFileName[0] != '.')
{
strFilePath.erase();
strFilePath = refcstrRootDirectory + "\\" + FileInformation.cFileName;
if(FileInformation.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY)
{
if(bSearchSubdirectories)
{
int iRC = SearchDirectory(refvecFiles, strFilePath, refcstrExtension, bSearchSubdirectories);
if(iRC)
{
return iRC;
}
}
else
{
strExtension = FileInformation.cFileName;
strExtension = strExtension.substr(strExtension.rfind(".") + 1);
cout << strExtension << endl;
if(strExtension == refcstrExtension)
{
refvecFiles.push_back(strFilePath);
}
}
}
else
{
cout << "Error_Two" << endl;
}
}
}while(::FindNextFile(hFile, &FileInformation) == TRUE);
::FindClose(hFile);
DWORD dwError = ::GetLastError();
if(dwError != ERROR_NO_MORE_FILES)
{
return dwError;
}
}
return 0;
}
</string>
In this code set the folder path and start work.
void CCountOne::GetStart(void)
{
int iRC = 0;
vector<string> vecSrfFiles;
iRC = SearchDirectory(vecSrfFiles, "C:\\Bin Files\\Bin", "srf", true);
if(iRC != 0)
{
cout << "Error_One " << iRC << endl;
}
for(vector<string>::iterator iterSrf = vecSrfFiles.begin(); iterSrf != vecSrfFiles.end(); ++iterSrf)
{
cout << *iterSrf << endl;
}
}
</string></string>
But it don't give any file path. Try to debug and check, seems
if(FileInformation.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY) of code one stuck me with.
Can you guys just look at it.
I appreciate your help all the time...
Eranga
|
|
|
|