Results 1 to 14 of 14

Thread: Hide a form using API ?

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Hide a form using API ?

    hi

    Somebody have a example to hide a form using API ?


    Tia

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: Hide a form using API ?

    Thread moved from the 'CodeBank VB6' forum (which is for you to post working code examples, not questions) to the 'VB6 and earlier' forum

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Hide a form using API ?

    If this is another question about hijacking another application via window messages we shouldn't even answer it.

    And if it is within your own VB application then it isn't necessary.

    These malware authoring questions get very tiresome.

  4. #4

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Re: Hide a form using API ?

    Quote Originally Posted by dilettante View Post
    If this is another question about hijacking another application via window messages we shouldn't even answer it.

    And if it is within your own VB application then it isn't necessary.

    These malware authoring questions get very tiresome.
    Sorry, Is in my application, but when I tried me.hide show me error :'error 5 invalid procedure call or argument

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Hide a form using API ?

    Without knowing more details it is hard to say. Does assigning FormX.Visible = False throw the same exception?

    They should either both work or both fail. If they fail it suggests the Form can't be hidden at that time. Why I couldn't say, perhaps you have some flow of control problem mixing modal and modeless Forms?

  6. #6

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Re: Hide a form using API ?

    Quote Originally Posted by dilettante View Post
    Without knowing more details it is hard to say. Does assigning FormX.Visible = False throw the same exception?

    They should either both work or both fail. If they fail it suggests the Form can't be hidden at that time. Why I couldn't say, perhaps you have some flow of control problem mixing modal and modeless Forms?
    Thank you

    I did a test

    I have 3 levels (layer) forms

    form1 call form2.show vbmodal
    and form2 call form3. vbmodal
    My control is in form3 and when I Call other form4. vbmodal when I hide form4 return me error
    , but when put the control in form2 It work fine

  7. #7
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Hide a form using API ?

    In the other thread you only showed a little code. The code you showed was fine but if you are getting an error then there is other code that is executing that is causing your error.

    Have you at least tried setting a break point on the me.hide line and stepping through the code from there?

  8. #8
    gibra
    Guest

    Re: Hide a form using API ?

    I agree.
    You need to debug your code. Not use API.
    If you get a
    error 5 invalid procedure call or argument
    then your code is wrong.

    Show complete code, or zip a sample project to reproduce error.

  9. #9
    Hyperactive Member
    Join Date
    Oct 2016
    Posts
    369

    Re: Hide a form using API ?

    My control is in form3

    What control?

    I cannot duplicate your problem. When I do Form4.Show vbModal and then while I am in Form4 I click button to hide form4. It does not throw error, it just hides the Form; you can't hide it from Form3 or below because control is blocked until you close or hide Form4. If you try to hide Form4 in the Load event you will get error but not what your getting.

    So, how are you trying to hide Form4
    Last edited by I Love VB6; Jan 16th, 2017 at 08:25 PM.

  10. #10
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Hide a form using API ?

    My guess is that there is code elsewhere on the form or in the calling form that is throwing the error, perhaps an attempt to set focus to something after it is hidden or something to that effect.

  11. #11
    Hyperactive Member
    Join Date
    Oct 2016
    Posts
    369

    Re: Hide a form using API ?

    It is either code executing in Form4 before it executes Me.Hide or it is code in any Form after Me.Hide that attempts to set focus or something else to a control in Form4 then, yes, DM, you are correct, you will get his error.

  12. #12
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: Hide a form using API ?

    Would you like this resolved quickly (also avoiding a messy thread as we attempt to guess your problem)
    Make a clone of your program.
    Trim it as much as possible, leaving enough to demonstrate your problem
    And attach the file
    (with instructions how we can trigger your problem)

  13. #13

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Re: Hide a form using API ?

    Quote Originally Posted by Bobbles View Post
    Would you like this resolved quickly (also avoiding a messy thread as we attempt to guess your problem)
    Make a clone of your program.
    Trim it as much as possible, leaving enough to demonstrate your problem
    And attach the file
    (with instructions how we can trigger your problem)
    Thank you
    I will to try to explain in the other thread
    http://www.vbforums.com/showthread.p...93#post5129293

  14. #14
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,143

    Re: Hide a form using API ?

    Don't try to EXPLAIN it....do what Bobbles suggests....bet it will be solved almost immediately! Wasting time here....

Tags for this Thread

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