Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to resize the systray to fit my clock replacment?

how to resize the systray to fit my clock replacment?

Scheduled Pinned Locked Moved C / C++ / MFC
c++linuxtutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ELY M
    wrote on last edited by
    #1

    take a look at those pics before I run the program http://69.50.187.114/~area51/before.gif after I run the program = notice I lost my AIM icon.... it overlapped the AIM icon. http://69.50.187.114/~area51/after.gif 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); }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups