Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Hide a .NET Window Form using Win32 API

Posted on 2009-06-29
2
Medium Priority
?
438 Views
Last Modified: 2013-12-17
Opening a .NET created Window form in VB 6 using late binding. I want to hide that form using some other application throught Win 32 API [using ShowWindow API]. But while HIding form is geeting closed.

To stop the closing event, we called e.cancel=true but it is not able to stop the closing event of the form.
   
To Open a .NET Window Form:
 
Public a  As Object
Private Sub Command1_Click()
    Set a = CreateObject("WindowsFormsApplication1.Form1")
     a.Text = CStr(a.Handle)
    a.ShowDialog
End Sub
 
 
To Hide the form using other VB6 application following API has been used:
 
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Open in new window

0
Comment
Question by:utkarsh_agrawal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
SStory earned 2000 total points
ID: 24765581
Here's some c# code on having the window hide itself:
http://www.codeproject.com/KB/cs/windowhider.aspx?display=PrintAll&fid=3881&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26

Maybe you should expose a method from the DOTNET app called Hide that uses the above code to tell it to hide itself.

Why are you doing ShowDialog?  Try just Show...if that causes problems set the owner of the dotnet Window to the vb6 window handle and see what happens.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question