|
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.
|
|
|
|
|
Check the order of includes.
- NS -
|
|
|
|
|
This error is most likely due to the statement before mmsystem.h was included. If previous statement includes a header file check if it is ok. If header file include before mmsystem.h includes class definition then check if there is a semi-colon at the end of its definition.
-Saurabh
|
|
|
|
|
This is usually caused by not including the correct headers. This line is typedefing MMVERSION and this error occurs if the type that it is typedefing it to has not been defined yet - usually a missing header. Basically, whatever is the identifier before MMVERSION on the line is undefined, so find out where it is defined and include the correct header file first.
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"
|
|
|
|
|
Hey folks
I need to create an installer for my application. I have some requirements:
* It must be super simple for a C++/newbie to use.
* It must be able to install a few registry keys in the HKEY_LOCAL_MACHINE hive.
* It must be able to easily install files to the Program Files/AppName directory as well as the Windows directory
* It must be able to have the option of running the newly installed applicastion upon installation.
* It must be able to allow uninstallations from the control panel->Add/Remove programs dialog
* Upon uninstallation it must check that the application is not currently running, or if it is, shut it down to continue the uninstallation process.
* Upon uninstallation it must be able to uninstall all registry keys it created.
* Hopefully it's free or very low cost.
Anybody have some good options for this?
Thanks!
|
|
|
|
|
Dacris Acti Setup is a good alternative to Install Shield and Wise, It only costs $249 and does everything you need plus a lot more.
|
|
|
|
|
|
Innosetup is another really good free installer.
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"
|
|
|
|
|
I am using developing an MFC Visual C++ 6.0 dialog based application. From the dialog box where I execute a series of tests (that may take 10 minutes to complete) I have a modeless dialog box that I display (via Create() and ShowWindow()) that informs the user that "Testing is in progress". I have a Cancel Test button in the modeless dialog so the user can abort the test at any time but the button does not work. Is there a way to do this, or do I have to move all of my test functions into the modless dialog class?
Thanks,
Buck
|
|
|
|
|
Are you running those tests on a separate thread? A modeless dialog doesn't run in a separate thread.
|
|
|
|
|
Thanks,
I haven't had to deal with threads yet, but I found a good article by Fritz Onion on Multithreading in MFC. I think I will be able to implement a UI thread to do what I need.
Buck
|
|
|
|
|
I've got a memory question. My program runs at around 5-6M under the memory usage when first started. And remains around that as it runs, however if I minimize it and re-open it, it runs at around 1.5M under the memory usage. I've checked for basic memory leaks and can't seem to find anything. Any thoughts on how I can get it to run at 1.5 on first startup? Any suggestions on good memory articles. Anythoughts would be appreaciated.
Cheers*
|
|
|
|
|
|
Thanks, It was really worthy
|
|
|
|
|
hmm I'm not sure If I'm not getting it or if I did not explain myself well. I also tried to implement the example in the link you gave me and could not get it to work. Where am I suspose to place the LRESULT CALLBACK? I realize that my program should use less memory when it is minimized however when I reopen(restore) my program(from being minimized) it runs with less memory(than when first started) at the same size as when I first initiated the program. Ie: Start the program 5-6M Minimize the program 400-800K Restore program 1-2M! Is my program now functioning less efficiently or was it using more memory that it needed to being with. Any thoughts would be greatfull to help inlighten my understanding. Cheers*
|
|
|
|