|
True - but then you'd hope that they would have updated them to run outside of a user context for later OSs.
|
|
|
|
|
How can I make sure that the AV/Firewall is protecting my PC during the time no one is logged in?
|
|
|
|
|
1. Log Off
2. Run port scan from another machine.
3. log On
4. Check Firewall Logs for activity.
|
|
|
|
|
How to make sure console process being started by Windows->Run doesn't show/have its console window?
I tried in .NET using ::ShowWindow(SW_HIDE) on HWND obtained from GetCurrentProcess()->MainWindowHandle.ToPointer()
But there was a flicker as the window first showsup and then gets hidden.
Pls suggest...
Thank you & Regards, Renuka
|
|
|
|
|
If you dont want a Console, dont create a Console app. A Console app will always show
a Console when it starts up.
Use a Windows app instead; you can prevent the main form from showing by setting
its Visible property to false (in designer or in code inside the constructor).
|
|
|
|
|
Supply a ProcessStartInfo to Process.Start with the CreateNoWindow flag set to true . You'll need to also set UseShellExecute to false .
Sorry, I thought you were asking how to start a console application from a .NET program without showing a console. If running from Start/Run, you do indeed need to create a Windows application rather than a console application.
-- modified at 6:42 Wednesday 25th July, 2007
|
|
|
|
|
You can do this by calling ShowWindow() on the console apps main window, to do this you need to get a handle to the window.
Use this function to get a handle to the window (Use this for Windows 9x only as it does not have a GetConsoleWindow() function), see the second code sample on how to show/hide the console window on all versions of windows.
HWND Console::GetConsoleWindow9X() const
{
HWND hWndConsole = NULL;
TCHAR szTempTitle[_MAX_PATH] = {'\0'};
TCHAR szTempOldTitle[_MAX_PATH] = {'\0'};
if(GetConsoleTitle(szTempOldTitle, _MAX_PATH) > 0)
{
WCHAR szBuff[_MAX_PATH] = {'\0'};
GUID obGuid;
CoCreateGuid(&obGuid);
StringFromGUID2(obGuid, szBuff, _MAX_PATH);
wsprintf(szTempTitle, "%ws", szBuff);
SetConsoleTitle(szTempTitle);
Sleep(50);
if((hWndConsole = FindWindow(_T("tty"), szTempTitle)) == NULL)
if((hWndConsole = FindWindow(_T("ConsoleWindowClass"), szTempTitle)) == NULL)
hWndConsole = FindWindow(NULL, szTempTitle);
SetConsoleTitle(szTempOldTitle);
}
return hWndConsole;
}
This second example can be used to show/hide the console window on all OS's, on Windows 9x it will call the function in the first example to get the handle to hide.
void Console::ShowConsoleWindow(bool bHide )
{
HWND hWndConsole = NULL;
#if(_WIN32_WINNT >= 0x0500) // Windows 2000 and later only
hWndConsole = GetConsoleWindow();
#else
hWndConsole = GetConsoleWindow9X();
#endif
ShowWindow(hWndConsole, (bHide) ? SW_SHOW : SW_HIDE);
}
regards,
|
|
|
|
|
Thank you for the kind responses.I call ShowWindow(SW_HIDE) on the MainWindowHandle obtained from Process instance within the Console Process Entry point function (main). The outcome of this is not that clean. First we see a cmd window being launched to start this process and this window gets hidden upon ShowWindow(SW_HIDE) call. Is there a solution to avoid this flicker?
Even calling FreeConsole() had the same impact in the output.
How does windows service run without any cmd window? Can something similar be done for console process by not converting console process itself into service?
I use Windows XP and .NET Framework 2.0
Thanks again & Regards, Renuka
|
|
|
|
|
The problem is that it takes time to perform the hide window, during which the console application window is visible for a brief time.
This is not easy to get around, but as others have suggested another approach would be to use a Windows application with a hidden main window.
Services do not (typcially) interact with the desktop, so have no user interface and no window.
You could convert your console application to a Service, but I would not recommend that unless it has to be a service, I would convert it to a windows application without a UI window.
regards,
|
|
|
|
|
Helloo i recently came to knw abt da anonymous free proxy servers by which one can access da internet free of cost without able to notice our IP adress and download limit.
so my question was is it true that th ISP vendor wont be able to know my download limit.
|
|
|
|
|
Your ISP will still know your download limit as all the traffic will still go through them.
Please refrain from using txt speak, its very annoying
regards,
|
|
|
|
|
kthxbye
Cheers,
Sebastian
--
"If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton
|
|
|
|
|
yr wlcm!
|
|
|
|
|
Hi,
I have a Windows application which actually carries out a file transfer operation from a SCSI device to the local directory.
However during the file transfer and DB updates, the CPU usage shoots up to 100%.
Can anyone help me in optimizing the CPU usage?
Thanks in Advance,
KKrista
|
|
|
|
|
More info needed:
How are you copying the file?
Cheers,
Sebastian
--
"If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton
|
|
|
|
|
I am using an API call to do the file transfer..
|
|
|
|
|
That sounds like one of the disks is in Programmed I/O (PIO) mode rather than Direct Memory Access (DMA). In DMA mode, the OS sends a command to the disk to start a read operation which contains a physical memory address to copy the data to. The disk accepts this request and the OS blocks the thread, then carries on with something else (or halts the processor if there are no threads to run). The disk then borrows bus cycles to copy the data directly into memory; when done, it interrupts the processor to signal that the transfer is complete. Writes are much the same, in the other direction.
In programmed I/O mode, however, the CPU is much more involved: the driver has to write the data directly to the disk controller, then polls a register on the controller, in a tight loop, to find out when it's done. If this is what's going on, you'll see a lot of CPU usage in the System process in Task Manager.
Your anti-virus package may also be consuming a lot of CPU. See if the CPU usage goes down if you disable the resident part of the antivirus.
Otherwise I can't see why there would be a lot of CPU usage just copying a file.
|
|
|
|
|
Immediate suspect would be an on-access AV scanner - check what happens if you add in an exclusion for that file location in your AV app, if you have one running.
|
|
|
|
|
I've been trying to fix a friend's internet speed for 2 days now. She has cable internet but it's running like a 14.4 modem circa 1995. It's a 2.8 Ghz processor with 500 MB or RAM running WinXP. It should be plenty fast enough.
The network connection reads as 100 mbps, but in the Windows Task Manager the Network utilization is only going up to 0.3% of capacity. That's less than half of 1%!
I've done a virus and adware scan, I've tried disabling the firewall and virus scanner, I've checked all the TSRs in MSCONFIG and they're all legit. I powercycled the modem and restarted the computer. Nothing helps. This is baffling me. I've never seen this before. It literally took five minutes to load the code project page.
Any suggestions of other things to check? Thanks.
"Go to, I’ll no more on’t; it hath made me mad." - Hamlet
|
|
|
|
|
You might want to talk to the ISP why it is so slow.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
The ISP will tell me it's a problem with this computer. As far as they know the connection is coming in a 100 mbps. They're pretty good at shifting the blame onto the user.
"Go to, I’ll no more on’t; it hath made me mad." - Hamlet
|
|
|
|
|
My ISP has always tried to shift the blame on me and it has always, 100% of the time, ended up being on their side Will your friend's ISP help you through the troubleshoot?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
This is the thing. She's actually switching in a few days due to problems in other areas. But if it's a problem with the computer, the new ISP won't be much better.
I guess we'll find out soon enough.
"Go to, I’ll no more on’t; it hath made me mad." - Hamlet
|
|
|
|
|
Kevnar wrote: I guess we'll find out soon enough.
Keep posted...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Kevnar wrote: But if it's a problem with the computer, the new ISP won't be much better.
True. If we drag the ISP too much pointing fingers and then if they diagnose our system at fault, it would be more embarrassing. Let us try to zero in exactly at any fault that might be haunting our system and then expand the circle to the next level.
|
|
|
|