PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Help with window regions

Hello Everybody...

I've been playing around with doing a skinable UI for an application so i tried to attach a window region to my window using the following code:

Code:

HRGN hRegion1 = CreateRectRgn(0,0,159,119);

HRGN hRegion2 = CreateRectRgn(160,120,319,239);

CombineRgn(hRegion1, hRegion1, hRegion2, RGN_OR);

SetWindowRgn(hWnd, hRegion1, true);

DeleteObject(hRegion1);
DeleteObject(hRegion2);


It seems to work so far, but when i tap the visible part of window with the stylus the window disappears (gets hidden). Activating the application in the task manager will not show the window again.

I'm using PocketPC 2000 and eVC 3.0.
Is it possible to use window regions under PPC2000?

Please help!

Regards,
Peter
Does your window behave properly without regions? This sounds more like an activation / Z Order problem.

Dan East
Yes it does behave properly without regions (can drag the window around, tapping *outside* the window will hide the window but that seems to be normal)

I almost copied 'n pasted a Win2K tutorial (from flipcode) to eVC and it works fine under Win2K.

With the region attached to the window i cannot tap inside the window and dragging the window around is also impossible (every tap inside will hide the window).

I can also provide you with the complete sourcecode if you wish.

Regards, Peter
It sounds like your region is inverted.

Dan East
If you want to send me your test app I can test it on a PPC 2003 device to see if it works. I don't think windows regions were supported for PPC 2000, because I wanted to use them several years ago and couldn't.

Dan East
Dan East wrote:If you want to send me your test app I can test it on a PPC 2003 device to see if it works. I don't think windows regions were supported for PPC 2000, because I wanted to use them several years ago and couldn't.

Dan East


I can send it to you later, right now i'm at work.
Do you know if regions were supported for PocketPC 2002?
I'm just wondering because attaching the region to the window (PocketPC 2000) will indeed change the shape of the window. The only thing that doesn't work is tapping the inside the window and dragging it around.
So if it wasn't supported back then, why does it work partly :?:
I may be wrong about that. The MSDN docs say that SetWindowRgn is supported all the way back to PSPC CE 2.12. I used to develop for PSPC CE 2.11, so that may be why I'm thinking it wasn't supported (still have a working Jornada 420 even).

How big is your window? I see your region is the full width of the screen.

Windows CE does not accept regions on windows that fit exactly into entire screen or greater dimensions.

Dan East
Ok i resized the window a to 200x200 but that didn't help either.

I attached the eVC 3.0 project for you. ( though it's not working in the eVC 3.0 "emulator")

Maybe i'm just plain stupid, i really hope so ;)
Attachments:
Regions.zip (74 KB)