Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidding application in taskbar

Status
Not open for further replies.

dominochmiel

Programmer
Jan 28, 2003
40
PL
I need to hide my app to tray. I'm calling Application->Minimize;. But after it my application is still showing itself at task bar. How can I hide it;
 
I found the solution. You should change WinMain function to this form:
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
DWORD dwExStyle = GetWindowLong(Application->Handle, GWL_EXSTYLE);
dwExStyle |= WS_EX_TOOLWINDOW;
SetWindowLong(Application->Handle, GWL_EXSTYLE, dwExStyle);

try
{

Application->Initialize();
Application->CreateForm(__classid(TMForm), &MForm);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
 
thid is indeed useful. I am curious about the use of the 2 catch statements.

tomcruz.net
 
Did you tried using a TrayIcon component?
This component is exactly what you are looking for



---LastCyborg---
 
I've done this before, but I forget which function I used. It was a MFC one. Try this one maybe.

BOOL ShowWindow(

HWND hWnd, // handle of window
int nCmdShow // show state of window
);

Set nCmdShow to SW_HIDE.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top