|
Actually his source file has NOT cpp extension...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
You're right
Florin Crisan
|
|
|
|
|
Hello,
Is there away to implement a preprocessor macro that would generate a build date in the style of UNIX timestamp (like 20080103 etc.). It would be helpful to print this kind of timestamp into program's About box or include it into program's version number. I know there is __DATE__, but this outputs a different format.
Cheers
|
|
|
|
|
HenriH wrote: I know there is __DATE__, but this outputs a different format.
__DATE__ is what you need. Re-arranging string format won't be such a difficult task.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
--------------------------------------------------------------------------------
I use the function SetupCommitFileQueue to copy files.
When I use it, "Copy files..." window is displayed .
I don't want this window to be displayed.
How can I do it?
Thanks
Ashish
|
|
|
|
|
Hi
iam doing Chat application with out language pack installation .In this when i paste chinese characters in rtf .
And sending from rtf to Html chinese characters r converting pair of 8-bit codepoints. i need help how to convert pair of 8-bit codepoints to decimal value ...plz tell...
#sanroop#
|
|
|
|
|
You post the same yesterday. I already answered asking you for more details. Could you please be so kind to elaborate a bit?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I'm trying to restrict my dialog window from being moved outside the visible screen area.
I'm doing this using this method:
void CWindowsDVRDlg::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
{
CSkinDialog::OnWindowPosChanged(lpwndpos);
CRect rc;
GetWindowRect (&rc);
if (EnsureRectangleOnDisplay(rc)){
SetWindowPos(NULL, rc.left, rc.top, 0,0, SWP_NOSIZE | SWP_NOZORDER);
}
else{
SendMessage(DM_REPOSITION);
}
RedrawWindow(NULL,NULL,RDW_INVALIDATE);
}
The code works but its flaw is that it's still painting the dialog window outside the visible screen area just before it is repositioned inside the screen (by SendMessage(DM_REPOSITION)). Flickering is the result of this.
Can anyone help me with this? You're help would be much appreciated.
|
|
|
|
|
Use OnWindowPosChanging instead.
|
|
|
|
|
Thanx!
I tried using OnWindowPosChanging() beforehand but the problem is, it seems it cannot process the SendMessage(DM_REPOSITION) at all which is what I need to implement.
Any other ideas on preventing the program from painting windows outside the screen (results in flickering) while using OnWindowPosChanged() and SendMessage(DM_REPOSITION)?
|
|
|
|
|
You can stop painting in the OnPaint method.
Or (better) you can invalidate (if it is under your control) only the inside-screen area.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
demxine wrote: Any other ideas on preventing the program from painting windows outside the screen (results in flickering) while using OnWindowPosChanged() and SendMessage(DM_REPOSITION)?
I dont understand the need of this... If you are targeting to restrict the window movement, OnWindowPosChanging is enough. You only need to update the WINDOWPOS structure values passed by it. No need of DM_REPOSITION.
Is my understanding correct?
|
|
|
|
|
Can you post a specific piece of code on how to do this:
(If you are targeting to restrict the window movement, OnWindowPosChanging is enough. You only need to update the WINDOWPOS structure values passed by it. No need of DM_REPOSITION)
Actually, I have no idea how to make it work other than using SendMessage(DM_REPOSITION)in restricting window movement only to the visible screen. Could you help me please.
|
|
|
|
|
Sorry for the delay...
demxine wrote: Can you post a specific piece of code on how to do this:
Try this...
void CDlgTestDlg::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
{
CDialog::OnWindowPosChanging(lpwndpos);
if( lpwndpos->x < 0 ) lpwndpos->x = 0;
if( lpwndpos->y < 0 ) lpwndpos->y = 0;
int nScrW = GetSystemMetrics( SM_CXMAXIMIZED );
int nScrH = GetSystemMetrics( SM_CYMAXIMIZED );
if(( lpwndpos->x + lpwndpos->cx ) > nScrW ) lpwndpos->x = nScrW - lpwndpos->cx;
if(( lpwndpos->y + lpwndpos->cy ) > nScrH ) lpwndpos->y = nScrH - lpwndpos->cy;
}
|
|
|
|
|
Hey, it works! Thank you so much for your help. Cheers! ^_^
|
|
|
|
|
demxine wrote: Thank you so much
You are welcome...
|
|
|
|
|
demxine wrote: I'm trying to restrict my dialog window from being moved outside the visible screen area.
I did this before by handling the WM_MOVING message. See here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
<br />
<br />
HWND h;<br />
<br />
long l = (long)h;
<br />
how to correct change HWND to long?
|
|
|
|
|
Which warning?
I can see only "warning C4700: local variable 'h' used without having been initialized" in VC6 with warning level 4.
|
|
|
|
|
|
On 32-bit platforms the two data types have the same size hence the cast is harmless. The compiler warns because this can be an issue when you port the code to 64-bit platforms.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
now, I can also use these code
<br />
LONG64 l64Temp = (LONG64)m_hWnd;<br />
long lTemp = static_cast<long>(l64Temp);<br />
</long>
|
|
|
|
|
Why would you use that code?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
hanlei0000000009 wrote: long l = (long)h; // warning
convert that back to HWND after converting to LONG, if it is working than it is fine. i too have used this technique many times, and face to problem.. wishes same for you!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|