Drawing the iconic window

Many years ago, it was possible to draw anything you wanted in the iconic window view.
Today, it seems like the SHell has taken this over completely. I've got two problems:

My app has no caption bar and no system menu, but I want to handle right-click on the
taskbar icon. No messages appear to be generated to indicate any activity in the task bar
icon.

My app would like to custom-draw the iconic representation on the taskbar, such as drawing
the icon and the caption. It does not appear this is possible. Note that the funny routine
that MFC generates for dialog-based apps, that is supposed to do a DrawIcon if the app is
iconic, never gets called if the app actually is iconized (I set a breakpoint just after
the IsIconic test and it is never taken).

Any ideas? I've fiddled with this for a couple hours now, lots of Spy++ usage, and I'm
stuck.
				thanks
				joe

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
5/28/2005 8:06:24 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
738 Views

Similar Articles

[PageSpeed] 41

It is possible to add a system menu to a window without caption bar as
follows:

void MyDialog::PreSubclassWindow()
{
	// Attach a system menu to this window
	LONG lStyle = GetWindowLong( this->GetSafeHwnd(), GWL_STYLE );

	SetWindowLong( this->GetSafeHwnd(), GWL_STYLE, lStyle | WS_SYSMENU );

	CDialog::PreSubclassWindow();
}

This includes the app icon in the taskbar.

I suppose you can then remove all entries from the menu with:

BOOL CX_MyDialog::OnInitDialog()
{
	CDLG_DialogManager::OnInitDialog();

	// Remove default system menu
	CMenu* pSysMenu = GetSystemMenu(FALSE);

	if( pSysMenu != NULL)
	{
		UINT nIC = pSysMenu->GetMenuItemCount();

		for( UINT n = 0; n < nIC; n++ )
			pSysMenu->RemoveMenu( 0, MF_BYPOSITION );
	}

....

}

More can be said about this approach but I am not sure if it is what
you are after.

Hope it helps though.

0
pakosan (57)
5/30/2005 5:56:48 AM
Sounds about like what I need. Much thanks.
					joe

On 29 May 2005 22:56:48 -0700, "Minus" <pakosan@yahoo.com> wrote:

>It is possible to add a system menu to a window without caption bar as
>follows:
>
>void MyDialog::PreSubclassWindow()
>{
>	// Attach a system menu to this window
>	LONG lStyle = GetWindowLong( this->GetSafeHwnd(), GWL_STYLE );
>
>	SetWindowLong( this->GetSafeHwnd(), GWL_STYLE, lStyle | WS_SYSMENU );
>
>	CDialog::PreSubclassWindow();
>}
>
>This includes the app icon in the taskbar.
>
>I suppose you can then remove all entries from the menu with:
>
>BOOL CX_MyDialog::OnInitDialog()
>{
>	CDLG_DialogManager::OnInitDialog();
>
>	// Remove default system menu
>	CMenu* pSysMenu = GetSystemMenu(FALSE);
>
>	if( pSysMenu != NULL)
>	{
>		UINT nIC = pSysMenu->GetMenuItemCount();
>
>		for( UINT n = 0; n < nIC; n++ )
>			pSysMenu->RemoveMenu( 0, MF_BYPOSITION );
>	}
>
>...
>
>}
>
>More can be said about this approach but I am not sure if it is what
>you are after.
>
>Hope it helps though.

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
5/30/2005 4:46:42 PM
Reply:

Similar Artilces:

