Results 1 to 2 of 2

Thread: maximize form using sendmessage api?

  1. #1

    Thread Starter
    Addicted Member FOOBAR's Avatar
    Join Date
    Aug 2000
    Posts
    172

    maximize form using sendmessage api?

    im trying to maximize my form using the sendmessage api, i know i can do it by just chaning the windows state, but im looking for the way to do it using the sendmessage api

    VB Code:
    1. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    2.  
    3. Private Const WM_SIZE = &H5
    4.  
    5. Private Sub Command1_Click()
    6. SendMessage Me.hwnd, WM_SIZE, 2, 0
    7. End Sub
    for some reason this wont work, using the WM_SIZE has the wParam 2 is = to maximizing
    No Comment.

  2. #2
    Matthew Gates
    Guest
    Quick, delete this, you already found out the answer in your other thread .

    2 = Minimized
    3 = Maximized

    VB Code:
    1. Private Declare Function ShowWindow Lib "user32.dll" (ByVal _
    2. hwnd As Long, ByVal nCmdShow As Long) As Long
    3.  
    4. Private Sub Command1_Click()
    5.     ShowWindow Me.hwnd, 3
    6. End Sub

    You could just as easily use the WindowState property without any API at all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width