Solved

VB.NET

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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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:…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

762 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