Enlarge QAT (Quick Action Toolbar) icons
I've looked for a way (& through this forum) to enlarge the icons in 'my' QAT, but this does not appear to be possible. Am I overlooking some tweak that can do this or is the size of those icons really fixed? Thanks in advance for your comments. To get bigger icons, I believe you will have to change the screen resolution in Windows. -- Stefan Blom Microsoft Word MVP "PLDV" <PLDV@discussions.microsoft.com> wrote in message news:63C6AAD4-5308-4183-B227-BFED12196793@microsoft.com... > I've looked for a way (& through this forum...

Window's style
What's WS_OVERLAPPED-style window? Especially compared to WS_POPUP-style window? When to create such kind of windows? "A child window will always obscure it's parent." What does it mean by "obscure" here? Have a newly created window to be in one of only three styles: WS_OVERLAPPED, WS_POPUP and WS_CHILD? Thanks! "Asapi" <Asapi@net.net> wrote in message news:bbbCb.181917$Ec1.6861663@bgtnsc05-news.ops.worldnet.att.net... > What's WS_OVERLAPPED-style window? Especially compared to WS_POPUP-style > window? When to create such kind of...

Icon problem when grouping apps on XP taskbar.
I've been struggling with a wierd problem on Windows XP. I have an MFC dialog-based app that displays its icons fine everywhere except when XP consolidates multiple instances into a single button. Then the icon reverts back the MFC cube on the taskbar. The window icons are still fine. I've redefined both the 16x16 and 32x32 icons in the app. Any idea what's happening? This is very strange. ...

restrict amount received in Sales Trx Entry window
I would like to suggest for a way to restrict users from entering amount higher than the actual amount of invoice in the Sales Transaction Entry window. This will restrict the Amount Received field in the Sales Transaction Entry. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the m...

Shortcut icons viewed while open folder
Hi I am always trying to save many extra steps within my job. Here at work we have many different drives and folders upon sub-folders. When I do a File, Open within Excel, or even Word, on the left side of the Box it has some icons listed. Ie. My Documents History Desktop Favorites My Network Places My question is: How can you change those icons. For example. Instead of the My Documents going to "My Documents folder" I would like it to go to a different folder. 1)How do you change that? Can this be done. 2)Can you rename the "My Documents" to say something el...

Why does "windows in taskbar" not work in excel 2003
I am running Excel 2003 on WindowsXP Pro and the Windows in Taskbar does not work. Sometimes the Excel icon in the taskbar will disapear when you click on it; I have to click Alt+Tab in order to see and get to the open Excel session at that point. I ran Excel /regserver and Detect and repair and no luck. Try: Tools > Options > View and ensure Windows In Taskbar is checked. HTH hey DNA, Thanks for the reply but it doesn't work. basically when I turn it off and apply and then switch it back on it works but when Excel is closed and reopend, it no longer works. Anybody? &...

Non specific error on opening Outlook 2000 on Windows 2000 Pro system
"Cannot Open Microsoft Outlook. A program error has occurred. Quit Outlook and Windows and then start again." This happens with all profiles on the system. I've repaired Office, reinstalled Office, then uninstalled and reinstalled Office (and redownloaded and applied all patches). It still errors. Other Office apps open just fine. Outlook does connect to the Exchange server, since I can configure services and it recognizes the LAN ID. Any thoughts? Does it start in safe mode, go to Start > Run > type "Outlook /safe" without the quotes "Paula&qu...

Import Windows Mail to Live Mail going into "Storage Folders" inst
I have 4 email accounts on windows mail. I followed microsofts method 1 for importing my Vista Windows Mail to my Win7 Windows Live Mail account. (Export as Windows Mail, Import in Win Live Mail) I set up all 4 emails on my Windows Live Mail and imported, but all of the mail went into a separate area labeled "Storage folders". Now originally in Vista Windows Mail, all four accounts filtered into one inbox, one outbox, etc. Those folders were left intact, but did not get properly placed under the right account in WinLiveMail, and are not viewable when I click "all...

'Server XXXX Not Available.' When Trying To Add a Process Server in the DPS Server Setup Window
This is a multi-part message in MIME format. ------=_NextPart_000_0020_01C9BDE1.B1EBED50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Issue 'Server XXXX not available' occurs when trying to add a process server = in the DPS Server Setup window.=20 Resolution If the Process Monitor is not running at the workstation you are trying = to add as a new process server, you will receive the message 'Server = XXXX not available'.=20 To start the Process Monitor, drag the Dynamics.set file on top of the = DPS.exe file in your...

