|
Thanks for the speedy reply, but I'm talking about changing the non-client area in relation to the client area, not just the window's size. SetWindowPos() only affects the non-client area of a Window.
Jeremy Falcon
|
|
|
|
|
You know, I tried to find that out myself recently, but with no luck. The AdjustWindowRect function adjusts the window's size to achieve a certain client size, but it maintains the client/outer ratio. So...
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
You may want to try using SetWindowRgn() to force the client/non-client area to appear smaller than it actually it is. This is also a standard way of drawing non-rectangular windows.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Then you couldn't have a user-resizable window, and you would have to adjust for the invisible part when resizing the window.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
You'd change the region in response to a WM_SIZE . You can fake the sizing boundary (the rectangle shown when the user resizes a window) by overriding WM_SIZING .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
And have to deal with LockWindowUpdate and drawing on the screen and erasing when you're done. All in a day's work?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Why would you need to call LockWindowUpdate() ?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Because if another app drew on the screen in an area where you had inverted an area to draw the resize border, and then you re-inverted it, you would invert a part that had just been drawn over, which would leave a strange partial inverted band on the screen until that area was re-painted. So you call LockWindowUpdate(GetDesktopWindow()) to disallow other apps from drawing on the screen. Then you call GetDC(GetDesktopWindow(),NULL,DCX_LockWindowUpdate) to draw on the desktop window yourself. When you've unlocked the window update (by calling LockWindowUpdate(NULL)), the areas which other apps have attempted to draw on will be invalidated.
PS:
It's not that this is impossible or even extremely hard - it's just that there *ought* to be a better way.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
jdunlap wrote:
Because if another app drew on the screen in an area where you had inverted an area to draw the resize border,
I've used regions to do what I've described with no problems. I just create a captionless window, enforce a non-standard drawing region, draw my custom caption, and handle OnHitTest() so that the user can drag the window using my custom caption bar. Windows handles painting on the desktop just fine because I've decreed what part of my window is transparent.
jdunlap wrote:
Then you call GetDC(GetDesktopWindow(),
Huh!? Are you suggesting drawing directly on the desktop and not in your window's DC?
Maybe I'm just dense and am missing your point.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I'm talking about the size border drawn when you resize, but you can do full window resize/dragging (i.e. draw the window contents rather than just the border). Windows, when drawing the size border, draws directly on the desktop.
PS: We're in danger of making this thread 3 pages long, and I don't think the original poster is even paying attention anymore!
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Thanks for the suggestion Ravi. I don't need to worry about resizing anyway because I'm dealing with menus (yeah, I'm doing my own ownerdraw ones - but without MFC). If I can get this to work, I'll give ya the credit for the tip. Either way, I'll let ya know how it pans out.
Jeremy Falcon
|
|
|
|
|
I want to open a pdf file from within a windows application. It doesn't have to open inside my application. I've been looking around for an hour now, and though I better get some help...
Thanks.
|
|
|
|
|
|
Thanks, that did the job!
|
|
|
|
|
Till yet I've never used that but I think you should have a look at the command execlp
Hope this helps
|
|
|
|
|
I'd like for my program to check on the network for the newer version of itself. I'd like to able to just stick new versions in the same directory, and look for them on execution.
can someone point me in the right direction? Thanks!
BW
"The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts."
- Bertrand Russell
|
|
|
|
|
One solution is a mutex with an ID that includes program version.
Kuphryn
|
|
|
|
|
Hello,
I'm new in this website, but is looks great
I know some programming lenguages like c++, VB,
I would like to learn vs c++, and i can't find how, I have VC++ 6, and MSDN 6.
I will be happy to get some help
Thank you guys
|
|
|
|
|
I don't understand; you just said you have VS C++ 6.0; that IS visual C++.
Do you mean VS C++ for .NET?
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
oppsy, you right...
I have vc++ 6, not the .NET one
|
|
|
|
|
Well, for non-.NET programming needs, you can pretty much use VC++ as you would VC++ 6; for .NET stuff, I wouldn't know where to direct you; perhaps you can pick up a book.
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
somthing i didn't tell you...
i have VS .NET
i can't try learn about VC++ .NET but isn't it much harder then vc++ 6?
?
|
|
|
|
|
If you're new to windows programming in general, neither one would be harder than the other. But you might want to get the experience of learning VC++ 6 because it involves you heavily with windows programming.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
i don't know how u consider VB with windows programming...but i made alot of projects there...
and i'm kinda good there ...and i just need some help with the begining of vc++
|
|
|
|
|
It all depends on what you did with VB.
You are lucky to have both VC .NET and VC 6. Happy programming!
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|