Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-11

Draw scaled icon (was: Win32 and system tray)

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bernhard Steffen

Hi Thomas,

Show quoted text 5 lines
In order to hide your application window from the taskbar and alt-tab dialog create your window with WS_EX_TOOLWINDOW in the dwExStyle param of CreateWindowEx() and don't specify WS_VISIBLE in the dwStyle param. It's exact description can be found on msdn.microsoft.com as well.

thanks for your help. I found the doc files you mentioned, and hiding my program from taskbar works well.

I could't download the mentioned unit for ShellNotifyIcon ("unknown server"), but finally decided I do need a program window, anyway ;-) (although one in "toolwindow" style)

...which leads to my next question:

- I can extract a program's icon by using the ExtractIcon() function.
- I can paint this icon by using DrawIcon() function - but then it's drawn in the icon's original size (16x16 or 32x32).

How can I scale this icon and draw it in 8x8 pixels?

Currently I'm doing the following in the wm_paint section of function WindowProc:
(ps is a paintstruct, r a rect)

	dc:=BeginPaint(hWindow,@ps);
	GetClientRect(hWindow,@r);
	DrawIcon(dc,0,0,hIcon);
	EndPaint(hWindow,ps);
	Exit;

Sorry, I'm a complete newbie to Win32 gui programming...

Thanks for your help!

Bernhard