Windows for newly converted records not showing up...
We seems to have a problem with our CRM system where someone tries to "Convert a Lead" and clicks the "Open newly created record(s)" checkbox. The system will convert the lead and create all the necessary records, but it will NOT open the newly created records. At first I thought it was a Pop-Up block issue, but I tried it myself with all Pop-Up blocking turned OFF and it still is happening. Any Ideas? Regards, Eric S. ...

SOP transaction Payment window and UK Debit Cards
IN SOP GP 10 Payment Entry window we do not have the ability to enter the Start Date, issue number and even the card holders name shpuld this be different to the person requesting order (i.e. some one paying on behalf of someone else). Does anyone know how this can be implemented or is that we need to suggest to our client that an third party addon module is required. thank you Mickey GP is not interested in card data, only the payment information. To record (and process) card data, use something like Credit Card Advantage, a very good third party tools that captures all of that inf...

PocketPC / Windows Mobile Version of Publisher
Is there a PocketPC / Windows Mobile program that would allow me to view Publisher documents on my handheld device? - Thanks, JRD No -- JoAnn Paules Microsoft MVP - Publisher How to ask a question http://support.microsoft.com/kb/555375 "John R. Dougherty" <JohnRDougherty@discussions.microsoft.com> wrote in message news:E58ADAD0-DE1E-44AC-802C-EE5F2ACDC260@microsoft.com... > Is there a PocketPC / Windows Mobile program that would allow me to view > Publisher documents on my handheld device? > > - Thanks, > > JRD John R. Dougherty wrote: > Is ...

MS Outlook crashes Windows when importing large pst file
I recently had to reinstall MS office and Win2K on my PC because of a virus attack. I was able to import old archive pst files into outlook 2000 that were relatively small (<1 GByte). My most recent pst archive which had grown to 1.89 Gbytes crashes the Operating System (WIn2K) when I try to import it. As far as I can determine it is free of viruses/worms and has been scanned by the same SW (Network associates) that repaired my PCs. The MS utility to read large pst files (supplied on the MS support website) does not work - it needs a file that is a minimum of 2 GB. The Windows uti...

Windows Home Server Power Pack 3
KB968349 Power Pack 3 fails to install with windows update error: Installation Failure: Windows failed to install the following update with error 0x80070643: Windows Home Server Power Pack 3 (KB968349). For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Same goes for: dows Search 4.0 for Windows Server 2003 (KB940157) Any help much appreciated!! Raystl1n;1611403 Wrote: > KB968349 > Power Pack 3 fails to install with windows update > error: > > Installation Failure: Windows failed to install the follo...

