Re: SetMapMode
- From: "Steve" <sredmyer@xxxxxxxxxx>
- Date: 23 Mar 2007 04:17:45 -0700
On Mar 23, 6:45 am, "Mike Williams" <m...@xxxxxxxxxxxxxxxxx> wrote:
"Steve" <sredm...@xxxxxxxxxx> wrote in message
news:1174605512.159786.7910@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I need to find out the current mapping mode being
used by a window given only that windows hWnd.
As Michael C has already said, you can use the GetMapMode API. You can't use
it on the hWnd though, so you'll need to obtain the DC of the window and use
it on that:
z = GetMapMode(GetDC(Me.hwnd))
However, and this is a major point if you're using it on a VB window such as
a Form or PictureBox or any other VB window, which I think you may be doing,
you need to be aware that VB itself always uses a mapping mode of MM_TEXT
(device pixels), so you will get the same result (1) regardless of the VB
ScaleMode of the window, unless your code has temporarily altered the mode
of the window itself using the SetMapMode API (which is something you need
to take great care with if you don't want to badly upset VB and which I
think is unlikely in your case because if you had done so then you would
already know what the mapping mode was).
Mike
So given only the hWnd (which ofcoarse I know means I can also get the
hDc) how can I tell what the current ScaleMode setting of a VB window
is?
Thanks,
Steve
.
- Follow-Ups:
- Re: SetMapMode
- From: Mike Williams
- Re: SetMapMode
- From: J French
- Re: SetMapMode
- References:
- SetMapMode
- From: Steve
- Re: SetMapMode
- From: Mike Williams
- SetMapMode
- Prev by Date: Re: SetMapMode
- Next by Date: Re: Vista Certification with VB6
- Previous by thread: Re: SetMapMode
- Next by thread: Re: SetMapMode
- Index(es):
Relevant Pages
|