Re: Scaling a Window

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Wed, 22 Jun 2005 12:14:09 -0400, "Jeff Johnson [MVP: VB]"
<i.get@xxxxxxxxxxx> wrote:

>
>"alpine" <alpine_don'tsendspam@xxxxxxxx> wrote in message
>news:ff1jb19t8vio1l0mn04v7jgqq5phug7vm7@xxxxxxxxxx
>
>> As with just about everything, there is a way. It just depends on how
>> much trouble you are willing to go through to get to where you want to
>> go.
>>
>> I would suspect the way to go with this would be to use Spy++ to get
>> all of the class names and parentage for the controls in the dialog
>> that you wish to resize and then create a FindWindowEx routine that
>> does the desired resizing.
>>
>> There are several ways you could go about getting the top level hWnd
>> target depending on how automatic you want the process to be. The
>> easiest would probably be to provide a button that, when clicked, used
>> the SetCapture API function to get the handle of the window that was
>> clicked using the WindowFromPoint API function. Once you have the
>> hWnd, you could then run your resize code.
>
>Note that even if you do all the things alpine mentions and you do succeed
>in resizing the window, the window won't KNOW that it's been resized. If
>controls are hidden due to this then they'll still function (assuming the
>designer didn't go to lengths to de-keyboard-ize the program) but you won't
>be able to access them with the mouse and you won't be able to see what's
>going on in them.


This was the reason I suggested using FindWindowEx and getting the
class names and parentage of all of the controls. I assume one would
need to resize all of the child controls to fit into their new
"environment".

Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@xxxxxxxx Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
.


Quantcast