Solved

VB.NET

Posted on 2011-02-24
4
1,355 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
ID: 34974099
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
ID: 34974630
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
ID: 35071783
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
ID: 35089446
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 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