|
Anonymous wrote:
1. how to know the running & closed application?
Take a look in the task list, they are running applications rest is closed.
Anonymous wrote:
2. how to get the chat text?.
char szString[20] = "Wonderland"
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Machine Idel time can be found out by using (Overriding) OnIdle, If you want the text from some other application EDIT box, you will need to use HOOKS and for finding different application(ie process running in memory) use PROCESSENTRY32.
regards
Balkrishna Talele
|
|
|
|
|
Hello I was wondering how i could terminate a dialog with an exit button.
I have the following code but it seems not to work..
///////////////////////////////////
void CTimeTrackerDlg::OnButtonexit()
{
int response;
response = MessageBox("Quit the Program?",
"Exit", MB_YESNO);
if(response == IDYES)
SendMessage(WM_CLOSE); // terminate app
}
///////////////////////////////////////
If anyone could help me out it would be great.
none
|
|
|
|
|
You could use CDialog::EndDialog( .. )
Don't try it, just do it!
|
|
|
|
|
what goes inside the (..)
none
|
|
|
|
|
In one of my dialog-based apps I exit with:
PostQuitMessage(0);
|
|
|
|
|
|
EndDialog can be used to end a modal dialog box. The parameter supplied is the dialog's exit code, and is usually considered either one of the constants IDOK or IDCANCEL . PostQuitMessage will, instead, terminate the current thread and thus close the application as well. The parameter for it is the thread's exit code that is desired.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
There are a lot of articles on CP covering designing doc/view apps, as well as numerous ones on hacking CDialog-based apps to behave more like them. Most of my apps don't deal with anything analagous to a document, so I tend to build off of CDialog.
I read some comments on an article of tips for dlg users that suggested using CFrameWnd and a CFormView instead of hacking on a menu and so on, but I haven't been able to find an article that actually fleshes this direction out.
What is the "right" way to create an app that's not document-based, but has menus and a status bar and so on? Is the CFrameWnd/CFormView the way to go?
Thanks,
Adam
|
|
|
|
|
The App Wizard will generate a non doc/view app for you. Its default architecture will have a MainFrame containing a child view.
a two cent stamp short of going postal.
|
|
|
|
|
Rick,
You are correct. However, I think there's a need for something that explains what that means in practical terms. How are you intended to change that child view to a form view, which is probably what most of us who work off of CDialog want to do..? App/ClassWizard is helpful, but not if you don't know how to work in the architectural style (MFC, no?) that it was written to be built off of.
(I tried creating my own form (via New Form...) for the app - this worked out well, except that the generated formview is intended for dynamic creation, and so you can't just swap its class name out with the child view member that AppWizard created, which does not appear to use dynamic creation)
Put another way... there is good documentation on many of the parts of MFC. I have not yet found good documentation on how the designers intended you to put these parts together to create, for example, a CFormView-based application.
Adam
|
|
|
|
|
Adam, this[^] MSDN link may help if you haven't already seen it.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
You can have formview type interface in sdi application without doc/view architecture...
One simple solution is to create a dialogresource provide a class, set the styles as no clientedege, no caption(just the way the formview dialog will look like)
Then in the OnCreate event after the Cwnd is successfully created, create the dialog as modeless and resize it to client area.
Then handle onSize Event and resize it to the clientarea.
This way you can get it to work.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Visual C++ 6
can anyone send me a useful link about
1. the hWnd class and its usage .
2. GetDlgItem() and its reverse (i.e, SetDlgItem() if found!!)
|
|
|
|
|
Oriented wrote:
1. the hWnd class and its usage .
hWnd is not a class, it's a window handle.
Oriented wrote:
2. GetDlgItem() and its reverse (i.e, SetDlgItem() if found!!)
Have you checked MSDN?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You beat me to it....
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hWnd is not a class, it's a HANDLE. In other words, it's a number that uniquely identifies a window on the system. CWnd is a class in MFC which wraps a hWnd.
There is no such thing as SetDlgItem, from memory you put a control into a window by making that window it's parent.
http://www.msdn.com is a more up to date version of the MSDN than came with your VC6, but the VC6 one just might be better for you. Install it now.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I want to know how can i assign infinity to a variable?
|
|
|
|
|
infinity is not a number, so you can't!
you can just use very big values using custom libraries for very big numbers.
Don't try it, just do it!
|
|
|
|
|
Since infinity doesn't exist (i.e., there's always one more number after the biggest number you can think of), how can you assign it to a variable? You can, however, assign a maximum value to integral types like:
int i = INT_MAX;
char c = CHAR_MAX;
unsigned long ul = ULONG_MAX;
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
It's easy, just use the infinity symbol. If you can't find it, take your keyboard back and demand a replacement.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Brilliant!!
Don't try it, just do it!
|
|
|
|
|
Where is the any key?
INTP
|
|
|
|
|
It depends.
If you value is a float or double , then it may be possible, take a look at:
numeric_limits<float>::infinity()
If your variable is an int, long or anything like that, then it is NOT possible to do - no matter what you set the value to, you can add to it and change it. (Although if it goes beyond the maximum value it can hold it will wrap around to a really big negative number!)
Now, if you want to know how to create an infinite loop, I've done that many times before...
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
Navin wrote:
if you want to know how to create an infinite loop, I've done that many times before...
Maxwell Chen
|
|
|
|