473,652 Members | 3,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window state before resize

Cc
hi,
is there a way to get form state before resize?
Nov 20 '05 #1
5 5211
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******** *****@TK2MSFTNG P11.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******** ********@TK2MSF TNGP10.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*****@singne t.com.sg> wrote in message
news:O3******** ******@TK2MSFTN GP09.phx.gbl... thks,
"Nak" <a@a.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.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
12786
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 the window or frame). I'm trying to use Javascript to do so. I can sort of get an example working in a Mozilla browser: > <!-- This works on Mozilla only (and maybe netscape) --> > <script language="Javascript"> > document.write( "<applet...
2
1849
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 either a full size image or an image with supporting detail. It's the same idea used on lots of Web sites that show thumbnails where you click on one and the full-size image is displayed in a new window. However, I have different-sized images that will...
10
6735
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 new window with maximized dimensions!) FYI, I uploaded the same code to: http://tosasoft.com/test/open.htm ========================================
4
2642
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???? Thanks David
6
5632
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 window when I open a new window. > > function expand() { > window.moveTo(0,0); > window.resizeTo(screen.availWidth, screen.availHeight); > }
5
2615
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 up as a maximized window. Its FormBorderStyle is FixedSingle. This only happens when there's another child window open that's in its maximized state. If the other window's state is not maximized (it's normal or
3
5610
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 window. I have set all my child windows to be WindowState.Maximized but after showing 2 or 3 windows, the windows all drop back to Normal state. I have tried various things to overcome this inclusing overriding OnResize etc but none seem to give...
4
6394
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 to look a and I am loosing tremendious amounts of time trying to organize it so that I could view it. Regards, Alexandre Brisebois
0
8367
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8589
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4145
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.