|
char ch;
ch = 65;
ch = 97;
ch = 62;
ch = 37;
Nibu thomas
Software Developer
|
|
|
|
|
You can also give the character itself.
For eg.
char ch1 = 'A';
char ch2 = 'a';
char ch3 = '>';
char ch4 = '%';
- NS -
|
|
|
|
|
|
i want to calculate how long a debug takes to complete in VC++...and include it in da the coding of the same program...what should i use, timestamp or any other function??
-- modified at 0:01 Thursday 4th May, 2006
|
|
|
|
|
Take a look at QueryPerformanceCounter() .
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
sorry but i cant work on this any other idea.
|
|
|
|
|
LARGE_INTEGER start;<br />
LARGE_INTEGER end;<br />
QueryPerformanceCounter(&start);<br />
test();
QueryPerformanceCounter(&end);<br />
__int64 elapsedTime = end.QuadPart - start.QuadPart;
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Get system time at process start and again get system time before process termination and calculate the difference between them
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
ur idea is diffrent....show me a small hints in the coding..
|
|
|
|
|
see the code
#include <<ctime>> modify << & >> to < & > resp.
#include <<iostream>>
using namespace std;
time_t tmStart, tmEnd;
tmStart = time(0);
tmEnd = time(0);
cout << tmEnd-tmStart << " seconds (that was fast!)" << endl;
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
-- modified at 1:27 Thursday 4th May, 2006
|
|
|
|
|
Hi all,
I have created a Window using WINAPI. To make the window unmovable, this is what I have done:
LRESULT CMyFrameWnd::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)<br />
{<br />
LRESULT lr ;<br />
<br />
switch( uMsg )<br />
{<br />
case WM_CREATE:<br />
OnCreate( uMsg, wParam, lParam ) ;<br />
break ;<br />
<br />
case WM_SIZE:<br />
if( wParam == SIZE_MAXIMIZED )<br />
MessageBox(NULL, "sdfasd", NULL, 0 ) ;<br />
break ;<br />
<br />
case WM_WINDOWPOSCHANGING:<br />
MessageBeep( 0 ) ; <br />
break ;<br />
<br />
case WM_NCHITTEST:<br />
lr = DefWindowProc( hWnd, uMsg, wParam, lParam ) ;<br />
if( lr == HTCAPTION )<br />
{<br />
lr = HTNOWHERE ;<br />
}<br />
return lr;<br />
break ;<br />
<br />
case WM_NCDESTROY:<br />
OnFinalMessage();<br />
break ;<br />
} <br />
<br />
return DefWindowProc( hWnd, uMsg, wParam, lParam ) ;<br />
}
and its working fine. But overriding the HTCAPTION disables all clicks on the caption bar. Although, I don't want the Window to move, I would like to maximize its size by double clicking on the caption bar. Any ideas?
Also, How do I set the maximum size for a window and control the resizing of the Window?
Thanks.
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
TechyMaila wrote: But overriding the HTCAPTION disables all clicks on the caption bar. Although, I don't want the Window to move, I would like to maximize its size by double clicking on the caption bar. Any ideas?
You could handle WM_NCLBUTTONDBLCLK and maximise your window manually using ShowWindow() .
TechyMaila wrote: Also, How do I set the maximum size for a window and control the resizing of the Window?
Handle the WM_GETMINMAXINFO message.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Why u use HTCAPTION???
To set size handle WM_SIZE
|
|
|
|
|
Well the code below works with a dialog based application and creates an unmovable dialog. I haven't tested it with a frame window though...
CMenu* pSysMenu = GetSystemMenu(FALSE);
pSysMenu->RemoveMenu(SC_MOVE, MF_BYCOMMAND);
This fixes the dialog.
Nibu thomas
Software Developer
|
|
|
|
|
Sorry Nibu... I have posted the same answer accidently...
- NS -
|
|
|
|
|
If you really want to disable the window moving, you can do simply like as follows...
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
pSysMenu->RemoveMenu( SC_MOVE, MF_BYCOMMAND );
}
GoodLuck
- NS -
|
|
|
|
|
I have to make a Static Text in ActiceX ATL Composite Control transprent. I have an image as background of ActiceX. I did call SetWindowLong() @ OnInitDialog() of control. But when i use the activeX in IE, The static text flicker every seconds or so...I am calling InvalidateRect to paint the static text from OnEraseBkGnd(). The OnEraseBkGnd() is calling everytime. The functions OnEraseBkGnd, Static Window Proc are given below
CustomStaticText(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
int x = 0;
HWND hParent = NULL;
DWORD ret = false;
HDC pDC = NULL;
PAINTSTRUCT ps;
switch(uMsg)
{
case WM_ERASEBKGND:
return (LRESULT)1;
break;
case WM_PAINT:
{
CLogFile::writeToFile ("CustomStaticText", "WM_PAINT");
hParent = ::GetParent(hwnd);
RECT Rect;
::GetWindowRect(hwnd, &Rect);
POINT P1;
POINT P2;
P1.x = Rect.left;
P1.y = Rect.top;
P2.x = Rect.right;
P2.y = Rect.bottom;
::ScreenToClient(hParent, &P1);
::ScreenToClient(hParent, &P2);
::MoveWindow(hwnd, P1.x, P1.y,1,1, TRUE);
pDC = ::BeginPaint(hwnd, &ps);
::SetTextColor(pDC, RGB ( 255, 0, 0));
::SetBkMode(pDC, TRANSPARENT);
HFONT font = CreateFont(5, 5, 0, 0,
FW_NORMAL, FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_ROMAN,
"MS Sans Serif");
SelectObject(pDC, font);
int txtLength = ::GetWindowTextLength(hwnd);
if ( txtLength > 0)
{
char *pString = new char [txtLength+1] ;
if ( pString != NULL )
{
::GetWindowText(hwnd, pString, txtLength+1);
TextOut ( pDC, 0, 0, pString, txtLength);
delete []pString;
pString = NULL;
}
}
::EndPaint(hwnd, &ps);
}
return NULL;
break;
default:
return ::DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
}
}
LRESULT OnEraseBkGnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if ( IsHandlerMessage( uMsg ) )
{
if ( m_spPicture )
{
BeginPaint( NULL );
RECT r ; GetClientRect( &r );
HDC hDC = GetDC();
HWND hWndChild =::GetWindow(m_hWnd, GW_CHILD );
while ( ::IsWindow( hWndChild ) )
{
if ( ::IsWindowVisible( hWndChild ) )
{
RECT rChild; ::GetWindowRect( hWndChild, &rChild );
ScreenToClient( &rChild );
ExcludeClipRect( hDC, rChild.left, rChild.top, rChild.right, rChild.bottom );
}
hWndChild = ::GetWindow( hWndChild, GW_HWNDNEXT );
}
PutPicture( m_spPicture, hDC, r );
ReleaseDC( hDC );
EndPaint( NULL );
::InvalidateRect(::GetDlgItem(m_hWnd, IDC_STATIC_TEXT), NULL, FALSE);
return TRUE;
}
}
bHandled = FALSE;
return FALSE;
}
|
|
|
|
|
You are calling invalidate rect in your OnEraseBkGnd handler? Why don't you just return 1 in OnEraseBkGnd and move everything into your OnPaint handler. If it still flickers, then do double buffering.
|
|
|
|
|
A property page contains 2 parts: TAB and page.
background color of page is easy to be changed, but TAB is hard to do (as I tested now).
the question is acturally:
How to change background color of TAB?
|
|
|
|
|
Owner drawing them should help and will provide more flexibility...
TCS_OWNERDRAWFIXED
Nibu thomas
Software Developer
|
|
|
|
|
Is it allowed and if yes then how do we use it?
|
|
|
|
|
No, in C++ case statements, the constant expression must be an integral type (numeric value. It must be promotable to an int or unsigned.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
-- modified at 22:27 Wednesday 3rd May, 2006
|
|
|
|
|
I'm not sure what happened! I'm getting about 87 errors all of a sudden and the following is the first error.
c:\program files\microsoft visual studio 8\vc\platformsdk\include\mmsystem.h(103) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'
I'm guessing something I installed overwrote something. Anyone ever run into this and how did you fix it??
Thanks!!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Ed K wrote: I'm guessing something I installed overwrote something
Did you do something nasty...!!
Nibu thomas
Software Developer
|
|
|
|
|
That was subsequent to installing the dastardly app!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|