yakirtus | 3 May 2004 18:56
Picon
Favicon

WM_PAINT Failes

Hello,

I am trying to load a bmp in my app which uses WM_PAINT -and 

it failes.

Since i am a newbee to graphics maybe i am missing something in the 

app.

How do i invoke WM_PAINT ?(i think thats my problem).

What is the full procedure to loading a bmp using WTL?

Thanks 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com.  Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/saFolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/wtl/

<*> To unsubscribe from this group, send an email to:
(Continue reading)

Igor Tandetnik | 3 May 2004 19:06
Favicon

Re: WM_PAINT Failes

"yakirtus" <yakirtus@...> wrote in
message news:c75tjr+m02p@...
> How do i invoke WM_PAINT ?(i think thats my problem).

You don't - Windows does when it detects your window is in need of
repainting (e.g. when some other window that obscured yours is removed).
You can force it with InvalidateRect

> What is the full procedure to loading a bmp using WTL?

LoadImage, WTL or not.
--

-- 
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com.  Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/saFolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/wtl/
(Continue reading)

Pascal Binggeli | 3 May 2004 19:17
Picon
Favicon

Re: WM_PAINT Failes

What about BmpView in WTL sample folder?

Cheers,
Pascal

----- Original Message ----- 
From: "yakirtus" <yakirtus@...>
To: <wtl@...>
Sent: Monday, May 03, 2004 6:56 PM
Subject: [wtl] WM_PAINT Failes

> Hello,
>
> I am trying to load a bmp in my app which uses WM_PAINT -and
>
> it failes.
>
> Since i am a newbee to graphics maybe i am missing something in the
>
> app.
>
> How do i invoke WM_PAINT ?(i think thats my problem).
>
> What is the full procedure to loading a bmp using WTL?
>
> Thanks
>
>
>
>
(Continue reading)

richard | 4 May 2004 15:48

CPropertySheet Wizards: Header Images

Hi all,

I guess I'm a bit of a WTL newbie but I'm taking to it. Codeproject has 
lots of useful examples :-)

However, I'm having problems with a CPropertySheet set to operate as a 
Wizard.

I have a dialog application that is implemented using a CPropertySheet set 
to be a wizard. This works well so far, but I'd like to add a bitmap 
header to the top. From what I've discovered this should be performed 
using the SetHeader() method.
By calling SetHeader() I get the divider at the top, but above the 
divider (where the bitmap should be) is grey!

The code I have is:

		CPropertySheet sheet( _T("My Test Wizard") );

// (define the individual sheets here: fl, cl
// these inherit from CPropertyPageImpl )

		sheet.AddPage( fl );
		sheet.AddPage( cl );

		sheet.SetWizardMode();
		sheet.EnableHelp();

		HBITMAP hbmp = AtlLoadBitmapImage( IDB_HEADER_FILE, 
LR_SHARED | LR_DEFAULTCOLOR );
(Continue reading)

dbowen | 5 May 2004 00:47

RE: CPropertySheet Wizards: Header Images

SetWizardMode will add PSH_WIZARD to the property sheet flags, but you
want PSH_WIZARD97 if you're going to be doing a header bitmap.
SetHeader will unset PSH_WIZARD, and set PSH_WIZARD97 - so you might as
well remove your SetWizardMode call.  There are two overloads of
SetHeader.  One takes an existing HBITMAP (for which you manage the
lifetime), and one takes a resource name (or id). Instead of your
current SetHeader call, try this instead:

sheet.SetHeader(MAKEINTRESOURCE(IDB_HEADER_FILE));

Also, try calling all of your sheet setup calls (EnableHelp, SetHeader,
etc.) before you add any pages (it may not matter though, I don't
remember for sure).  In addition to the SetHeader, also try doing
SetWatermark with an appropriately sized bitmap.

If you are creating wizard 97 style wizards, I suggest reading the
wizard 97 spec [1] and the property page help that talks about creating
wizards [2].

You're going to want different exterior pages (welcome and completion)
and interior pages.  The exterior pages have a watermark (a bitmap
taking up the left side of the page [3]) and specify PSP_HIDEHEADER in
the page flags.  The interior pages have the header bitmap at the top
right [4], along with a header title and sub-title, and they specify
PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE in the page flags.

-Daniel

[1]
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wizard
(Continue reading)

Edwards, John | 5 May 2004 10:37
Favicon

RE: CPropertySheet Wizards: Header Images

In the constructor to my Wizard I set the header with a SetHeader call, this
sets the PSH_WIZARD97 style.  There is no need to call SetWizardMode since
this sets the style PSH_WIZARD which is turned off by the SetHeader call.
What you should be careful of is the loading of the Bitmap, the handle
probably needs to remain in scope while the Wizard is active.  Try deriving
a class from CPropertySheet and adding the bitmap handle to the class as a
member variable and remember to free it in the class destructor.  The other
thing is I call SetHeader before adding the pages, don't remember if that is
essential but might be worth a try.

