Solved

VB.NET

Posted on 2011-02-24
4
1,350 Views
Last Modified: 2013-11-26
Hi experts, I've a very hard problem to submit you.
I developed a VB.NET application which starts the AttachMate Extra program and I need to hide any Extra form. I was able to hide the form's session Mainframe but I tried to hide also the Extra splash screen during the program start using process hiding property; I tried to hide the splash form using the minimized property, the on Top my form, but the splash screen always appears. Ther'is a way to hide the any form when a program starts using also API functions?
0
Comment
Question by:riccomondo
4 Comments
 
LVL 16

Expert Comment

by:13598
Comment Utility
You can't hide the Splashscreen if you have it defined as your application's splash screen. You would need to do something like this to make the splash screen 'hideable':
http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_2.0/Q_24499627.htmll
0
 

Author Comment

by:riccomondo
Comment Utility
Attachmate Extra is a COM application; a called Splash screen the screen which appears when the application starts, but is not a Splash screen as used in NET application
0
 
LVL 7

Expert Comment

by:vbigham
Comment Utility
I am not sure but I would also try using the FindWindow, ShowWindow functions in windows.  Here are the definitions in vb.net:
 
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindow( _
     ByVal lpClassName As String, _
     ByVal lpWindowName As String) As IntPtr
End Function

<DllImport("user32.dll", EntryPoint:="FindWindow", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindowByClass( _
     ByVal lpClassName As String, _
     ByVal zero As IntPtr) As IntPtr
End Function

<DllImport("user32.dll", EntryPoint:="FindWindow", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindowByCaption( _
     ByVal zero As IntPtr, _
     ByVal lpWindowName As String) As IntPtr
End Function




<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function ShowWindow(ByVal hwnd As IntPtr, ByVal nCmdShow As ShowWindowCommands) As Boolean
End Function

Open in new window


(NOTE: These definitions assume that you have referenced and imported:  System.Runtime.InteropServices)

Once you find the handle of the window(if that splash screen is a window maybe you can observe it a little using spy++ ?) you would hide it by calling:
ShowWindow(hWnd, ShowWindowCommand.Hide)

where ShowWindowCommand.Hide is really just 0(zero) per the definition at: http://www.pinvoke.net/default.aspx/Enums/ShowWindowCommand.html

I think it might work (and save some code) to instead declare it with an integer parameter like this (but no guarantees):
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function ShowWindow(ByVal hwnd As IntPtr, ByVal nCmdShow As Integer) As Boolean
End Function

Open in new window


Just a suggestion..  If you need more help with windows functions, I usually go to:
http://www.pinvoke.net

Good luck,
Vaughn
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 500 total points
Comment Utility
One thing to add to what vbigham said:
In order to hide that window, you will need to poll for it...  Use whatever command you normally use to start the application, but add to your program a Window Timer and have it repeatedly check for the window.  As soon as it appears, hide it then stop the timer.

That's an imperfect soluton becasue some users may see a momentary flash, but it might work well enough.
==============
What functions do you use to start AttachMate Extra?
For Reflection X, there is a command-line option
   -nm
that casues the program to skip the spalsh screen.  There mioght be a similar option for Extra.
See: http://support.attachmate.com/techdocs/1530.html
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now