windows

Running windows service to watch service running grow memory (leak)

I have checked all posts here, but can't find a solution for me so far. I did setup a small service that should only watch if my other services I want to monitor runs, and if not, start it again and place a message in the application eventlog. The service itself works great, well nothing special :), but when I start the service it use a...

Silverlight in Safari and Firefox by default?

I'm curious, how does Microsoft plan to embed Silverlight into Safari and Firefox. Because if it doesn't come shipped with Safari and Firefox by default, why should anyone use it? They are counting on that the average user is installing it when he/she sees: "Silverlight need to be installed"? Maybe they won't install and just leave th...

Visual C++ won't create the dll file and stops at the *.lib

I inherited a dll project (Visual C++ 2002) and I'm having a lot of trouble to compile it. Even though the *.def file is in the current dir, VC will only create a lib file, instead of the dll. Anybody knows what might be going on? ...

How can I get the description of a file extension in .NET

HI, Windows provides descriptions for file extension such as "Control Panel Item" for .cpl files and "PowerISO File" for .daa files. Is there any way I can obtain this data in .NET ? Im using C# but can read all the other .NET languages. Also is there a way to obtain the default icon of the extensions as well ? Any help would be appreci...

How to display japanese Kanji inside a cmd window under windows?

I have an english Windows 2003 server with asiatic language support activated. The two only fonts available for the command window (cmd settings) are raster and lucida console. Neither the one nor the other display the Kanji correctly (displayed as question mark). Is there a solution to get them displayed? Is there some transformation ...

Understanding the behavior of IDirect3DDevice9::Present when it blocks for vsync

I'm developing a scientific application that has to estimate (as best as possible) the time difference between an object getting drawn in the video back buffer and the point at which that object actually becomes visible on the screen. In other words, how DirectX on Windows XP+ deals with monitor's vertical refresh cycle. I'll start by s...

Same C++ code results in infinite loop on Windows and expected behavior on OSX

This is one of the weirder things I've seen. I'm teaching an intro C++ course at a university, and one of my students contacted me saying that his code was running forever without stopping. I briefly glanced over his code during class, and didn't see anything immediately obvious, so I had him email me his code. Without making any chang...

Scripting for safe file backup under windows

Hi, I need to back up some large files that are being written to disk by a process. The process is perpetually running, and occasionally dumps large files that need to be moved over the network. Having the process do this itself is not an option, as the process locks out users whilst it is doing file dumps. So, this runs under a window...

Sql Windows Authentication Popup

Hi All, First of all i should say when i used IIS 6.0 and i escaped windows authentication popup, i gave 401 error and i redirected weblogin page. Now i use IIS 7 with similar system but i can't get windows authentication popup, so directly go weblogin page. What is the difference between IIS 6 and IIS 7, why cant i get windows authent...

Determining the size of the next UDP datagram in system's queue

I want to know the size of the next UDP datagram in the system's queue. I found this question with a similar doubt, but using boost. The last answer (as of 2010/09/23) say something about using getsockopt with the SO_NREAD option in OS X, but I can't find anything about this with Windows (using Winsock). Here I found that I can use ioc...

Get Owners Name on Windows Phone 7

I'm porting an iPhone game to Windows Phone 7, and I'm wondering how I would go about getting the phone's name? Like, on the iPhone it would be the name you had set it to in iTunes, and that's also readable in the API with (obj-c..) [[UIDevice currentDevice] name].. Anyone know the equivalent WP7 .NET methods/properties? I can't find ...

How do I import a public key for encryption in C on Windows

I have a public key and I want to use it to encrypt a piece of data. I'm trying to import the public key in order to use it, but CryptImportKey gives me an 'invalic parameter' error. What's the problem? Here's my code: if( !CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT) ) { /* * Print error and re...

.NET WinForms Custom Control: how to get a reference to the containing form

Is there a way, when creating a WinForms Custom Control/User Control, to get a reference at runtime to the form the control is placed on, so as to access various properties of that form? I would rather not pass a reference to the form into the constructor of the control, as, for various reasons, I need to keep a default constructor with ...

How to list VSS snapshots through the API?

I am looking for a way to replicate what "vssadmin list shadows" does using a published API. There appears to be no relevant methods in IVssBackupComponents, and I am not sure where more to look. If anyone has any pointers or insights, I'd appreciate the help. ...

How to intercept Windows' "open URL insystem default browser" functionality

Hello, I need to know where/how Windows stores the command that passes the URL clicked in a non-browser program (i.e. Thunderbird) and launches it in the systems default browser. I need that information to write a script that allows me to have a browser running in a secure sand boxed virtual machine, but still retain the functionality o...

Accessing audio out in Windows

I am looking to write an Arduino script that uses whatever audio signal is going to the speakers to create a physical visualization. The Arduino is connected to the windows machine only through USB, so I need to use USB to find out what is being sent to the speakers. How would I access this information? ...

How do I read Registry Key Value

I am Creating the Registry Key using following code: LPCTSTR lpNDS= TEXT("SOFTWARE\\myKEY"); if(OK==ERROR_SUCCESS) { MessageBox ( NULL, "Success", _T("SimpleShlExt"), MB_ICONINFORMATION ); } else { MessageBox ( NULL, "Failed" , ...

Keeping memory usage within available amount

I'm writing a program (a theorem prover as it happens) whose memory requirement is "as much as possible, please"; that is, it can always do better by using more memory, for practical purposes without upper bound, so what it actually needs to do is use just as much memory as is available, no more and no less. I can figure out how to prior...

Output domain COMPUTERNAME and logged in USERNAME spreadsheet

So the boss asked for a spreadsheet that would show him all the computers in our enterprise and the users that are currently logged in. I stopped asking "why?" and started with NBTSTAT. The <03> results were inconsistent. Then I tried NET CONFIG WORKSTATION, and finally PSLOGGEDON.EXE (SYSINTERNALS). These were good, but I'd have to fin...

How do I close a file created from command line?

I'm writing command line output to a file and then want to open this file in notepad. So I wrote something like the following (simplified example): set logPath=log.txt echo %date% %time% > %logPath% notepad %logPath% But the problem is that when the last command is run (notepad %logPath%), the file is not yet created (or the contents ...