News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

User defined shapes?

Started by hfheatherfox07, April 29, 2011, 03:20:31 AM

Previous topic - Next topic

qWord

this program do it as follow:
- it determines the (client) postion of dialogs controls (2 statics).
- using these coordinates it creates two rectangular regions  and combine them
- the dialogs region is then replaced by the new one
FPU in a trice: SmplMath
It's that simple!

Gunner

Those samples DO use regions... that is the only way to do it...

Open them in your debugger and you will see... CreateRectRgnIndirect, CreateRectRgn, CombineRgn etc....
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

jj2007


hfheatherfox07

I am sorry I am not familiar with file extension .asc   
what do you do with  TwoRegions.asc  ?

jj2007

To see the source: *.asc opens fine in WordPad or MS Word. To assemble the source, open with RichMasm.exe (part of the MasmBasic library) and hit F6.

hfheatherfox07

LOL thanks for the try I think right now that is out of my skill level to understand  :(

I think I will try the IDC_SHP thing

hfheatherfox07

Quote from: Gunner on May 01, 2011, 12:48:48 AM
Those samples DO use regions... that is the only way to do it...

Open them in your debugger and you will see... CreateRectRgnIndirect, CreateRectRgn, CombineRgn etc....

I have another example at home that I tried ... although I can draw the 2 rects I can not make them into a region all it looks like is 2 squares drawn an a static

what I am tying to say Is I do not know how to tie the IDC_SHP with the rect that I am drawing

I tried
invoke SetWindowRgn,hWnd,IDC_SHP1,TRUE 

that crashed LOL

hfheatherfox07

I found some examples on CreateRectRgnIndirect, CreateRectRgn here:


http://comrade.ownz.com/docs/shapewnd.html

Download the attachment

http://comrade.ownz.com/docs/shapewnd.zip

It is not what I am looking to do with IDC_SHP

but it will give me a start ....

anyways I figured I'd share the example that I found , in case some of you were interested as well :bg


Gunner

Quote from: hfheatherfox07 on May 01, 2011, 01:36:28 AM
Quote from: Gunner on May 01, 2011, 12:48:48 AM
Those samples DO use regions... that is the only way to do it...

Open them in your debugger and you will see... CreateRectRgnIndirect, CreateRectRgn, CombineRgn etc....

I have another example at home that I tried ... although I can draw the 2 rects I can not make them into a region all it looks like is 2 squares drawn an a static

what I am tying to say Is I do not know how to tie the IDC_SHP with the rect that I am drawing

I tried
invoke SetWindowRgn,hWnd,IDC_SHP1,TRUE 

that crashed LOL

Of course it crashed... IDC_SHP1 is not a region, it is an equ for a dialog identifier

int SetWindowRgn(
  HWND hWnd,     // handle to window
  HRGN hRgn,     // handle to region
  BOOL bRedraw   // window redraw option
);


The only place you would use IDC_SHP1, is with the dialog box functions that take an identifier as a parameter
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

jj2007

Here is another one - you will hate it :green2

(try typing something in the edit box :bg)

dedndave

IDC_xxxxx is normally used for cursors
you should come up with a different convention   :P

i like it Jochen   :bg
except i can't close it without task manager - lol

hfheatherfox07

Thanks.... I will look into it
so far I believe that you are right CreateRectRgnIndirect, CreateRectRgn, CombineRgn etc ( debugger wouldn't lie LOL)

I found another article and attachments that deal with that although it is in c language I belive we can use it in MASM

http://www.flipcode.com/archives/Win32_Window_Skinning.shtml

jj2007

Dave,

Alt F4 or Escape should close it. At least it does under Win XP SP2...
Version 3 above allows to use the edit box. Hold Shift...

qWord

ok - this should come very near to what you expect hfheatherfox07: simply modify the *.rc - the region is automatically created at startup.

@JJ: i like your idea of these moving hole ^^
FPU in a trice: SmplMath
It's that simple!

hfheatherfox07