Solved

VB.NET

Posted on 2011-02-24
4
1,356 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

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.
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…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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