473,662 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with window size (NCCALCSIZE) when restore

Hi,

I'm building a skin for my form in c# and I have a little problem.
I'm using NCCALCSIZE to resize my client size and give painting space
for my custom borders.

For some reason, the form is getting smaller every time I restoring it
from minimize / maximize states.

This is the code for my NCCALCSIZE:

NativeMethods.N CCALCSIZE_PARAM S ncParams =
(NativeMethods. NCCALCSIZE_PARA MS)m.GetLParam( typeof(NativeMe thods.NCCALCSIZ E_PARAMS));
Rectangle proposed = ncParams.rectPr oposed.Rect;

proposed = Rectangle.FromL TRB(
proposed.Left + BorderLeft.Widt h,
proposed.Top + BorderTop.Heigh t,
proposed.Right - BorderRight.Wid th,
proposed.Bottom - BorderBottom.He ight );

ncParams.rectPr oposed =
NativeMethods.R ECT.FromRectang le(proposed);

Marshal.Structu reToPtr(ncParam s, m.LParam, false);

Should I handle another winproc to save my form size?

Thanks in advance,
Mayan

Apr 18 '06 #1
0 1334

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

Similar topics

5
6469
by: Dave Hammond | last post by:
You'd think this would be a basic part of the window object (and perhaps it is and I'm just being dense), but I can't find any reference in the IE window object documentation to a property which returns the current window height/width. I can't check Mozilla, as the site is currently unresponsive, but i don't recall there being any mention of height/width properties in the Mozilla window object docs either. Seems like if the object can...
9
13987
by: GL | last post by:
I am running DB2 8.1.1 on AIX 5.1 Having a problem with a redirected restore. Once into the restore continue phase, I immediately get the following “SQL2059W A device full warning was encountered on device "TBS_IDX". Do you want to continue(c), terminate this device only(d), abort the utility(t) ? (c/d/t) t
1
9519
by: deko | last post by:
When a user opens my Access database application, I would like the application window to be a certain size (but not maximized). Currently, when my app is first opened, the application window defaults to whatever size the user sized it to last time he used Access. This results in my app's interface not looking right. Of course the user can resize the window, but many users don't know how or don't have the inclination to adjust it. This...
1
2124
by: Bill Borg | last post by:
I have a simple chat application. "Host" program has a timer and listens for new requests for chat. The host user will typically minimize that window when there's nothing happening, but I'd like to provide a visual cue (e.g. explode the window) when a new request shows up. I think I can *maximize* the host window (using resizeTo, etc.), but I really want to *restore* its size to what it was before (i.e. mimic the "restore" button on a...
10
4008
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
11
9857
by: Chippy | last post by:
This is driving me NUTZ. All of my forms are keeping the size of the window I design them in, even when I have the AutoResize option set to Yes. The actual form (grey, gridded area) is the size I want it, but the window it opens in is NOT this size. This applies if I open the form directly, even if I then choose "Window, Size to fit form". I know the form stays the size of the design window when I switch to view
1
1079
by: Bharathi kumar | last post by:
Hi, Iam working on VS.NET 2005. My scenario is as follows: I opened a window by clicking a menu item in the MDI form and then I maximized that child window. I have not yet closed this child window.
4
3244
by: arajunk | last post by:
In Firefox this opens a full size window (maximized) . In IE it opens the partial window requiring user to click restore (upper right) to maximize. What am I missing ? var infoWindow=window.open('usgsMain.html','USGSwindow','status=no,resizable=yes,scrollbars=yes');
2
1741
by: =?Utf-8?B?VGVycnk=?= | last post by:
Hope someone has some ideas - this is driving me nuts, I am using VS2008 and have a tightly layed out form at 8 pts. The form has a font dialog and when the user changes the font size, everything works great. I go through the forms control collection (recurively) and everything resizes as it should. Ok, so the next step is to remember the font size selected by the user and select it when the form is loaded. Woops - does not work! So, I...
0
8435
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
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
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
8547
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,...
1
6186
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
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
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
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.