Click here to Skip to main content
15,914,419 members
Home / Discussions / C#
   

C#

 
AnswerRe: listen to a network printer? Pin
Dave Kreskowiak8-May-09 0:49
mveDave Kreskowiak8-May-09 0:49 
QuestionDirectoryInfo.GetDirectories() search patterns Pin
dybs7-May-09 18:22
dybs7-May-09 18:22 
AnswerRe: DirectoryInfo.GetDirectories() search patterns Pin
Dave Kreskowiak8-May-09 0:48
mveDave Kreskowiak8-May-09 0:48 
GeneralRe: DirectoryInfo.GetDirectories() search patterns Pin
dybs8-May-09 3:00
dybs8-May-09 3:00 
AnswerRe: DirectoryInfo.GetDirectories() search patterns Pin
cascadtx25-Mar-11 17:20
cascadtx25-Mar-11 17:20 
QuestionHow to packege c# program including SQL2000 database ? Pin
lockepeak7-May-09 16:13
lockepeak7-May-09 16:13 
QuestionInvisible Winform Pin
jspoonermso7-May-09 9:53
jspoonermso7-May-09 9:53 
AnswerRe: Invisible Winform Pin
Dave Kreskowiak7-May-09 10:06
mveDave Kreskowiak7-May-09 10:06 
AnswerRe: Invisible Winform Pin
EliottA7-May-09 10:18
EliottA7-May-09 10:18 
GeneralRe: Invisible Winform Pin
Dave Kreskowiak7-May-09 10:39
mveDave Kreskowiak7-May-09 10:39 
GeneralRe: Invisible Winform Pin
Big Daddy Farang7-May-09 10:49
Big Daddy Farang7-May-09 10:49 
GeneralRe: Invisible Winform Pin
jspoonermso7-May-09 11:55
jspoonermso7-May-09 11:55 
GeneralRe: Invisible Winform Pin
Dave Kreskowiak7-May-09 14:22
mveDave Kreskowiak7-May-09 14:22 
GeneralRe: Invisible Winform Pin
jspoonermso7-May-09 14:57
jspoonermso7-May-09 14:57 
GeneralRe: Invisible Winform Pin
EliottA7-May-09 10:51
EliottA7-May-09 10:51 
GeneralRe: Invisible Winform Pin
jspoonermso7-May-09 11:45
jspoonermso7-May-09 11:45 
GeneralRe: Invisible Winform Pin
Big Daddy Farang7-May-09 12:00
Big Daddy Farang7-May-09 12:00 
AnswerRe: Invisible Winform Pin
jspoonermso7-May-09 12:31
jspoonermso7-May-09 12:31 
I found a means to do it on the web. The 'Visible' property stubbornly did not work for me. But I was able to use the win32 ShowWindow Function. Code below.

And yes, you guys are correct its better to have a windows service, and it would be better if my third party dll would work without a message pump but its a legacy application. My guess is it uses netdde which is windows message based.





So the fix was to :
using System.Diagnostics;
using System.Runtime.InteropServices;

Then get access to the Win32 ShowWindow API call:

private const int SW_HIDE = 0;
[DllImport("User32")]
private static extern int ShowWindow(int hwnd, int nCmdShow);




Then when the form loads call a function that goes out, finds the app and hides it.
foreach (Process pr in processRunning)
{
try
{
if ((pr.MainWindowTitle == "mywindowname")||pr.ProcessName.Contains("mywindow.exe"))
{
hWnd = pr.MainWindowHandle.ToInt32();
ShowWindow(hWnd, SW_HIDE);
}
}
catch (Exception)
{
}
}
GeneralRe: Invisible Winform Pin
SimpleData10-May-09 6:11
SimpleData10-May-09 6:11 
QuestionAutorun checker and exception handling Pin
Rajdeep.NET is BACK7-May-09 9:49
Rajdeep.NET is BACK7-May-09 9:49 
AnswerRe: Autorun checker and exception handling Pin
OriginalGriff7-May-09 10:11
mveOriginalGriff7-May-09 10:11 
GeneralRe: Autorun checker and exception handling Pin
Rajdeep.NET is BACK7-May-09 20:23
Rajdeep.NET is BACK7-May-09 20:23 
AnswerRe: Autorun checker and exception handling Pin
fly9047-May-09 10:19
fly9047-May-09 10:19 
AnswerRe: Autorun checker and exception handling Pin
Henry Minute7-May-09 10:27
Henry Minute7-May-09 10:27 
GeneralProbably in vain Pin
Luc Pattyn7-May-09 10:32
sitebuilderLuc Pattyn7-May-09 10:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.