how to resize the systray to fit my clock replacment?

VC

    Next

  • 1. iframe in CDHtmlDialog
    Hi, In my htm file using CDHtmlDialog class there's a iframe. Example, <html> <body id=CCompEditNavigation bgcolor=white> ... some text ... <iframe src="140" id="myiframe"></iframe> </body> </html> Notice the src="140" The 140 is a resource ID to an htm file. Is there a way of working with file names rather than resource ID numbers? I would like to use names such as src="myiframe.htm". Thanks, Paul
  • 2. ON_UPDATE_COMMAND_UI and context menu
    I am trying to use ON_UPDATE_COMMAND_UI(id, handler) for menu item from context menu, but handler is not called. All is OK for menus from window menu bar. Does exist way how to use ON_UPDATE_COMMAND_UI also for context menus ? Peter
  • 3. Comparing strings pointed by * CStringA
    Hi Im using sql in my project, therefore im using CDBVariant class to retirve values from my table. If column in sql vas "varchar" , the object of CDBVariant is *CStringA type. I need to compare two pointers of CStringA . For example prt1 points on "ID1" and ptr2 points on "ID2". If there is a CStringA type, there is no problem, but when i got pointers to CStringA types, i completly dont know how to compare strings pointed by them. Thx in advance for help.
  • 4. How to trap Mouse right button click on PushButton in VC++
    I want to display a popup menu if the mouse is right clicked on the PushButton. In other words, how to trap right click action on Pushbutton in VC++???
  • 5. Problem with activex
    I have created an activex in mfc . It working is : A command is sent from the javascript to a application on the user's (local) machine .The activex just faciitates the communication .When the application completes its work it sends the reply back to the browser through the activex ( the activex has a server listening on xxxx port and the application connects to it for sending the reply ). It works fine in ie6 ,but when I try to run it on IE7 and IE8 the replies are sent back to the tab that has sent the last message . whereas I want the reply to be sent to the tab that initiated the request

how to resize the systray to fit my clock replacment?

Postby ELY_M » Tue, 07 Jun 2005 02:53:12 GMT

Take a look at those pics

before I run the program
 http://www.**--****.com/ ~area51/before.gif

after I run the program = notice I lost my AIM icon.... it overlapped
the AIM icon.
 http://www.**--****.com/ ~area51/after.gif


Im trying to replace my clock with the static.


my program is MFC based.

here is code:

void CStart_Button_ChangerDlg::OnClock2()
{



hTaskbar = FindWindowEx(NULL, NULL, _T("Shell_TrayWnd"), NULL);
if (hTaskbar)
{
hTray = FindWindowEx(hTaskbar, NULL, _T("TrayNotifyWnd"), NULL);
hStaticCtrl = ::GetDlgItem(m_hWnd,IDC_CLOCK);
ReplaceClock();
SetTimer(55,1000,0);



}

}

void CStart_Button_ChangerDlg::ReplaceClock()
{

CRect rcTray;
CRect rcStaticCtrl, rcNewStaticCtrl;

::GetWindowRect(hTray, &rcTray);
::GetWindowRect(hClockText, &rcStaticCtrl);




//::SendMessage(hTray, WM_SIZE, 0, 0);


rcNewStaticCtrl.left = rcTray.right - rcTray.left -
rcStaticCtrl.Width() - 0;
rcNewStaticCtrl.top = 2;
rcNewStaticCtrl.bottom = rcStaticCtrl.bottom;
rcNewStaticCtrl.right = rcStaticCtrl.right;

CWnd *pStaticCtrlWnd = GetDlgItem(IDC_CLOCK);
pStaticCtrlWnd->MoveWindow(&rcNewStaticCtrl);
pStaticCtrlWnd->ModifyStyle(0, 0, SWP_NOSIZE);


//HWND hWndStatic = GetDlgItem(IDC_CLOCK);




RECT rect;
CBrush hBrush;
CDC* hdc;
PAINTSTRUCT ps;
hdc = BeginPaint(&ps);
hdc->SaveDC();
hBrush.CreateSolidBrush(RGB(0,0,0));
hdc->SelectObject(hBrush);
GetClientRect(&rect);
hdc->Rectangle(&rect);
hdc->SetTextColor(RGB(0,255,255));
hdc->SetBkColor(RGB(0,0,0));
//hdc->SetBkMode(TRANSPARENT);
//hdc->SetBkMode(OPAQUE);
//hdc->RestoreDC(-1);

EndPaint(&ps);


//::InvalidateRect(hTray, NULL, FALSE);
//::InvalidateRect(::GetParent(hTray), NULL, TRUE);
SetWindowLong(hTray, GWL_STYLE, WS_CHILD|WS_VISIBLE|SS_BLACKRECT);

::SetParent(hClockText, hTray);

}


