Resize window Selection Rectangle?
BlitzMax Forums/MaxGUI Module/Resize window Selection Rectangle?
| ||
I was wondering if anyone knows a way to resize a window to have it only display a highlighted selection rect instead of showing the window actually resized while your resizing it. I've seen some apps do this. for instance Trillian's Windows use a selection Box for resizing and then the window is redrawn after the size is set. Im sort of doing the same thing with skinned windows and i cant have my program constantly reskin the windows transparency areas while the user is resizing the window. Im probably not going to be using the typical window resizing ability. Im making hot spots for resizing and doing it myself. but i want to show a rect on the screen of the size of the window before i have the window redrawn to that size. |
| ||
As far as I know this can be turned on and off in the effects options of Windows. Don't know how to force this. |
| ||
I know there is a user32 command called Drawfocusrect() i could try playing around with it to see if i can get something to show up. I know its used for drawing those i saw it on a WINAPI tutorial. |
| ||
Alright! i figured out how to draw the focusrect on the screen to simulate resizing without actually resizing the window until your done dragging the focus rect. Anyways the code to make it appear is thisInclude "bin\user32.bmx" Include "bin\gdi32.bmx" Type lpRECT Field l, t, r, b End Type Global windowt = CreateWindow("window",0,0,200,500,Desktop(),WS_TABSTOP) Global lprc:lpRECT = New lpRECT hWnd = QueryGadget(windowt,1) '0 is the desktop hWnd for drawing purposes hdc = GetDC(0) ' get the windows t,b,l,r coordinates GetWindowRect(hWnd, lprc) repeat drawfocusrect(hdc,lprc) until keyhit(1) end basically this just draws the focusrect over the window at the windows x y location and w and h. but if you mess around witht he rect's coordinates for instance. lprc.t = ## then it will draw the rect in that size. i think this is particularly useful for skinned windows that are very odd shaped or rounded. It just lags the crap out of the computer trying to recaculate the skins regions while the user is resizing. |
| ||
btw i had to add a few of those functions to the user32 file in order to get this to work mainly the drawfocusrect and releaseDC functions |
| ||
How is this accomplished in Blitz3D? Im' needing to create a selection rect. while the mouse buttom is held down.. Then once the mouse button is released the window is drawn... Anybody know if anyone has already done this in Blitz3D?!?? |
| ||
You might do better if you posted in the B3D forums. If you search the forums with Drawfocusrect you get results like these : Full WinBlitz3D FREE [a] http://www.blitzbasic.com/Community/posts.php?topic=27586#289540] Closing the Window [/a]. If they don't do it for you then they, at least, explain how to do it yourself. |