-
October 17th, 2012, 11:13 AM
#1
[RESOLVED] Strange stretching
Strange behaviour of my application.
In windows 7 - all work
In windows xp after stretching main window - application close.
Code of sizing:
Code:
case WM_SIZE:
SendMessage(hsb, WM_SIZE, 0, 0);
{RECT WindowRect;
GetWindowRect(hwnd, &WindowRect);
int width = WindowRect.right-WindowRect.left;
SetWindowPos(hProgress, HWND_BOTTOM, 20, 150, width-50, 17, 0);
break;}
In what problem?
-
October 17th, 2012, 01:33 PM
#2
Re: Strange stretching
Why do you
Code:
SendMessage(hsb, WM_SIZE, 0, 0);
from the "case WM_SIZE"?
WM_SIZE is sent by the Windows in response to any action causing a window to be resized. You should not send it in your code. Instead you should call some API to resize a window (like MoveWindow or SetWindowPos)
Victor Nijegorodov
-
October 18th, 2012, 09:03 AM
#3
Re: Strange stretching
Originally Posted by VictorN
Why do you
Code:
SendMessage(hsb, WM_SIZE, 0, 0);
from the "case WM_SIZE"?
WM_SIZE is sent by the Windows in response to any action causing a window to be resized. You should not send it in your code. Instead you should call some API to resize a window (like MoveWindow or SetWindowPos)
hsb - handle of status bar.
I tried comment "SendMessage(hsb, WM_SIZE, 0, 0);" - it didn't help me.
Last edited by AKE; October 18th, 2012 at 09:20 AM.
-
October 18th, 2012, 09:26 AM
#4
Re: Strange stretching
Originally Posted by AKE
hsb - handle of status bar.
It doesn't matter whether it is a status bar or any other window.
Originally Posted by AKE
I tried comment "SendMessage(hsb, WM_SIZE, 0, 0);" - it didn't help me.
Well, this line must be removed because it is wrong. Either use MoveWindow or SetWindowPos or send some used defined message to the status bar window and implement its resizing while handling this message.
Now define "application close". How exactly does it happen? Without any error message? without any message in the Windows Event Viewer?
Victor Nijegorodov
-
October 18th, 2012, 09:29 AM
#5
Re: Strange stretching
VictorN,
Without any message. Only disappear
-
October 18th, 2012, 09:29 AM
#6
Re: Strange stretching
What is Windows Event Viewer?
-
October 18th, 2012, 09:31 AM
#7
Re: Strange stretching
Victor Nijegorodov
-
October 18th, 2012, 09:42 AM
#8
Re: Strange stretching
Nothing in Windows Event Viewer
Last edited by AKE; October 18th, 2012 at 09:51 AM.
-
October 19th, 2012, 10:32 AM
#9
Re: Strange stretching
WM_SIZING was without break
-
October 19th, 2012, 10:38 AM
#10
Re: [RESOLVED] Strange stretching
Well, you see now that posting only a small amount of code lines without showing what happened above and below these lines is often not enough. Don't you?
Victor Nijegorodov
-
October 20th, 2012, 01:52 AM
#11
Re: Strange stretching
Originally Posted by AKE
Without any message. Only disappear
In case you run it in VS IDE, and some abnormal termination happens, the Studio shows you some message regarding the immediate problem. In case it does not, your app closes because of natural reasons, which might mean that some of your code closes the main window or posts WM_QUIT message to main thread. You should find that by code review alright.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|