John

-----Original Message-----
From: richard@... [mailto:richard@...]
Sent: 04 May 2004 14:48
To: WTL@...
Cc: richard@...
Subject: [wtl] CPropertySheet Wizards: Header Images

Hi all,

I guess I'm a bit of a WTL newbie but I'm taking to it. Codeproject has 
lots of useful examples :-)

However, I'm having problems with a CPropertySheet set to operate as a 
Wizard.

I have a dialog application that is implemented using a CPropertySheet set 
to be a wizard. This works well so far, but I'd like to add a bitmap 
header to the top. From what I've discovered this should be performed 
(Continue reading)

richard | 5 May 2004 10:31

Re: Digest Number 1202

Daniel,

Excellent post - thanks!

I went through each of your suggestions one at a time. It only started to 
work when I also switched the watermark on with SetWatermark. I used the 
same bitmap which is of course not the best, but it suddenly appeared 
where I wanted it.

I've printed off the suggested document about property sheets (2), and the 
style pages. Useful stuff - especially the style pages.
Looks like I have a lot more work to do, but at least the final result 
will look much better! :-)

Thanks once again!

Cheers,

Richard

>    Date: Tue, 4 May 2004 16:47:46 -0600
>    From: <dbowen@...>
> Subject: RE: CPropertySheet Wizards: Header Images
> 
> SetWizardMode will add PSH_WIZARD to the property sheet flags, but you
> want PSH_WIZARD97 if you're going to be doing a header bitmap.
> SetHeader will unset PSH_WIZARD, and set PSH_WIZARD97 - so you might as
> well remove your SetWizardMode call.  There are two overloads of
> SetHeader.  One takes an existing HBITMAP (for which you manage the
> lifetime), and one takes a resource name (or id). Instead of your
(Continue reading)

Nikos Bozinis | 6 May 2004 12:08
Picon
Favicon

PRB: tooltips and _WIN32_WINNT 0x0501

After a lot of head-scratching (and swearing all morning :)
I have discovered there's a bug in the tooltip control.

I was trying to add tools for a dialog (TTF_IDISHWND) and
no matter what I tried AddTool() would return false
(windows 2000)

Thanks to MFC source (!) I realized that unless 
TTTOOLINFO_V1_SIZE was used as the TOOLINFO's cbSize
AddTool would fail. I was burnt since I was building
for _WIN32_WINNT 0x0501

I don't know why the tooltip control behaves like that,
but while it does so WTL's CToolInfo must be modified
to use TTTOOLINFO_V1_SIZE instead of sizeof(TOOLINFO)

so this is a small WTL bug too...

nikos

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/saFolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/wtl/
(Continue reading)

korvenwtl | 6 May 2004 15:40
Picon

Re: PRB: tooltips and _WIN32_WINNT 0x0501

What you can do is to redefine TOOLINFO and LPTOOLINFO after 
commctrl.h has been included and before atlctrls.h.

...
#include <atlapp.h>

typedef struct tagTOOLINFOWFix {
    UINT cbSize;
    UINT uFlags;
    HWND hwnd;
    UINT_PTR uId;
    RECT rect;
    HINSTANCE hinst;
    LPWSTR lpszText;
	LPARAM lParam;
} *LPtagTOOLINFOWFix;

#undef LPTOOLINFO
#undef TOOLINFO

#define LPTOOLINFO   LPtagTOOLINFOWFix
#define TOOLINFO     tagTOOLINFOWFix

...

I don't agree with you that this is a bug. When you build for 
_WIN32_WINNT 0x0501 it should enable everything for Windows XP/2003.

- Björn

(Continue reading)

Nikos Bozinis | 6 May 2004 17:49
Picon
Favicon

Re: PRB: tooltips and _WIN32_WINNT 0x0501

> I don't agree with you that this is a bug. When you build for 
> _WIN32_WINNT 0x0501 it should enable everything for Windows XP/2003.
>

it does, but the tooltip itself is broken
if WTL doesn't cover that and forces me to do "workarounds" 
then i consider it a (small) bug!

basically there's a simpler workaround:
just use the existing TOOLINFO setting its cbSize
to TTTOOLINFO_V1_SIZE 
(as I said in my original post)

and instead of any method that implicitly uses CToolInfo
use one that takes a TOOLINFO* straight

--- In wtl@..., "korvenwtl"
<bjorn.kaxe@...> wrote:
> What you can do is to redefine TOOLINFO and LPTOOLINFO after 
> commctrl.h has been included and before atlctrls.h.
> 
> ...
> #include <atlapp.h>
> 
> typedef struct tagTOOLINFOWFix {
>     UINT cbSize;
>     UINT uFlags;
>     HWND hwnd;
>     UINT_PTR uId;
>     RECT rect;
(Continue reading)


Gmane