|
Sleep doesn't allow Windows messages to get through. You need to use something like a timer or a message pump function.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Thank you very much on your answer.
Can you show me example how to use in timer ???
miri
|
|
|
|
|
You are going to need to capture the WM_TIMER message, in this function you perform whatever actions you require to happen at a set interval. The message is started by a call to SetTimer and finished with a call to KillTimer.
SetTimer(1, 100, NULL);
KillTimer(1);
void CMyDlg::OnTimer(UINT nIDEvent)
{
CDialog::OnTimer(nIDEvent);
}
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Thank you very much But I dont success.
I need only one waiting of a few minutes between the first two lines:
//////////////////
m_edit1 = "22222222222"; //CString תיבת טקסט מסוג
UpdateData(false);
///////////////////
to the last two lines:
//////////////
m_edit1 = "1111111111";
UpdateData(false);
///////////
Can you shoe me exactly how to do it ???????
/////////////////////// thanks
miri
|
|
|
|
|
CEdit* pText = (CEdit*)GetDlgItem(IDC_TEXT);
pText->SetWindowText("22222222222");
pText->UpdateWindow();
UpdateData(FALSE);
Sleep(3000);
pText->SetWindowText("111111111111111111111111111");
pText->UpdateWindow();
UpdateData(FALSE);
Sleep(10000);
Carlos A. Antollini
|
|
|
|
|
Thank you !
This is wonderful !
But there ara one big problem
that after Sleep(10000)
the first text recived.
I want that the second text will remain
What can I do ???
thanks
miri
|
|
|
|
|
excuse me !
I found the problem.
that appened because I did not update the text box variable
that I intialized before .
Thank you very much on your answers !
miri
|
|
|
|
|
How can I to change a static picture(bitmap) from disible to visible and from visible to disible in the code(wich metod?) ???
Please help me !!!!!
miri
|
|
|
|
|
You just call the ShowWindow method of the corresponding CWnd, with parameter SW_SHOW or SW_HIDE.
The CWnd* can be retrieved by GetDlgItem(ID) or you subclass the ctrl with the classwizard.
Pseudocode is code to demonstrate a concept, not designed to be run.
Like certain Microsoft software.
|
|
|
|
|
thank you!
Can you show me example ?
I need to show a picture that defined as CStatic(bitmap)
and after a few minutes to hide it .
How doing it ???
miri
|
|
|
|
|
Here is my code...
CPen pen, pen1, pen2;
pen.CreatePen(PS_SOLID, 2, WHITE);
CDCPointer->SelectObject(&pen);
..*
..*
..*
pen1.CreatePen(PS_SOLID, 2, BLACK);
CDCPointer->SelectObject(&pen1);
..*
..*
..*
pen2.CreatePen(PS_SOLID, 2, RED);
CDCPointer->SelectObject(&pen2);
..*
..*
..*
When i compile it....there is an error message on the line of pen1.CreatePen..
"error C2668: 'CreatePen' :ambiguous call to overloaded functinn"
What is it?
|
|
|
|
|
It doesn't recognize the constants WHITE, BLACK, and RED.
|
|
|
|
|
I am having trouble getting a bitmap to display on a dialog. I've set the Picture Control in the window (Dialog) and set the Type property to Bitmap. I can get it to display a resource bitmap created in the editor and assigned to the control via the Image property. What I would like to do is have a dynamically drawn bmp displayed and updated as needed on this dialog. I know how to draw the bitmap just not how to get it thrown in to the Picture Control.
Thank you for your time
lp
|
|
|
|
|
there's a control called CBitmapCtrl over at www.codeguru.com
see how he did it
|
|
|
|
|
Thank you, I'll take a look.
lp
|
|
|
|
|
This should be easy, I've created a new VC++ 6 dialog based app with a single rich edit
control (and the standard OK/Cancel buttons).
I've added AfxInitRichEdit() to InitInstance() and a NM_SETFOCUS message handler using the Class Wizard.
The NM_SETFOCUS handler never fires?
Any Ideas?
|
|
|
|
|
Don't rich edit controls just suck ? I mean, if I *have* one, why do I have to specify with a call that I want to *use* it ?
Anyhow, the fun is not over yet. You need to tell the rich edit to send you messages using the SetEventMask function with a combination of the following flags:
ENM_CHANGE Sends EN_CHANGE notifications.
ENM_CORRECTTEXT Sends EN_CORRECTTEXT notifications.
ENM_DRAGDROPDONE Sends EN_DRAGDROPDONE notifications.
ENM_DROPFILES Sends EN_DROPFILES notifications.
ENM_IMECHANGE Rich Edit 1.0 only: Sends EN_IMECHANGE notifications when the IME conversion status has changed. Only for Asian-language versions of the operating system.
ENM_KEYEVENTS Sends EN_MSGFILTER notifications for keyboard events.
ENM_LINK Rich Edit 2.0 and later: Sends EN_LINK notifications when the mouse pointer is over text that has the CFE_LINK and one of several mouse actions is performed.
ENM_MOUSEEVENTS Sends EN_MSGFILTER notifications for mouse events.
ENM_OBJECTPOSITIONS Sends EN_OBJECTPOSITIONS notifications.
ENM_PROTECTED Sends EN_PROTECTED notifications.
ENM_REQUESTRESIZE Sends EN_REQUESTRESIZE notifications.
ENM_SCROLL Sends EN_HSCROLL and EN_VSCROLL notifications.
ENM_SCROLLEVENTS Sends EN_MSGFILTER notifications for mouse wheel events.
ENM_SELCHANGE Sends EN_SELCHANGE notifications.
ENM_UPDATE Sends EN_UPDATE notifications.
Rich Edit 2.0 and later: this flag is ignored and the EN_UPDATE notifications are always sent. However, if Rich Edit 3.0 emulates Rich Edit 1.0, you must use this flag to send EN_UPDATE notifications..
Coz just because you initialized a CRichEditCtrl doesn't mean you want it to talk to you, right ? Sheesh...
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
Well that makes sense! - Do you think it was a Friday when they invented this?
Maybe there is an easier way to do this (as you can guess I'm a newbie!). I need to have a read-only rich edit control, it will be populated and has auto scroll but I do not want it to receive focus. Can you advide on the easiest to achieve this?
|
|
|
|
|
I don't think there is an *easier* way - the only two other options that occur to me are to use a class that wraps a font and draw it yourself ( I'd probably do this, but it's not *easy*, that is, the RichEdit is not harder ), or create an IE Window in my dialog and do it in HTML ( useful under some circumstances ).
I'd recommend sticking with the Rich Edit because you're largely out of the woods now, and my personal approach is to stick with a method until I've learned it, try something else the next time and then I can say that
a/ I can make an informed decision come the third time and
b/ the damn computer didn't beat me.
Christian
#include <std_disclaimer.h>
|
|
|
|
|
HELP! (PLEASE!)
OK, I admit defeat I cannot get this thing working!
The events are now firing after using SetEventMask() but how the heck
do I know that the control is about to receive focus (and therefore stop it!)?????
Any chance of a snippit of code?
|
|
|
|
|
Hi,
I have a strange problem, and I haven't managed to find an answer in the
documentation.
I'm using an SDI, non-Doc/View arch.
My toolbar has several buttons all of which have the ON_COMMAND_UPDATE_UI
implemented.
They all check some bool variable for true, and if so they disable.
Up to here all is well.
On button's handler sets this Boolean to true (in the ON_COMMAND handler).
My problem is that the toolbar does not get updated when this happens, i.e.
the ON_COMMAND_UPDATE_UI does not get called for all the rest of the
buttons. Only when the user clicks some button on the toolbar, does it
update, but by then it is too late.
I need something which is equivalent to Invalidate() but for the toolbar.
I tried Invalidating the frame, app, toolbar, to no avail.
I tried calling OnIdle(), to no availed.
I tried sending WM_IDLEUPDATECMDUI to the Frame, to no avail.
Please help me. (maybe on of the above is the solution, and I just messed it
up).
Please explain,
Thanks,
Adi
|
|
|
|
|
Try calling GetToolbarCtrl()->AutoSize(); This will resize the toolbar ( the actual item you want to manipulate is the CToolbarCtrl that the CToolBar encapsulates ), and hopefully redraw it.
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
My program has a toolbar with a edit box on it. When the program starts, (1)i would like to set the focus to this edit box. In this edit box, there is a phrase "Enter command here". (2)I would like to have this phrase highlighted, so that the user can enter the command immediately. How to do that?
Thank you!
|
|
|
|
|
1) wndYourEdit.SetFocus();
2) wndYourEdit.SetSel(0,-1);
Or the equivalent APIs if you're not using MFC/ATL windowing classes.
--Mike--
http://home.inreach.com/mdunn/
Tables, ladders, chairs, OH MY!
|
|
|
|
|
hello,
I would like to know if it is possible to delete a specific tab in a Tab Control.
Thanks for help.
R.G
|
|
|
|