Click here to Skip to main content
15,913,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Modifying date Pin
ThatsAlok29-May-05 20:33
ThatsAlok29-May-05 20:33 
GeneralRe: Modifying date Pin
Weiye Chen30-May-05 18:23
Weiye Chen30-May-05 18:23 
GeneralRe: Modifying date Pin
ThatsAlok30-May-05 18:43
ThatsAlok30-May-05 18:43 
GeneralRe: Modifying date Pin
Neville Franks29-May-05 23:59
Neville Franks29-May-05 23:59 
GeneralRe: Modifying date Pin
Toni7830-May-05 10:51
Toni7830-May-05 10:51 
GeneralCommand line input with assembly Pin
Cpudood29-May-05 14:46
Cpudood29-May-05 14:46 
GeneralRe: Command line input with assembly Pin
Toni7829-May-05 15:51
Toni7829-May-05 15:51 
Generalmy systray clock color changer code do not work and it crashes Pin
ELY M.29-May-05 13:59
ELY M.29-May-05 13:59 
This is my MFC dialog project.

Im working on code to change my systray clock color to some colors.
both background and text to different color.

take a look at my code.


void CStart_Button_ChangerDlg::OnClock()
{


RECT rc;
HWND hWnd = ::FindWindow("Shell_TrayWnd", NULL);

if (hWnd) {
if (NULL != (hWnd = ::FindWindowEx(hWnd, NULL, "TrayNotifyWnd", NULL))) {
if (NULL != (hWnd = ::FindWindowEx(hWnd, NULL, "TrayClockWClass", NULL))) {

//::SendMessage(hWnd, WM_SETTEXT, 0, (LPARAM)(LPTSTR) TEXT("TEST") );

HDC hdcClock;


COLORREF col;
HDC hdc;
char s[1024];

if(hdcClock) DeleteDC(hdcClock); hdcClock = NULL;



//if(bFillTray)

hWnd = ::GetParent(hWnd);
::GetClientRect(hWnd, &rc);

hdc = ::GetDC(NULL);

hdcClock = CreateCompatibleDC(hdc);
if(!hdcClock)
{
::ReleaseDC(NULL, hdc);
return;
}


//SelectObject(hdcClock, hFon);
SetBkColor(hdcClock, RGB(0,0,255));
SetBkMode(hdcClock, TRANSPARENT);
SetTextAlign(hdcClock, TA_CENTER|TA_TOP);
SetTextColor(hdcClock, RGB(0,255,255));

//FillClock(hWnd, hdcClock, &rc, 0);

HBRUSH hbr;
HDC hdcTemp;
int nblink;
RECT *prc;

if(nblink == 0 || (nblink % 2)) col = RGB(255,255,0);
else col = RGB(255,0,0);
//if(col & 0x80000000) col = GetSysColor(col & 0x00ffffff);
//SetBkMode(hdc, OPAQUE);
//SetBkColor(hdc, col);

hbr = CreateSolidBrush(col);
FillRect(hdc, prc, hbr);
DeleteObject(hbr);



::ReleaseDC(NULL, hdc);



MessageBox("TEST PASSED");



}
}


}

GeneralRe: my systray clock color changer code do not work and it crashes Pin
Christian Graus29-May-05 14:20
protectorChristian Graus29-May-05 14:20 
Generalhelp me !!(about multy thread using csocket) Pin
NPDemon29-May-05 5:19
NPDemon29-May-05 5:19 
GeneralRe: help me !!(about multy thread using csocket) Pin
John M. Drescher29-May-05 14:34
John M. Drescher29-May-05 14:34 
GeneralRe: help me !!(about multy thread using csocket) Pin
NPDemon29-May-05 15:33
NPDemon29-May-05 15:33 
GeneralRe: help me !!(about multy thread using csocket) Pin
trelliot29-May-05 16:57
trelliot29-May-05 16:57 
GeneralRe: help me !!(about multy thread using csocket) Pin
NPDemon29-May-05 20:40
NPDemon29-May-05 20:40 
GeneralCDC and transparent blitting Pin
Cedric Moonen29-May-05 4:06
Cedric Moonen29-May-05 4:06 
GeneralRe: CDC and transparent blitting Pin
Chris Losinger29-May-05 5:28
professionalChris Losinger29-May-05 5:28 
GeneralRe: CDC and transparent blitting Pin
Michael Dunn29-May-05 5:35
sitebuilderMichael Dunn29-May-05 5:35 
GeneralRe: CDC and transparent blitting Pin
Cedric Moonen29-May-05 5:44
Cedric Moonen29-May-05 5:44 
GeneralRe: CDC and transparent blitting Pin
Christian Graus29-May-05 12:05
protectorChristian Graus29-May-05 12:05 
GeneralRe: CDC and transparent blitting Pin
Cedric Moonen29-May-05 20:05
Cedric Moonen29-May-05 20:05 
GeneralRe: CDC and transparent blitting Pin
John R. Shaw30-May-05 14:27
John R. Shaw30-May-05 14:27 
Generaldata not accepted Pin
anup nambiar29-May-05 4:04
anup nambiar29-May-05 4:04 
GeneralRe: data not accepted Pin
Christian Graus29-May-05 12:11
protectorChristian Graus29-May-05 12:11 
GeneralRe: data not accepted Pin
trelliot29-May-05 14:29
trelliot29-May-05 14:29 
GeneralRe: data not accepted Pin
anup nambiar29-May-05 20:41
anup nambiar29-May-05 20:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.