Sizeof in VB 
Author Message
 Sizeof in VB

I need to be able to maximize a VB form from it's handle (don't ask).  I
think I've found the right API but I need some help using it.  It looks like
the function SetWindowPos will do what I want but it takes a WINDOWPLACEMENT
structure as one of it's arguments. I can declare the function and the type
fine in VB but the documentation says that I have to set the LENGTH member
of the WINDOWPLACEMENT structure equal to sizeof(WINDOWPLACEMENT ).  I don't
know how to do this in VB.

I tried to get around it by calling GetWidowPos in the hope that the
returned structure would have this set for me, but no such luck.  I need to
set the same thing in order for GetWindowPos to work.

Any suggestions?

--
Brett Martensen

(309) 661-7851



Fri, 17 May 2002 03:00:00 GMT  
 Sizeof in VB
Hi Brett,
I assume you meant SetWindowPlacement, not SetWindowPos.  :-)  To get the
size of the WINDOWPLACEMENT structure, DIM your variable and use the Len
function:

     Dim X as WINDOWPLACEMENT
     X.Length = Len(X)

Hope this helps...
- Tony


Quote:
> I need to be able to maximize a VB form from it's handle (don't ask).  I
> think I've found the right API but I need some help using it.  It looks
like
> the function SetWindowPos will do what I want but it takes a
WINDOWPLACEMENT
> structure as one of it's arguments. I can declare the function and the
type
> fine in VB but the documentation says that I have to set the LENGTH member
> of the WINDOWPLACEMENT structure equal to sizeof(WINDOWPLACEMENT ).  I
don't
> know how to do this in VB.

> I tried to get around it by calling GetWidowPos in the hope that the
> returned structure would have this set for me, but no such luck.  I need
to
> set the same thing in order for GetWindowPos to work.

> Any suggestions?

> --
> Brett Martensen

> (309) 661-7851



Fri, 17 May 2002 03:00:00 GMT  
 Sizeof in VB
Yes, I did mean SetWindowPlacement. Thank you, your solution helped a lot.

--
Brett Martensen

(309) 661-7851


Quote:
> Hi Brett,
> I assume you meant SetWindowPlacement, not SetWindowPos.  :-)  To get the
> size of the WINDOWPLACEMENT structure, DIM your variable and use the Len
> function:

>      Dim X as WINDOWPLACEMENT
>      X.Length = Len(X)

> Hope this helps...
> - Tony



> > I need to be able to maximize a VB form from it's handle (don't ask).  I
> > think I've found the right API but I need some help using it.  It looks
> like
> > the function SetWindowPos will do what I want but it takes a
> WINDOWPLACEMENT
> > structure as one of it's arguments. I can declare the function and the
> type
> > fine in VB but the documentation says that I have to set the LENGTH
member
> > of the WINDOWPLACEMENT structure equal to sizeof(WINDOWPLACEMENT ).  I
> don't
> > know how to do this in VB.

> > I tried to get around it by calling GetWidowPos in the hope that the
> > returned structure would have this set for me, but no such luck.  I need
> to
> > set the same thing in order for GetWindowPos to work.

> > Any suggestions?

> > --
> > Brett Martensen

> > (309) 661-7851



Sat, 18 May 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Sizeof in vb?

2. sizeof for VB objects?

3. Sizeof in VB

4. Q: "Sizeof" in VB

5. VB and sizeof

6. 'sizeof' in VB

7. C "sizeof" in VB

8. Sizeof objects

9. VB6 SizeOf Method

10. SizeOf as in C

11. SizeOf Directory

12. sizeof

 

 
Powered by phpBB® Forum Software