Similar Threads:

1.How to update/refresh/resize the systray after replace the windows clock with static

2.resizing frame to fit view

How do I resize the frame of my application to fit the view? I've tried
placing ResizeParentToFit in the OnSize handler of the view, but the results
were at best unpredictable, could anyone point me in the direction of some
example code?

Thanks,

James


3.How do I resize an excel sheet to fit the window view for a MDI

Hello,
I am trying to automate an excel workbook using MFC. How 
do I resize it programmatically to fit the window view for 
a MDI? If any one could help, I would appreciate it. 
Thanks,

Markus.

4.Resize frame from OleInPlaceSite to fit content f

Hi,

I need to correct mfcie example to handle possible 'window.open' calls
that resize the browser window. I have replaced the standard
IOleInPlaceSite::OnPosRectChange method imlementation (in order to
catch browser resizes)

My question is what is the correct and robust way to resize all things
to fit change browser size?

If I could get this notification inside the view, I would probably use
ResizeParentToFit, but I get it in my CCustomOleControlSite. In my
current solution I don't like that  the view is resizing things at an
upper level, I think ther should be a way to pass size change
notification to upper level and do the resize inside the view or
inside the frame. Also with this solution I see  the frame is first
created in a different size and then resized (when IE  show this page
it originally shows it with the right size).


thanks for any comments,
Alexey

The current Iimplementation:

STDMETHODIMP
CCustomOleControlSite::XCustomOleIPSite::OnPosRectChange(LPCRECT
lprcPosRect)
{
	METHOD_PROLOGUE_EX_(CCustomOleControlSite, CustomOleIPSite)
	ENSURE(pThis->m_pCtrlCont!=NULL && pThis->m_pCtrlCont->m_pWnd!=NULL);
	ENSURE(pThis->m_pInPlaceObject!=NULL);
	pThis->m_rect = lprcPosRect;
	HRESULT hr = pThis->m_pInPlaceObject->SetObjectRects(lprcPosRect,
lprcPosRect);
	if (SUCCEEDED(hr))
	{
		CFrameWnd * pFrame = pThis->m_pCtrlCont->m_pWnd->GetParentFrame();
		if (NULL!=pFrame)
		{
			RECT AdjustedRect = *lprcPosRect;
			pFrame->CalcWindowRect(&AdjustedRect, CWnd::adjustBorder);
			pFrame->SetWindowPos(NULL, -1, -1, AdjustedRect.right,
AdjustedRect.bottom, SWP_NOMOVE|SWP_NOZORDER);
			pFrame->CenterWindow();
		}
	}

	return  hr;
}

5.HELPPPP : Control that resize text to fit

Hi,

I am in a hurry because I have to finish my application by thursday.
I am facing a problem for now I want to display messages wit a maximized 
font in function of the text length.
IS there anyone who has a CStatic control that decreases the static font 
size to fit.
 


6. Resizing a pane in a CStatusBar to fit the text I want to display

7. Systray popup menu overlaps with Windows systray menu

8. restart the Device ( Time Clock Device ) when ever we push button on that clock



Return to VC

 

Who is online

Users browsing this forum: No registered users and 92 guest