|
Okay, I use this code now:
RECT winRect = {0, 0, nWidth, nHeight};
AdjustWindowRectEx(&winRect, WS_OVERLAPPEDWINDOW, FALSE, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
SetWindowPos(m_data.hWnd, HWND_TOP, 0, 0,
winRect.right-winRect.left,
winRect.bottom-winRect.top,
SWP_NOMOVE|SWP_NOZORDER|SWP_NOCOPYBITS);
I still have a problem: When the window is maximized and I change the dimensions with my code, the maximize button is not changed. Instead Windows thinks my window is still maximized.
Any ideas? Thanks for help again!
|
|
|
|
|
Performing a ShowWindow(m_data.hWnd, SW_RESTORE) before resizing did solve the problem.
|
|
|
|
|
PS: This should be the subject for last post
|
|
|
|
|
Does SetSize method of IStream preserve the information existing in the stream object if the new size is smaller then the previous one?
rechi
|
|
|
|
|
It should truncate it I think. It might depend on the IStream implementation though. Best is to make a test program. Create an IStream working on global memory (use StreamFromHGlobal() or something like that) and write to it, then setsize then read it back.
James
Drinking In The Sun
Forgot Password?
|
|
|
|
|
HI
I am developing a utility like spy++. Here till now I am able to highlight the mose controls & windows .But for the painted controls like static text in visual basic applications the things are not working.I am using
WindowFromPoint() API.
can anybody help me out ?
VIKS
|
|
|
|
|
See the source code section of the following page - there is an implementation there.
http://freespace.virgin.net/james.brown7/
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
|
|
|
|
|
vikrams wrote:
.But for the painted controls like static text in visual basic applications the things are not working.
This is nothing strange nor a bug is your app. Visual Basic uses Windowless Controls so you don't get any window.
|
|
|
|
|
so what I need to do for highlighting the windowless controls?
VIKS
|
|
|
|
|
You can't do anything You can't spy them thru' normal means. If it is possible it will be very difficult
|
|
|
|
|
Thanx for helping Sir .
VIKS
|
|
|
|
|
How do you tell how long a function takes to run? Something like you start a timer, then call the function, then read the timer when you have broken out of the function.
-Raffi
|
|
|
|
|
If you're satisfied with a rough measuring, this will do:
DWORD dw=GetTickCount();
f();
dw=GetTickCount()-dw;
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
what about something like:
int i = GetTickCount();
SomeFunction();
int usedtime = GetTickCount() - i;
Just be aware that when the computer have been running for about 40 days, GetTickCount() starts from zero again...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
sounds good. thx
-Raffi
|
|
|
|
|
You might find the Timing and Profiling with Visual C++ section of this article useful:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvc60/html/optcode.asp
|
|
|
|
|
A high-resolution timer can be found here on CP:
CCPUTicker v1.22
/moliate
Two o'clock and walking through familiar London - Or what was familiar London before the cursor deleted certain certainties -
I watch a suit and tie man giving suck to the Psion Organizer lodged in his breast pocket
its serial interface like a cool mouth hunting his chest for sustenance, familiar feeling, and I'm watching my breath steam in the air.
Neil Gaiman - Cold Colours
|
|
|
|
|
I'm working on a small project which requires 2 controls to fit in a window and be resized with sizes being relative to the size of the window and the other control.
First I'll state that I'm using only Win32 in plain old C and the controls in question are a Dialog Box which contains a tree control and a text control.
I guess I'll split my question into two parts.
1) What is the standard way of dealing with window resizing and contained controls. Dealing with 1 control is easy though any more and you have to deal with some math and possible diagrams just to make sure the resizing operation works as one might expect.
2) I've seen in some applications partitions between controls which let you resize adjacent controls based on left/right or up/down movement (sorry I have no clue what they are called). Does such a thing exist in the Win32 libraries or do I have to come up with it on my own. If I have to come up with it on my own I was thinking of using a plain button as I already know how to work with those. Does anyone have any suggestions or ideas how to solve this rather old yet simple problem?
Sean
|
|
|
|
|
There is a nice implementation using the C in the www.wdj.com magazine. Search the site, if you cannot find it, email me I think I downloaded the sources - I will search my hard disk!
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
|
|
|
|
|
Hi all,
When do we need an empty class like?
class Foo{};
thanks in advance
regards
/rsasalm
|
|
|
|
|
Never, except in examples where we need a dummy class to show it's use, or visibility.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Christian Graus wrote:
Never, except in examples where we need a dummy class to show it's use, or visibility
Sometimes in defining exceptions they are useful.
|
|
|
|
|
They have a role sometimes:
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
How to determine whether the new request header is coming from client in HTTP/1.1 Keep-alive Connections ?
|
|
|
|
|
Looking at the header and check for "Keep-Alive:" ?
|
|
|
|