|
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
|
|
|
|
|
See here. Most of the time, SetWindowText() can be used.
"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 DavidCrow,
Am using SetWindowText(), but there is flickering
Thanks
|
|
|
|
|
You might want to investigate SetRedraw() .
"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
|
|
|
|
|
hey guys,
I am making an xpcom component to listen to event generated by Mozilla browser. It compiles fine..but gives linker error .
MyComponent.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __stdcall WebLock::GetWeakReference(class nsIWeakReference * *)" (?GetWeakReference@WebLock@@UAGIPAPAVnsIWeakReference@@@Z)
1>.\Debug\MyComponent.dll : fatal error LNK1120: 1 unresolved externals
I am also pasting peace of code related to this error ..Please help me get out of this error.
I am linking against xpcomglue_s.lib ,xpcom.lib ,plc4.lib nspr4.lib and plds4,lib.
MyComponent.h
class WebLock : public nsIWebProgressListener,
public nsISupportsWeakReference,
public nsIObserver,
public iWeblock
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
NS_DELC_NSIWEBPROGRESSLISTENER
NS_DECL_NSISUPPORTSWEAKREFERENCE
...............
...............
};
MyComponent.cpp
NS_IMPL_ISUPPORTS4(WebLock, nsIWebProgressListener,
nsISupportsWeakReference,
nsIObserver,
iWeblock)
............
.............
Thanks a lot in Advance..
|
|
|
|
|
You need to check the docs for xpcom. The error means that it cannot find that method, ie it's in a .lib that you haven't included.
|
|
|
|
|
Its a linker error and it seems you need to a lib file.
|
|
|
|
|
hi all vc++ masters
1)i use this code on a button
CString strpath="C:\\72456\\gg.txt";
CStdioFile fileObj;
fileObj.Open(strpath, CFile::modeRead | CFile::shareDenyWrite);
but it could not open the gg file
please help me
2)i want that when i write a name of file on edit box and click on button
it search file in c drive and open it
thanks
|
|
|
|
|
do you actually want to open the file to write or read something?
or are you looking to open the file in notepad automatically.
|
|
|
|
|
|
to write data into file,use
FILE * fp;
fp=fopen("filename.txt","w");
fprintf("hello");
fclose(fp);
to open the file automatically, use
system("notepad filename.txt");
|
|
|
|