 |
|
 |
i think if u have a menu based dialog , u can not opt to make it a child else your menus would be gone
thanx
|
|
|
|
 |
|
 |
Hi techies,
I have created the dialog based application and for some unavoidable reasons, I was supposed to call another property sheet's DoModal function from the OnInitDialog function of my main application dialog class. Becoz of which task bar icon was not appearing. And then putting
// Show the task bar icon
ModifyStyleEx(0,WS_EX_APPWINDOW); this code in OnInitDialog of Property sheet worked and Task bar icon was appearing. But no luck with taskmanager list
Any help in this will be great help to me.
regards
smitha
My application class
BOOL CFlowCalSIDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
**** My code goes here**********
theApp.m_hMainWnd = m_hWnd;
CMyPropertySheet pSheet( IDS_TITLE_FCFV /*_T( "My appl" )*/ );
pSheet.SetWizardMode();
pSheet.DoModal();
**** My code goes here**********
return TRUE; // return TRUE unless you set the focus to a control
}
and in CMyPropertySheet.cpp file
BOOL CMyPropertySheet::OnInitDialog()
{
//Set the sheet icon
HICON hIcon = theApp.LoadIcon(MAKEINTRESOURCE(IDR_MAINFRAME));
SetIcon(hIcon, TRUE); // Set big icon.
SetIcon(hIcon, FALSE); // Set small icon
// Show the task bar icon
ModifyStyleEx(0,WS_EX_APPWINDOW);
return CPropertySheet::OnInitDialog();
}
|
|
|
|
 |
|
 |
Hi,
Could you solve this problem. I am also having the same problem, if you find the solution please let me know.
|
|
|
|
 |
|
 |
yes this was very useful , but i need to remove it fully not even in alt+tab combination.
how do i make it,pl help me.
|
|
|
|
 |
|
 |
Sorry my english.
Here is what I did:
In the InitInstance() function inthe CWinapp derived class created by the wizard in a dialog project
......
//Create a new dinamic "CInvisibleDlg" object
CInvisibleDlg* dlg = new CInvisibleDlg;
//Asingn the pointer to the m_pMainWnd variable
m_pMainWnd = dlg;
//Call Run for the Cwinapp derived class to begin the message loop
Run();
//When the dialog quits we delete it
delete dlg;
return FALSE;
} //End of the InitInstance() function
//////////////////////////////////////////////////////////////////////////////
In the .RC file change the dialog's EXSTYLE from WS_EX_APPWINDOW to WS_EX_TOOLWINDOW
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE |
WS_CAPTION
EXSTYLE WS_EX_TOOLWINDOW // Change WS_EX_APPWINDOW to WS_EX_TOOLWINDOW
and if you want a invisible window comment "WS_VISIBLE"
/////////////////////////////////////////////////////////////////////////////
And finally in the CDialog derived class, in this case "CInvisibleDlg", from within the Constructor just call Create( IDD ) were IDD is the resource simbol of the dialog template.
Just one last thing, in the dialog I override the function "OnOk()" to call "postQuitMessage( 0 )" because of another way the App never ends.
Hope This helps, and again sorry for my poor english.
|
|
|
|
 |
|
|
 |
|
 |
For any Doc/View application, change the fist argument in CreateEx() from 0 to WS_EX_TOOLWINDOW if you want to hide it from Alt-Tab. In this way, the created invisible window has WS_EX_TOOLWINDOW style, which does not appear in the task bar or in the window that appears when the user presses ALT+TAB. At the same time, invisible window's caption bar doesn't show up at all. No concern about the shrinked caption bar.
A perfect solution combined with Chris's code and MS WS_EX_TOOLWINDOW style.
|
|
|
|
 |
|
 |
How I can add an icon in the left superior corner (title of program) in a SDI, without enabling Document/View Architecture Support in Step 1.
thank you
|
|
|
|
 |
|
 |
How I can add an icon in the left superior corner (title of program) in a SDI, without enabling Document/View Architecture Support in Step 1.
thank you
|
|
|
|
 |
|
 |
Hello
I'm a graduating student with almost no experience in professional programming and I have a question:
How can I make my Visual Basic 6.0 windows application to run and show only as tray icon and not on task bar?
Thank you in advance
mickey
|
|
|
|
 |
|
 |
Solution is
CMainFrame::OnCreate () {
...
HICON icon = (HICON)::GetClassLong(m_hWnd, GCL_HICON);
if(icon)
{
HWND wnd = m_wndInvisible.m_hWnd;
::SetClassLong(wnd, GCL_HICON, (LONG)icon);
::SetClassLong(wnd, GCL_HICONSM, (LONG)icon);
}
|
|
|
|
 |
|
 |
I am trying to make my dialog-box based application work as follows:
- When the program starts, an icon in the status bar is created, but no icon in the taskbar
- When I press the icon in the status bar the application gets back to its normal state
Give me a demo !
ZHANGYIFEI
|
|
|
|
 |
|
|
 |
|
 |
In MSDN, they tell you the following to accomplish the same thing.
"To prevent the window button from being placed on the taskbar, create the window with the WS_EX_TOOLWINDOW extended style."
|
|
|
|
 |
|
 |
...and you end up with a teensy-weensy caption bar
cheers,
Chris Maunder
|
|
|
|
 |
|
 |
Yes you do, but you have to add one more line of code according to MSDN to remove the teensy-weensy caption bar, and here goes: "you must hide the window first (by calling ShowWindow with SW_HIDE)".
I made a small code example:
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, szTitle, WS_EX_TOOLWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
//
// Hide button in taskbar
ShowWindow(hWnd, FALSE);
return TRUE;
}
|
|
|
|
 |
|
 |
Use the extended window style WS_EX_TOOLWINDOW combined with the window style WS_POPUP. No more taskbar icon !!!
|
|
|
|
 |
|
|
 |
|
 |
And if so, will you show/explain the code so can we study how it was done?
thanks
|
|
|
|
 |
|
 |
Sorry for the late reply...
I've got it working in VC++6.0, VC++7.0 and VC++7.1 without any problems..
Do you or anyone else expirience any problems?
Al it takes is some good look at the examples
Albert van Peppen
|
|
|
|
 |
|
 |
Cheers for that! Been looking for an easy way to do this for ages!
|
|
|
|
 |
|
 |
Can anyone suggest a method to hide teh icon of a Console Application?
|
|
|
|
 |
 | Java  |  | Nick | 13:48 20 Jul '00 |
|
 |
Does anyone know how to write or spawn a Java application that sits on the Taskbar, but is hidden as in the example above? This would be like a service that runs in the background like NT
|
|
|
|
 |
|
 |
I'm just a beginner, and I'm trying to figure out how to do this in Delphi
|
|
|
|
 |
|
 |
Well, it's nice that the app icon doesn't appear duplicate (in the task bar ans the system trayy as well), but unfortunately, its task entry is also removed from the task LIST within the Task Manager if the window is minimized to the tray.
How can I avoid that (I always need that task list entry to obtain the corresponding window handle by using FindWindow(...))???
Or, in other words: How do I wake up that minimized window from within another process/application?
|
|
|
|
 |