Results 1 to 12 of 12

Thread: Resize Form via Api calls [never be resolved]

  1. #1

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Resize Form via Api calls [never be resolved]

    How?

    Please help!
    Jim.


    Ps: Here is the reason for why i need api calls..
    Last edited by Jim Davis; Jun 7th, 2002 at 05:41 AM.

  2. #2
    this should do the trick for you.... you need the handle to the window of course -- you can always find that by using the FindWindow API.

    Code:
    Public Declare Function MoveWindow Lib "user32" (ByVal hWnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
    
    MoveWindow wHandle, 100, 100, 800, 600, True

  3. #3

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284
    yes i have the handle, because its My form
    Thanks for the answer, i'll try out!

  4. #4

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284
    BAH!!!@!@?!

    i cant belive it... i cant set the height property less than 405 twips.. so i cant close up the form to show ONLY the titlebar...

    ehh.. looks like i need a HARDER thing.. so.. May i could "HIDE" the form's "CONTROL" area, so to show only the titlebar????




    Please reply!

    Jim

  5. #5
    I think the only way you are going to be able to fake this and make it look somewhat realistic would be to subclass the form and intercept the caption's draw/paint message -- whatever that might be. if you take and make your tool window sizable, you'll see that you can't even size it to make it appear the way you want. since the tool window has a smaller caption than a regular window, i don't think windows is smart enough to compensate for the extra space -- besides, a little grey space isn't going to hurt anything.

  6. #6

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Exclamation

    You're right, but... check out something:
    In design mode, set a toolwindow's height property to 310.. then run the app.. the form looks like what i'm wanted.. then resize the form (with a timer or the same). then you cant set back to 310 twips via CODE...

    W-H-Y?

  7. #7

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284
    here is my problem

    Jim
    Attached Files Attached Files

  8. #8

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284
    and heres an another question, if i have the handle of a checkbox (hwnd) how can i hide it? (so i havent the control, only the hwnd)

    thanks,

    jim

  9. #9

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284
    PPLS! Somebody helps me P-L-E-A-S-E!!!

    <- look, im a poor kid ..

  10. #10
    Addicted Member aldinator's Avatar
    Join Date
    May 2002
    Location
    Canada - better than all the rest!
    Posts
    216

    How do you get the checkbox's handle

    if you can get the handle, then don't u know the name of the checkbox and therefore can just say chkMe.visible = false?

  11. #11

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284
    ive just the handle number of that cbox, not the control itself!

    so theres no "mychkbox.anything = true"

    anyway this box is a runtime generated control via api calls, because this button style checkbox is sits on the forms titlebar

    Jim

  12. #12

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284
    ehhh... i'm _really_ cant figure out my problems, so pls help me, somebody! :/

    Jim.

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