|
You can find related article on CP.
A. Riazi
|
|
|
|
|
|
Or maybe a little bit more work by the original poster. People need to learn how to search for answers on their own.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
Or maybe a little bit more work by the original poster. People need to learn how to search for answers on their own.
Amen
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Yup, too.
Holy Sh*t! I'm speechless. (hey, that's a first) Marc Clifton, The Lounge
|
|
|
|
|
I am in the midst of developing an application that I'd like to be able to minimize to the system tray. I understand how to add an icon to the System Tray, and I understand how to make a window's button disappear from the task bar. What I don't understand is how to both remove the status bar button and show the icon when the window is minimized.
Is there an appropriate OnMinimize() method for CWnd? Maybe I'm just thinking too hard about this, but I cannot see how one can tie the minimize action to the two things I want to do. Any ideas?
Jonah Bishop
Visit JGB Productions
|
|
|
|
|
Do you mean Task bar button or Status bar button?
A. Riazi
|
|
|
|
|
I said "status bar" button but meant the "task bar" button. I can already add an icon to the system tray, and I know how to make the task bar button disappear. But I don't know how to connect these two items to the user's minimizing the application.
From what someone else replied, I think the WM_SYSCOMMAND is what I want, but I won't be able to try it until I get home from work...
Jonah Bishop
Visit JGB Productions
|
|
|
|
|
|
Search for articles on this site which talk about the System Tray, such as this[^] one.
For handling the Minimize event, check out the WM_SYSCOMMAND message.
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
Well, in my old project where I was using #import and a database class, I see that I had Yu "stdafx.h" replaced with YX in my project settings C++ tab. My new project has Yu in it and it wont compile but if I change it to YX it works. I must have done this in the earlier project but cant remember (if I even knew it) why and what it means....Please help. I am afraid if I make this Yu change and get my new prog to run, I might get in trouble later on in the project....
Appreciate your help,
ns
|
|
|
|
|
Do you have MSDN installed? There is good description search for "/Yu" and "/YX".
I would not recommend using "/YX" without full understanding of what it does.
|
|
|
|
|
See my prev. post on compile issue
|
|
|
|
|
I selected "automatic use of precompiled headers' and yu changed to yx, and its happy now. hope its okay....have to read about yx yet..thanks for the response
Appreciate your help,
ns
|
|
|
|
|
HI ,
This is what i'm doing :
OnButtonClick event ,I spawn a thread and while the thread is executing i just want to change the mouse cursor to busy...Is it possible??
InitDialog()
{
hBusyCursor = LoadStandCursor(IDC_WAIT);
hOldCursor = ::GetCursor();
}
MyClass::OnButton1()
{
::SetCursor(hBusyCursor);
AfxBeginThread(runThread,this);
}
UINT MyClass::runThread(LPVOID param)
{
((MyClass *)param)-run();
return 0;
}
void MyClass::run()
{
::SetCursor(hBusyCursor);
// do some thing;
::SetCursor(hOldCursor);
return;
}
//
But the cursor never changes.. Why so??
Could anyone help me .. Thanks very much.
|
|
|
|
|
Use must use thread communication between your class and thread.
before using AfxBeginThread() change your mouse cursor to IDC_WAIT, then when thread goes to finished, send a message to class (by using ::SendMessage() .
In message handler, change cursor to IDC_NORMAL.
A. Riazi
|
|
|
|
|
Hi!!
Thanks for your reply..
I tried as you told .
One thing i observerd was- Irrespective of thread spawning and all that --
If you change the cursor from within OnButtonClick(), then once the OnButton1() function is exited the cursor is automatically reset to Normal Cursor.
SO Generally.. Is there any way to set the Cursor globally throughout .. (i.e) on a Button click or some other control's event , the cursor change remains valid throught the rest of the execution..
THanks so much..
|
|
|
|
|
define a member variable with variable type CWaitCursor to your dialog class. Use member function of CWaitCursor for changing mouse cursor.
A. Riazi
|
|
|
|
|
I added adox ccp and .h and dbclass cpp and .h to my project (these work in another project)., But even after rebuilding all I get:
C:\DbClass.cpp(1540) : fatal error C1010: unexpected end of file while looking for precompiled header directive
AdoX.cpp
C:\AdoX.cpp(794) : fatal error C1010: unexpected end of file while looking for precompiled header directive
What am I doing wrong?
Appreciate your help,
ns
|
|
|
|
|
You must have forgotten to add an #endif somewhere.
~RaGE();
|
|
|
|
|
1. first line in DbClass.cpp and AdoX.cpp should be "#include "stdafx.h""
OR
2. you should disable precompiled headers for those files in compiler settings
|
|
|
|
|
The only diff in my working project that uses these files and my new one is that the od one had YX, not YU in the C++ tab of settings. I made this change manually and it works but I am nervous....
In my old project even the offending files were "automatic use of precompiled headers..."
ANyways after I looked at what doing the YU --->YX did toi my current project - it said not to use precompiled headers. I looked at my old program -- it said to usre automatic precompiled headers EVEN THOUGH it has YX......so in my currrent I selected "automatic use " and looked back in my c++ tab and its till YX...."
What I'm trying to say is that (in my new proj) it was set to "dont use precompiled" (maybe because I changed the Yu to a YX...dont know). Things worked then. Next I selected "automatic use..." and the YU change I made to YX didnt change back to YU...
GEt a warning :Command line warning D4025 : overriding '/Ycstdafx.h' with '/YX/FoDebug/'
Is this dangerous?
Appreciate your help,
ns
|
|
|
|
|
/Yu - it means that file specified (usually "stdafx.h") already precompiled into ".pch". It also means that it MUST BE FIRST INCLUDE in your .cpp.
/YX - in simple terms compiler try to guess which header to make into precompiled. There is bunch of "if", "but" and other conditions - usually it defeats the whole purpose of precompiled headers.
|
|
|
|
|
Inspite of the stadfx being first in my files it was still unahppy till I said automatic use...
Appreciate your help,
ns
|
|
|
|
|
add following line at top DbClass.cpp and AdoX.cpp:
#include "stdafx.h"
A. Riazi
|
|
|
|