473,395 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

window state before resize

Cc
hi,
is there a way to get form state before resize?
Nov 20 '05 #1
5 5199
Nak
> is there a way to get form state before resize?

What do you mean exactly? You could trap the windows and intercept the
resizing message to actually find out what "state" the window is in before
it actually get resized.

Const WM_SIZE = &H5

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Call MyBase.WndProc(m)
Select Case m.Msg
Case WM_SIZE
Me.Text = Me.WindowState.ToString
End Select
End Sub

Is this what you wanted?

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #2
Cc
yes , I would like to get window state befor it either minimize or maximize.
I try your code but not working, it always show state after window
resize(even I change by call mybase.winproc at bottom).

I writting a program that when window minimize it will minimize to tray by
using notify icon , when user left click on the notify Icon I suppose to
restore the window state. I had try by using
Me.WindowState = FormWindowState.Normal

this work fine until I found there a bug on it. if window state before
minimize is Normal this code work fine, but if window state maximize it
still work find until after that you click the window to normal. the window
isn't going to normal state but showing window bar only(like those in
linux).

"Nak" <a@a.com> wrote in message
news:en*************@TK2MSFTNGP11.phx.gbl...
is there a way to get form state before resize?
What do you mean exactly? You could trap the windows and intercept the
resizing message to actually find out what "state" the window is in before
it actually get resized.

Const WM_SIZE = &H5

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Call MyBase.WndProc(m)
Select Case m.Msg
Case WM_SIZE
Me.Text = Me.WindowState.ToString
End Select
End Sub

Is this what you wanted?

Nick.

--

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ "No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

Nov 20 '05 #3
Nak
Hi,

You have the wrong idea, what you are supposed to do is only process
the messages that you actually want. i.e.

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_SIZE
if (windowstate = whatever) then Call MyBase.WndProc(m)
case Else
Call MyBase.WndProc(m)
End Select
End Sub

This will cause the form ONLY to be resized when the form is in
"whatever" state :-) But it will also cause ALL other messages to be
processed normally.

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #4
Cc
thks,
I use msg = 160 due to this is the number that been throw when mouse move
near to minmize or maximize button , tell me if Iam wrong.

"Nak" <a@a.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

You have the wrong idea, what you are supposed to do is only process
the messages that you actually want. i.e.

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_SIZE
if (windowstate = whatever) then Call MyBase.WndProc(m)
case Else
Call MyBase.WndProc(m)
End Select
End Sub

This will cause the form ONLY to be resized when the form is in
"whatever" state :-) But it will also cause ALL other messages to be
processed normally.

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ "No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

Nov 20 '05 #5
Nak
Hi there,
I use msg = 160 due to this is the number that been throw when mouse move
near to minmize or maximize button , tell me if Iam wrong.
160 appears to be the following....

http://msdn.microsoft.com/library/de...CMOUSEMOVE.asp

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"Cc" <ko*****@singnet.com.sg> wrote in message
news:O3**************@TK2MSFTNGP09.phx.gbl... thks,
"Nak" <a@a.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

You have the wrong idea, what you are supposed to do is only process the messages that you actually want. i.e.

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_SIZE
if (windowstate = whatever) then Call MyBase.WndProc(m)
case Else
Call MyBase.WndProc(m)
End Select
End Sub

This will cause the form ONLY to be resized when the form is in
"whatever" state :-) But it will also cause ALL other messages to be
processed normally.

Nick.

--

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\


Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Put 030516 in email subj to get thru | last post by:
I've always been bothered about having to statically declare the size of a Java applet window (container?) in the calling HTML. I've always wanted the moral equivalent of width=50% statement (of...
2
by: Charles Packer | last post by:
From one of the online Javascript tutorials, I learned how to open a new window and set its size. I'm building a page that has several small photographs, and I want to let the viewer examine...
10
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a...
4
by: David Logan | last post by:
Hello, I am trying to open a window with a graphic in it and have the window be exactly the correct size of the image. Is there anyway to do this that will work on any browser on any OS???? ...
6
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser...
5
by: VM | last post by:
When I try to open a window (this small window is 198x190 in size) through the MDI menu with: frm_export frmExport = new frm_export(); frmExport.MdiParent = this; frmExport.Show(); it opens...
3
by: James Spibey | last post by:
Hi, I have an MDI application which has aboout 10 child windows. The way the app needs to work is that only one window should be visible at a time and it should be maximized within the parent...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.