Different Icon in Main window and Exe
Hello everyone, I am facing a strange problem please help me. In an application created using VC 6.0 I have created a icon for main window(with both sizes 32x32 and 16x16. But when I run it it shows a different icon in main window's title bar. But When I see the exe file in windows explorer I found the icon I created. This has worked properly earlier. Even in about dialog box it shows the correct icon. And it is also working in other two applications. What may be the problem? Please help me. With regards, Sunil I had a similar problem, but only with an SDI-App that didn't use ...

Properties Window is blank
When I click F-4 or View-Properties Window in a form VBA window of Access 2007 the window opens but is blank. How do I get it to show the properties? ...

Windows Automatic Updates
Heretofore I have received notices when updates were available for Windows and Defender. I am now being offered updates for Office 2003. Is there a way that I can "revert" to only Windows security updates? "JD" <erehwon@example.com> wrote in message news:#S2KcvOlKHA.2188@TK2MSFTNGP04.phx.gbl... > Heretofore I have received notices when updates were available for Windows > and Defender. I am now being offered updates for Office 2003. Is there a > way that I can "revert" to only Windows security updates? > You may have ena...

trouble sending messages through windows mail
Hello, I/m trying to help my father out with sending messages through Windows mail. It was working 2 days ago then all of a sudden I get a message like this: An unknown error has occurred. Subject 'i knew that was being worked on', Account: 'Fuse', Server: 'smtp.fuse.net', Protocol: SMTP, Server Response: '501 5.5.2 RCPT TO syntax error', Port: 25, Secure(SSL): No, Server Error: 501, Error Number: 0x800CCC63 Can someone please come to the rescue and either explain what this means or tell me how to fix this problem so that he can send email. Th...

Windows Live Messenger Sign In
I'm not sure what I did, but evereytime I boot up the computer the sign in screen for Windows Live Messenger poops up. I DO NOT want messenger, I did not sign up for messenger and I would like to know how to get this to stop. This started to happen after I logged into my hotmail account to retreive some emails. Any help would be great. Thanks txmike. Greetings txmike, When you start Hotmail, the Messenger API is called and Messenger starts if its installed. If Messenger hadn't been started before, or had been removed from the Windows startup using a third-party ...

Does Windows Live Mail have a newsgroup function ?
I read this newsgroup using Windows Mail. Does Windows Live Mail have a the newsgroup reader function ? TIA FDLeyda "Frank Drew Leyda" <mymail@nothere.com> wrote in message news:ew%23i$ar7KHA.1424@TK2MSFTNGP04.phx.gbl... >I read this newsgroup using Windows Mail. Does Windows Live Mail have a the >newsgroup reader function ? > > TIA > FDLeyda Yes. -- Regards Steve. MS-MVP. MAIL. [DTS] UK. http://www.getsafeonline.org/ http://www.microsoft.com/uk/citizenship/safeandsecure/parentadvice/default.mspx Thank you " mac&...

Vista, MFC and Maximizing Child Windows
I have created from scratch a multi-document project simply using the wizard, VC++ and MFC in Visual Studio 2005. (I have done nothing else to this test program.) When running the resultant exe on a Windows Vista machine I find that when the program is running at full screen, and I maximise any child window (CMDIChildWnd), the child window leaves a border of approximately 1/8in at the right hand side of the screen (as if it is still expecting the CMDIFrameWnd to have a thick border). Can anybody else reproduce this problem? Is this something which will be fixed in future releases of...

Windows Explorer Hangs
If I launch Windows Explorer via the "My Computer" icon or the WindowsLogo-E shortcut key, it hangs. When I launch Windows Explorer via the "My Documents" icon or the Start menu, it's fine. (When I reboot, it's usually okay either way for a little while. It starts to hang after I've launched it a few times.) Weird. Any thoughts? =?Utf-8?B?TWlrZQ==?= <Mike@discussions.microsoft.com> wrote in news:1FDAC243-B980-47E9-BD57-8C37C2198889@microsoft.com: > > If I launch Windows Explorer via the "My Computer" icon or the > W...

=?windows-1252?Q?Student_=96_Inventory_Offset_Account?=
Inventory Offset Account, is this a specific account or a generic term? When I go to setup a new item, on the Accounts screen (Item Account Maintenance) there is field labeled Inventory Offset. When inventory is received, I know to debit Inventory and credit Accrued Purchases so is that what this field is referring to? Update: I searched this forum for Inventory Offset and I read a few threads referring to the Inv. Offset account as a =93balancing account=94 when the system=92s not quite sure what to do. http://groups.google.com/group/microsoft.public.greatplains/browse_thread/t= hread/fe1...

Exchange 5.5 restore to windows 2000
Current Platform: Windows NT4 sp6a Exchange 5.5 sp4 enterprise Future Platform: Windows 2000 sp4 Advanced exchange 5.5 sp4 enterprise I have new hardware though I need to stay with Exchange 5.5. I would like to backup my existing information store and directory and restore to the new server. The netbios names are the same though after the restore the directory will not start. I am wondering if this is even possible since the OS's are different. I have searched all newsgroups and the web and have come up completely empty. Any thoughts would be great. Thank you, Adam Depends upon th...

window user/group can't see reports
Hi, I login as admin I can see folder/reports, but when login as normal user, it's a blank home page, can someone help here? thanks. RS has its own security that is role based. By default the local administrators group on the server is added to the admin role in RS. What you need to do is to add users or groups to the appropriate role in Reporting Services. Read up on Roles in books online and it will tell you how to go about this. If you set the role at the home level then all the folders under that will inherit from home. -- Bruce Loehle-Conger MVP SQL Server Re...