|
What do you mean by interrupt? Can you explain a little more?
- NS -
|
|
|
|
|
I think he wants to programming with assembly.
|
|
|
|
|
|
If helps ... using _asm you can include assembler code in the C++ code
Russell
|
|
|
|
|
|
I am working on a win32 SDI application where i want to know if no event has occured or fired on a window a password dialog should be fired. I want to know how to track that no event has occured on the window.
Thanks in advance.
Dhiraj
Dhiraj Kumar Saini
|
|
|
|
|
you mean you want to make something like a screen saver?
means, if any body does not do anything on the application for some time (say 10 mins) do you want to lock it by displaying the password screen.
|
|
|
|
|
yes is anybody does not do with the application for sometime it should be locked and requires password just like a screen saver.
|
|
|
|
|
thats very simple.
take a global variable say timeout=0;
initiate a timer in the main view, which gets invoked once in 1 second.
inside the timer,
{
increment the timeout by one
if(timeout==60)//say 60 seconds
{
show the password screen.
}
}
and in all the other events like opening a dialog, closing a dialog,
doing some frequent operations,
reset the timeout flag to zero.
i am sure this will solve your problem.
|
|
|
|
|
Dhiraj kumar Saini wrote: if no event has occured or fired on a window
You mean events like mouse click, key strokes, etc., right?
- NS -
|
|
|
|
|
yes u right i want functionality like screen saver
|
|
|
|
|
Since it is a Win32 Aplication (No MFC), there will be a message loop.
Like...
while( GetMessage( &msg, ....<br />
{<br />
TranslateMsg...<br />
DisapatchMsg...<br />
}
You have to modify it like...
<br />
SetTimer( IDT_LOCK, LOCK_TIME, 0 );<br />
while( GetMessage( &msg, ....<br />
{<br />
switch( msg.message )<br />
{<br />
case WM_LBUTTONDOWN:<br />
case WM_RBUTTONDOWN:<br />
case WM_KEYDOWN:<br />
SetTimer( IDT_LOCK, LOCK_TIME, 0 );<br />
break;<br />
}<br />
TranslateMsg...<br />
DisapatchMsg...<br />
}
And handle the WM_TIMER in the windowproc, like...
case WM_TIMER:<br />
switch( wParam )<br />
{<br />
case IDT_LOCK:<br />
KillTimer(IDT_LOCK);<br />
DialogBox( ...,IDD_PASSWORD,...<br />
SetTimer( IDT_LOCK, LOCK_TIME, 0 );<br />
break;<br />
}
Hope you got the idea...
- NS -
|
|
|
|
|
Do you want to show a dialog to user when he want to use of your program?
|
|
|
|
|
yes a dialog for entering password
|
|
|
|
|
Dhiraj kumar Saini wrote: ...i want to know if no event has occured or fired on...
For idle detection, use GetLastInputInfo() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
Am getting data continuously from the serial port(COM), i want to display the data in an multiline edit box,How to do it?
I tried one method as below but edit box flickers
void CDialog::ReadSerialData(CString sIn)
{
sIn.Replace("\r","\r\n");
m_StrCmdResp += sIn;
int nLineCount = m_CtrlCmdResp.GetLineCount();
m_CtrlCmdResp.LineScroll(nLineCount+1);
m_CtrlCmdResp.SetWindowText(m_StrCmdResp);
nLineCount = m_CtrlCmdResp.GetLineCount();
m_CtrlCmdResp.LineScroll(nLineCount+1);
if(nLineCount > MAX_RUN_BUFFERSIZE)
{
m_StrCmdResp.Delete(0,REMOVE_CHAR);
while(!(m_StrCmdResp.Find("\r\n")))
{
m_StrCmdResp.Delete(0,1);
};
}
m_StrCmdResp.FreeExtra();
}
Can we use edit box for this type of data displaying
Thanks in advance
|
|
|
|
|
use listbox or may be list control instead.
even i had this problem and list control solved my problem.
|
|
|
|
|
If you are shoing data coming back from somewhere, then an edit box is probably the wrong control to use.
I use CPPDumpCtrl - version 1.2[^] for this purpose, as you can see the data in different representations. As it is double buffered, flickering will be very low.
Sometimes, you're just using the square peg, and you have a round hole...
Iain.
|
|
|
|
|
Iain Clarke wrote: Sometimes, you're just using the square peg, and you have a round hole...
Well, as long as the length of the opposite corners is the same as the hole's diameter, it should still work.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
But then the wumpuss could crawl in the circle sections around the edge, and then where will you be?
Iain.
|
|
|
|
|
Good choice is CListBox or CListCtrl or even ComboBox but Editbox no.
|
|
|
|
|
Thanks for the help.I will try with CCtrlList.
|
|
|
|
|
|
shir_k wrote: Am getting data continuously from the serial port(COM), i want to display the data in an multiline edit box,How to do it?
Extract the data from a serial port, or update an edit control?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Updating in the edit control
|
|
|
|