Hi I have seen an example done in MASM (no source)
were SHP1 and SHP2 were used to create an exe that was separated in 2 ( it was transparent were there was no shape)
This is not to be confused with regions... there was no regions used at all or bitmaps...
I have always wanted to know how it was done ...
This is the rsrc.rc
Any idea how it was done??? any body ever came across this???
I'd love to know ...
P.S.
In my search for creating that effect of a see through area I did find how to put a "Glass hole" in a window ( that is not what I am looking to do)
but I figured some of you would appreciate the example that were one this page ... here is that page:
http://geocities.ws/xmemor/2lz/tinyasm.html
and here is that rsrc.rc
that is a very interesting site
and interesting URL - i thought geocities was gone :P
here is some stuff you might also enjoy...
http://www.codeproject.com/KB/library/XXcontrols.aspx
there is another one called "sdraw.lib" - a little hard to find, though
someplace, i remember seeing circular radio knob controls that rotate, but i can't find that one
these aren't the knobs i was looking for, but similar
http://www.c-sharpcorner.com/UploadFile/desaijm/KnobControlusingWindowsForms11182005004925AM/KnobControlusingWindowsForms.aspx
more from the same guy
http://www.codeproject.com/KB/cpp/knobcontrol.aspx
the ones i remember had a variety of controls
you also had the option of adding a slider along side the knob - different colors/sizes, etc
maybe when i become a bit more proficient, i may attack something like that :P
(http://www.mistletoenholly.com/images/store/fullsize/120691396318.jpg)
(http://www.w2pa.com/_/rsrc/1225070883208/Home/articles/what-heathkit-learned-from-the-collins-s-line/S-knobs.jpg?height=103&width=200)
(http://www.dtsohio.com/N8BX/Collins/Collins-S-Line-Knob3.jpg)
couldn't resist - my current rig....
(http://www.n9efj.net/ts940s.gif)
it would be cool to have a library to make a panel like that - meters and all :P
So nothing so far on this shape thing :(
hi,
in the attachment an quick example on an 'own-shaped window'.
Quote from: dedndave on April 29, 2011, 03:45:40 AM
someplace, i remember seeing circular radio knob controls that rotate, but i can't find that one
off the top of my head
there is an audio mastering suite (Nuendo) has the same rotating dial feature.
seems like the same task as a 3D button that swaps between two images when depressed/relleased.
track the mouse movement in a region close to the dial image and change images according to change in mouse coords.
the resolution of the rotation may require a lot of images. so use two images one for the body of the knob and one for the indicator pip.
and just redraw the indicator pip and highlight in the new positions
Unless you want to use an open GL thing and actually rotate the object.
im trying to remember where the code was that made a series of rotating balls that shifted rotation axis in the direction of the mouse when you click near them, HMM.. have to dig through the archives
well,
creating rotating knobs isn't a hard job. I've done this some time back using GDI+ (also donable with the GDI) - all you need is some basic knowledge on vectors and matrices.
TestDepartment had a good example of masking buttons with regions, you can download the archive at the forum web site:
https://masmforum.com/download/td_win32asm_all.zip
EDIT:
There is a New reviewed & updated version, provided by 'elC' here:
https://masmforum.com/download/td_win32asm_all_reviewed_by_elC.zip
Also I think Qvasimodo did a region from bitmap thing once, not sure where you can get that, I haven't heard from him in a couple of years.
Edgar
Quote from: donkey on April 30, 2011, 04:01:50 AMTestDepartment had a good example of masking buttons with regions, you can download the archive at the forum web site:
https://masmforum.com/download/td_win32asm_all.zip
EDIT:
There is a New reviewed & updated version, provided by 'elC' here:
https://masmforum.com/download/td_win32asm_all_reviewed_by_elC.zip
Also I think Qvasimodo did a region from bitmap thing once, not sure where you can get that, I haven't heard from him in a couple of years.
Edgar
Hi I posted an example of a region from bitmap here :
http://www.masm32.com/board/index.php?topic=16480.0
It is in: "CAPSLOCK_ON Message_2.zip"
I use The RGN Generator...( that is what everybody uses :bg )
(http://www.codeguru.com/img/legacy/tools/RGNCreator.gif)
I tried to upload it ( but it said that the attachment was too big 320KB ?)
So here it is:
http://www.codeguru.com/code/legacy/tools/RGNCreator_demo.zip
It is from here:
http://www.codeguru.com/tools/standalonetools/article.php/c1389
So easy to use :bg
Quote from: qWord on April 29, 2011, 10:16:42 PM
hi,
in the attachment an quick example on an 'own-shaped window'.
Thanks for the replay qWord.. I guess I should of titled my topic better what I am trying to achieve is a user defined owner draw shape using a resource file and "IDC_SHP1"
please see "What I am trying to accomplish but with SHP in rsrc.zip" ... I was able to do that one with the above region creator
I want to do it with "IDC_SHP1" in the resource , that way you have more control over the region , and you do not need a new bitmap all the time!
here is an example that I tried ( I tried over 30 of them by now LOL):
"Owner draw shapes using IDC_SHP.zip"
I can not find anything on IDC_SHP???
almost anything you can do in a resource file, you can also do in code
in many cases, the code may be smaller, too :P
Quote from: dedndave on April 30, 2011, 09:29:17 PM
almost anything you can do in a resource file, you can also do in code
in many cases, the code may be smaller, too :P
The point of my question was how to use "IDC_SHP1" using a resource file to create owner draw shape
i don't think you can make a region owner drawn in resource
you can create the window, like any other window, in the resource file
but, what gives it shape is the code that is typically found in the WM_CREATE handler
here an example using GDI+
@dedndave
I have seen ( I have a little app example) that was created just like that with 2 IDC_SHP in the resource file... So I know it is possible ::)
any ways I had too many windows open and in my house keeping frenzy I deleted it .... :(
the good copy that I complied like that is just the GUI , the source I though I moved to my project folders ...but sadly ... it got recycled...
by the time I notice it was gone ... even a restore data program could not salvage it ( must of wrote over the sectors )
Quote from: qWord on April 30, 2011, 11:06:22 PM
here an example using GDI+
Do you have one with "IDC_SHP1" in a resource file that does not deal with regions?
I looked in the MASM32 examples and the only thing that IDC_SHP1 is used there , is for drawing "V" grooves ???
after looking at XXcontrols, i see he made a round button in resource
Quote from: dedndave on April 30, 2011, 11:15:17 PM
after looking at XXcontrols, i see he made a round button in resource
you lost me there? what are you talking about?
well, at the beginning of this thread, i mentioned XXcontrols - i think it was the 2nd post
if you look at his "button" example, you will see what i am on about :P
sorry hfheatherfox07,
I did not understand what you are trying to do. What is your problem with these resource-ID IDC_SHP1? - it is just some number.
Quote from: qWord on April 30, 2011, 11:25:15 PM
sorry hfheatherfox07,
I did not understand what you are trying to do. What is your problem with these resource-ID IDC_SHP1? - it is just some number.
my first post if you open my attachment and look at the rsrc.rc you will see what IDC_SHP1
do you use rsrc.rc files?
I use ResEd to make and edit mine:
(http://radasm.cherrytree.at/wp-content/uploads/2009/06/screenshot_085_resource-editor-d__freebasic__fertige-projekte_battle-event-converter_bevcrc.png)
you can get it free here:
http://radasm.cherrytree.at/resed/
QWord look at my 10th post down in the first page there are 2 attachments , they are what I am trying to do... you will understand IDC_SHP :bg
Quote from: dedndave on April 30, 2011, 11:23:26 PM
well, at the beginning of this thread, i mentioned XXcontrols - i think it was the 2nd post
if you look at his "button" example, you will see what i am on about :P
OK now I see that has nothing to do with IDC_SHP ... it is more to do with buttons ...
all "IDC_SHP" is, is a static control. Nothing fancy. If you want to have a special shape, use an owner drawn static control
Quote from: Gunner on April 30, 2011, 11:34:12 PM
all "IDC_SHP" is, is a static control. Nothing fancy. If you want to have a special shape, use an owner drawn static control
LOL that is funny ...I know that
if you look at my first post or my 10th on the first page you will see that I am trying to use "IDC_SHP" , to make my window to that region ... so If i have 2 IDC_SHP statics
that is what will define my window shape those 2 IDC_SHP statics....
if you want to create an window like in your example "What I am trying to accomplish but with SHP in rsrc.zip", you MUST deal with regions.
That example you posted uses regions... Why don't you want to use regions?
Quote from: Gunner on April 30, 2011, 11:43:31 PM
That example you posted uses regions... Why don't you want to use regions?
The whole point is not to...
I do not wish to add bitmaps
Quote from: qWord on April 30, 2011, 11:42:03 PM
if you want to create an window like in your example "What I am trying to accomplish but with SHP in rsrc.zip", you MUST deal with regions.
not true ... you do have to draw the rects but no regions
I want to have the clear window separating the 2 squares
when I get home I will grab that example that I have done that way and post it...
the cool thing is that you can open the rsrc.rs file change the IDC_SHP rectangle size and your window size changes
the rects are drown to the resource dimensions so you do not always have to plug in new dimensions :8)
Ok here they are ...
This was posted on a foreign language forum (I think it was in Chinese) to show off this persons MASM skills...
I am kicking my self in the for deleting the source by accident :(
I do not remember were I originaly downloaded this :(
as you can see the IDC_SHP directly effects the size of the windows
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
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....
(http://www.masm32.com/board/index.php?action=dlattach;topic=16579.0;id=9192)
I am sorry I am not familiar with file extension .asc
what do you do with TwoRegions.asc ?
To see the source: *.asc opens fine in WordPad or MS Word. To assemble the source, open with RichMasm.exe (part of the MasmBasic (http://www.masm32.com/board/index.php?topic=12460) library) and hit F6.
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
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
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
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
Here is another one - you will hate it :green2
(try typing something in the edit box :bg)
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
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
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...
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 ^^
Thanks ....
:bg
Quote from: dedndave on April 29, 2011, 04:47:25 AM
these aren't the knobs i was looking for, but similar
http://www.c-sharpcorner.com/UploadFile/desaijm/KnobControlusingWindowsForms11182005004925AM/KnobControlusingWindowsForms.aspx
more from the same guy
http://www.codeproject.com/KB/cpp/knobcontrol.aspx
the ones i remember had a variety of controls
you also had the option of adding a slider along side the knob - different colors/sizes, etc
maybe when i become a bit more proficient, i may attack something like that :P
(http://www.mistletoenholly.com/images/store/fullsize/120691396318.jpg)
(http://www.w2pa.com/_/rsrc/1225070883208/Home/articles/what-heathkit-learned-from-the-collins-s-line/S-knobs.jpg?height=103&width=200)
(http://www.dtsohio.com/N8BX/Collins/Collins-S-Line-Knob3.jpg)
couldn't resist - my current rig....
(http://www.n9efj.net/ts940s.gif)
it would be cool to have a library to make a panel like that - meters and all :P
This would be a cool Idea...
I found some example of circular rotation... I am not sure if it will help or not but I will upload them...
I also found an example of a working meter ASM but it is in C language here:
http://www.codeproject.com/KB/miscctrl/3dmeter.aspx
My idea was to make an animated gif meter using bmp's I will attach an animation example
Also for the LCD display there is an example in the MASM examples in MASM v9
Finally I have seen example like this ( not ham radios) ...but I know that you need to use any software that you like ( most people use adobe photo shop) to create a main skin that is missing all the buttons and than each button set separately ...see main+button bpm inside.zip to see what I mean
Also than just create a region for the main skin ( don't include the buttons area's as part of the skinning other wise the buttons wont show there! ) that is why I made the area to region in mangenta
here is the rest of attachment
Sorry it would let me upload more than a certain size so here is one more ( animate using bmp -you can use that to make the meter)
when i have a large file i put it on a fileshare and provide a link
i use www.4shared.com (http://www.4shared.com), but there are a number of free ones
also, i use http://imageshack.us/ for free image hosting
(http://img163.imageshack.us/img163/8456/setuphumour.gif)
unfortunately, they only store the first frame of an animated gif for some reason :'(
you can rename the image to .ZIP and attach it, then post the link as an image
(http://www.masm32.com/board/index.php?action=dlattach;topic=16579.0;id=9213)
the attachment is the above GIF image renamed to ZIP
Quote from: dedndave on May 02, 2011, 01:15:45 AM
when i have a large file i put it on a fileshare and provide a link
i use www.4shared.com (http://www.4shared.com), but there are a number of free ones
I thought I 'd upload 7-zip portable for you:
http://www.megaupload.com/?d=SNUIPKMP
No need to install it ... I added a fun Icon to the folder :bg
This little puppy will compress big files pretty small ( you can set the compression levels ) it does .zips :bg
I forgot I had this LOL ::)
i use 7-zip for all kinds of things
you can also use it for CAB and MSI files, as well as ISO files :U
Quote from: dedndave on April 29, 2011, 04:47:25 AM
these aren't the knobs i was looking for, but similar
http://www.c-sharpcorner.com/UploadFile/desaijm/KnobControlusingWindowsForms11182005004925AM/KnobControlusingWindowsForms.aspx
more from the same guy
http://www.codeproject.com/KB/cpp/knobcontrol.aspx
the ones i remember had a variety of controls
you also had the option of adding a slider along side the knob - different colors/sizes, etc
maybe when i become a bit more proficient, i may attack something like that :P
(http://www.mistletoenholly.com/images/store/fullsize/120691396318.jpg)
(http://www.w2pa.com/_/rsrc/1225070883208/Home/articles/what-heathkit-learned-from-the-collins-s-line/S-knobs.jpg?height=103&width=200)
(http://www.dtsohio.com/N8BX/Collins/Collins-S-Line-Knob3.jpg)
couldn't resist - my current rig....
(http://www.n9efj.net/ts940s.gif)
it would be cool to have a library to make a panel like that - meters and all :P
I remembered this post ...I found a rotating knob ASM I think it is Fasm ...but the only one I have seen of an actual rotating knob ...if you want it
well - that one is vector generated
but, a rotating BMP might look nice
it does give some ideas, though - thanks
I don't know how to do this for a dialog, but for an application window you should be able to achieve the transparency effect by specifying zero for the hbrBackground member of WNDCLASS or WNDCLASSEX.