Click here to Skip to main content
16,011,542 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with System Tray Icons Pin
jamestheprogrammer10-Jul-07 10:11
jamestheprogrammer10-Jul-07 10:11 
GeneralRe: Problem with System Tray Icons Pin
Perspx10-Jul-07 11:05
Perspx10-Jul-07 11:05 
AnswerRe: Problem with System Tray Icons Pin
Mark Salsbery10-Jul-07 10:12
Mark Salsbery10-Jul-07 10:12 
AnswerRe: Problem with System Tray Icons Pin
JudyL_MD10-Jul-07 10:26
JudyL_MD10-Jul-07 10:26 
GeneralRe: Problem with System Tray Icons Pin
jamestheprogrammer10-Jul-07 10:47
jamestheprogrammer10-Jul-07 10:47 
GeneralRe: Problem with System Tray Icons Pin
Mark Salsbery10-Jul-07 11:58
Mark Salsbery10-Jul-07 11:58 
GeneralRe: Problem with System Tray Icons Pin
Mark Salsbery10-Jul-07 12:02
Mark Salsbery10-Jul-07 12:02 
GeneralRe: Problem with System Tray Icons Pin
jamestheprogrammer10-Jul-07 12:20
jamestheprogrammer10-Jul-07 12:20 
Yeah, I think so (unless there's something I'm missing). I've created a Window class called SMStatusHelper, with lpfnWndProc set to the callback in the code I first posted.
<br />
/* create the window class */<br />
WNDCLASSEX wndClass;<br />
wndClass.cbSize = sizeof(WNDCLASSEX);							wndClass.style = CS_DBLCLKS;								<br />
wndClass.lpfnWndProc = WndProc;								<br />
wndClass.cbClsExtra = 0;								<br />
wndClass.cbWndExtra = 0;								<br />
wndClass.hInstance = hInstance;								<br />
wndClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICONSCREEN));<br />
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);<br />
wndClass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);<br />
wndClass.lpszMenuName = NULL;<br />
wndClass.lpszClassName = "SMStatusHelper";<br />
wndClass.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICONSCREEN_SMALL));<br />
RegisterClassEx(&wndClass);<br />
Then I create a new window using the SMStatusHelper class, WS_EX_TOOLWINDOW extended style, and WS_POPUP|WS_VISIBLE for the regular style, using the CreateWindowEx method. I take the return value of that and set it to a global variable called HiddenWindow, which is the hWnd value of the NOTIFYICONDATA structure I pass to Shell_NotifyIcon. So I'm pretty sure that's the right callback...

Thanks.
GeneralRe: Problem with System Tray Icons Pin
Mark Salsbery10-Jul-07 12:39
Mark Salsbery10-Jul-07 12:39 
AnswerRe: Problem with System Tray Icons Pin
jamestheprogrammer10-Jul-07 13:07
jamestheprogrammer10-Jul-07 13:07 
AnswerRe: Resource leaks Pin
David Crow10-Jul-07 8:06
David Crow10-Jul-07 8:06 
GeneralRe: Resource leaks Pin
tom groezer10-Jul-07 8:17
tom groezer10-Jul-07 8:17 
GeneralRe: Resource leaks Pin
Hamid_RT10-Jul-07 8:51
Hamid_RT10-Jul-07 8:51 
QuestionDeviceIoControl fails Pin
VC_RYK10-Jul-07 6:46
VC_RYK10-Jul-07 6:46 
AnswerRe: DeviceIoControl fails Pin
James R. Twine10-Jul-07 7:01
James R. Twine10-Jul-07 7:01 
QuestionAdding Pictures in Excel via Automation in VC++ Pin
priyankalakhe10-Jul-07 6:08
priyankalakhe10-Jul-07 6:08 
QuestionUnable to execute MFC Application on a machine where that app hasn't been built(Strange) Pin
Mushtaque Nizamani10-Jul-07 5:46
Mushtaque Nizamani10-Jul-07 5:46 
AnswerRe: Unable to execute MFC Application on a machine where that app hasn't been built(Strange) Pin
DevMentor.org10-Jul-07 6:06
DevMentor.org10-Jul-07 6:06 
GeneralRe: Unable to execute MFC Application on a machine where that app hasn't been built(Strange) Pin
Mushtaque Nizamani10-Jul-07 6:20
Mushtaque Nizamani10-Jul-07 6:20 
GeneralRe: Unable to execute MFC Application on a machine where that app hasn't been built(Strange) Pin
David Crow10-Jul-07 7:03
David Crow10-Jul-07 7:03 
GeneralRe: Unable to execute MFC Application on a machine where that app hasn't been built(Strange) Pin
Mushtaque Nizamani10-Jul-07 20:29
Mushtaque Nizamani10-Jul-07 20:29 
AnswerRe: Unable to execute MFC Application on a machine where that app hasn't been built(Strange) Pin
Mark Salsbery10-Jul-07 6:13
Mark Salsbery10-Jul-07 6:13 
AnswerRe: Unable to execute MFC Application on a machine where that app hasn't been built(Strange) Pin
James R. Twine10-Jul-07 6:32
James R. Twine10-Jul-07 6:32 
GeneralRe: Unable to execute MFC Application on a machine where that app hasn't been built(Strange) Pin
DevMentor.org11-Jul-07 12:33
DevMentor.org11-Jul-07 12:33 
AnswerRe: Unable to execute MFC Application on a machine where that app hasn't been built(Strange) Pin
Bram van Kampen11-Jul-07 15:28
Bram van Kampen11-Jul-07 15:28 

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.