|
Well... all I think is that you should redraw your bitmap properly, that is, first clear the background and then blitting an image. Use clipping information in PAINTSTRUCT for proper paiting. And try to use double buffering.
|
|
|
|
|
I need to make CDateTimeCtrl not editable, without arrows ?
<br />
m_Planer.m_Current_Date .ModifyStyle(0, DTS_SHORTDATEFORMAT);<br />
m_Planer.m_Current_Time .ModifyStyle(0, DTS_TIMEFORMAT);<br />
not works:
<br />
m_Planer.m_Current_Date .ModifyStyle(DTS_UPDOWN | DTS_APPCANPARSE ,0 );<br />
How to do subject?
thanks
|
|
|
|
|
Hey! You can subclass this control and listen for WM_KEYDOWN message
codes of arrows
VK_LEFT (25)
LEFT ARROW key
VK_UP (26)
UP ARROW key
VK_RIGHT (27)
RIGHT ARROW key
VK_DOWN (28)
DOWN ARROW key
<br />
switch (uiMsg)<br />
{<br />
case WM_KEYDOWN:<br />
{<br />
if(wParam>= VK_LEFT && wParam<=VK_RIGHT)<br />
return 0;<br />
}<br />
<br />
}<br />
try to read something on subclusing on msdn
and probably in this article you will find usefull info
Pain is a weakness living the body
|
|
|
|
|
i need help with my timeouts. i can get my program to read/write single bytes, but the problem is a function related with the hardware i'm using.
you send the command and the hardware will enter a loop sending you each 3ms 7 bytes.
i can't set the timeouts properly in order to receive all those bytes (the most important thing is that i don't loose any bytes!)...
can anybody please help me??
thank you in advance...
Я люблю русский языкь!
|
|
|
|
|
Hello all
I'm pretty new on C++ and I have a problem. The thing is that I want to write a CString to a CStdioFile and be able to read the string from the file. All I have done so far is a little testprogram, just to se if it worked. It did not! Problem: I get a lot of junk text in my file and when I read from the file. Here is the code, I would be very greatful if anyone could help me a bit.
CStdioFile file;
CString filnamn = "Temp.txt";
CFileException fileException;
char buf1[] = "Hej hej\n";
char buf2[] = "Jag heter henrik\n";
CString rad = "";
CString rad1 = "Hej hej";
CString rad2 = "Jag heter henrik";
if (!file.Open(filnamn, CFile::modeCreate | CFile::modeReadWrite, &fileException))
{
TRACE("Can't open file %s, error = %u\n",
filnamn, fileException.m_cause);
}
file.WriteString(rad1 + '\n');
file.WriteString(rad2 + '\n');
file.ReadString(rad);
printf(rad, "%s");
file.Close();
|
|
|
|
|
You need to move the file pointer (where in the file you're reading/writing).
Try file.SeekToBegin() before trying to read...
Steve S
|
|
|
|
|
And your printf is erronous
try a printf((LPCTSTR)rad);
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Stojan78 wrote:
file.WriteString(rad1 + '\n');
file.WriteString(rad2 + '\n');
file.ReadString(rad);
Your problems lies with the above statement.
Try this:
<br />
file.WriteString(rad1 + '\n');<br />
file.WriteString(rad2 + '\n');<br />
file.SeekToBegin();
file.ReadString(rad);<br />
I Dream of Absolute Zero
|
|
|
|
|
Thanks a lot all. It now works just fine...
|
|
|
|
|
i am using visual studio to make some histogram graphs and pie graphs of standered divation but the programme does not recognize the graphics.h header file. how should i make the graphs and please tell what should i do to this heard file (graphics)
graphics in c/c++
|
|
|
|
|
|
How can I change the Style of an CSlideCtrl subsequent? I need this, because some settings cannot be set on the dialog editor...!
|
|
|
|
|
Thank you for reading this.
Now I want to keep the height and position of vertical scrollbar's thumb all
the time,so I used this m_ctrlTree' is a TreeListView control)
----------------------------
const int nBar = SB_VERT;
SCROLLINFO si = {0};
si.cbSize = sizeof(si);
si.fMask = SIF_ALL;
m_ctrlTree.GetScrollInfo(nBar, &si);
si.nMax = si.nPage * 2;
si.nPos = (int)si.nPage/2;
m_ctrlTree.SetScrollInfo(nBar, &si, TRUE);
-----------------------------
I placed that block in the 'OnPrePaint' event of the tree control and it really works,but
problem is that when resizing the TreeListView window or expanding a
node, it scrolls madly,perhaps always scrolls to the last record,this is not what I
want.
Is the calculate method right?And where should I place the
SetScrollInfo(nBar, &si, TRUE)to control the Thumb?
Best reguards.
de BG2SC
|
|
|
|
|
Hi,
in an application that i'm developping, i need to know if there are some user activities at any given time, such as the mouse being moved or the keyboard being used.
Is there any other smarter way to know how, that there are no user activity on the system and how long he was not active. Such a behaviour is used by application for IM, when they set the "away" message !
Thanks in advance for any hints and best regards
Richard
|
|
|
|
|
Check OnIdle( LONG lCount ); for MFC
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
i'm not using mfc in my application ;o) !
So please provide a solution without mfc !
Thx in advance and best regards
Richard
|
|
|
|
|
From MSDN about OnIdle
OnIdle is called in the default message loop when the application’s message queue is empty. Use your override to call your own background idle-handler tasks.
Why not do the "same" in your main loop?
When no messages are being treated treat Call an OnYourIdle Function
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Check out GetLastInputInfo() .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
If you are using MFC based application u can track it by overriding OnIdle method of CWinApp class.
for direct win32 application u can use WinProc method to track any message is posted on the message queue of the application.
One Best method is, Through Hook. write a WH_MESSAGE hook and do your work fine
I hope it will help you
thanks
|
|
|
|
|
Maybe one note on the onidle loop.
It will use a lot of cpu % usage!
You can solve this by setting a start time in your onidle (and then tell it to stop working) and starting a thread which will test this starttime against the currenttime. if a certain time has passed ... (take some action).
Put a Sleep in your thread to keep the cpu % usage down.
Have fun ...
|
|
|
|
|
As already suggested, GetLastUserInputInfo() on W2K+ systems.
Otherwise you could modify the main message loop, and take the time stamps of hincoming mouse/keyboard messages.
Another option would be a Mouse/Keyboard hook inside your process, that simply resets a timer. This seems the most independent solution (and not too complicated), but personally I would avoid a hook unless it's the only way.
or you just check if the space key is permanently down, and there are snoring noises from the MIC IN.
Flirt harder, I'm a Coder
mlog || Agile Programming | doxygen
|
|
|
|
|
|
I want to be able to display properties for file or folder, as we do when right-clicking over file or folder, I have to display this shell dialog (shell dialog I Guess), but my search in msdn and here at CP does not give any results. Does anyone know how to do that or have information link?
Thanks in Advance!
|
|
|
|
|
Try ShellExecute with the verb "Properties"
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
Doesent seem to work
|
|
|
|