-
Jan 16th, 2017, 09:43 AM
#1
Thread Starter
Fanatic Member
Hide a form using API ?
hi
Somebody have a example to hide a form using API ?
Tia
-
Jan 16th, 2017, 10:48 AM
#2
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
-
Jan 16th, 2017, 12:26 PM
#3
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.
-
Jan 16th, 2017, 12:39 PM
#4
Thread Starter
Fanatic Member
Re: Hide a form using API ?
Originally Posted by dilettante
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
-
Jan 16th, 2017, 12:47 PM
#5
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?
-
Jan 16th, 2017, 01:20 PM
#6
Thread Starter
Fanatic Member
Re: Hide a form using API ?
Originally Posted by dilettante
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
-
Jan 16th, 2017, 04:42 PM
#7
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?
-
Jan 16th, 2017, 05:00 PM
#8
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.
-
Jan 16th, 2017, 06:43 PM
#9
Hyperactive Member
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.
-
Jan 16th, 2017, 07:44 PM
#10
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.
-
Jan 16th, 2017, 08:39 PM
#11
Hyperactive Member
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.
-
Jan 16th, 2017, 08:46 PM
#12
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)
-
Jan 17th, 2017, 04:30 AM
#13
Thread Starter
Fanatic Member
Re: Hide a form using API ?
Originally Posted by Bobbles
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
-
Jan 17th, 2017, 07:16 AM
#14
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|