Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Set minimum size of a window

Posted on 1998-05-16
9
Medium Priority
?
251 Views
Last Modified: 2013-12-03
How can I use WinAPI to set a minimize size for a window?
also, can I set a maximum size too?
0
Comment
Question by:leeal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 3

Accepted Solution

by:
tma050898 earned 160 total points
ID: 1402277
You need to handle the WM_GETMINMAXINFO message and fill out the passed structure as to the min and max of your window.

0
 
LVL 1

Author Comment

by:leeal
ID: 1402278
Can you give me more details?
0
 
LVL 3

Expert Comment

by:tma050898
ID: 1402279
Actually, I need more details. What language are you using?
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 1

Author Comment

by:leeal
ID: 1402280
I am using VB5.
0
 
LVL 3

Expert Comment

by:tma050898
ID: 1402281
I was afraid you were going to say that ;)

Ok. I haven't touched VB since 3.0, but believe or not, the only time I've ever used the WM_GETMINMAXINFO msg was from a VB app. When I used VB it did not provide programmers the ability to handle Windows messages. IOW, programmers could only select events from a fixed set of events for each object. Therefore, we used a product from Desaware called Spy Works in order to handle Windows messsages. So the questions are...

1. Does VB5 now allow you to directly handle Windows messages (as opposed to picking from a fixed set of events for an object)?
2. If not, do you have a product like SpyWorks or a similar competitor's product (e.g., Sheridan, MicroHelp, etc.)???

0
 
LVL 1

Author Comment

by:leeal
ID: 1402282
1. ummm, I'm not sure. But there's an "addressof" operator that can return the address of a procedure.
2. no, I don't.
0
 

Expert Comment

by:bbarber
ID: 1402283
Can you process the WM_SIZE message which is passed to any window that receives a command to resize. Then if the size requested is not within your boundries, set it to your min or max value.
0
 
LVL 3

Expert Comment

by:tma050898
ID: 1402284
bbarber,
No. The only way to do this is by handling the WM_GETMINMAXINFO msg.  A struct is passed in this msg that has min max tracking members. Setting these will cause windows to not allow the window to be size beyond the ranges specified by the application.

The problem leeal is having is that vb doesn't allow for the handling of msgs that aren't inherently supported and presented in a static list of events. I've done what he wants to do with SpyWorks because they have a vbx and an ocx that allows vb applications to receive and process windows msgs. However, he doesn't have SpyWorks or any other tool.

leeal,
Sorry about not posting in a couple of days. It took me two days to finally found track down free tool that does what you want. It's called MsgHook and can be downloaded for free at www.download.com 

If this is the way you want to go, download it and play with it. From what I've read it will do what you need. I've never used it, but if you have any problems post a new question and I (or another expert) will help in any way we can.

Tom




0
 
LVL 1

Author Comment

by:leeal
ID: 1402285
Thanks, Tom.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question