windows

Make screensaver fire whenever computer locks?

Is it possible to force the screensaver to appear whenever a computer becomes locked? Specifically on XP, 7 if possible. ...

Measure ContextSwitch Time C (Windows)

Hello, I need to implement a method that can measure Time and CPU cycles of context switch between threads in Windows. Here is my code #include <stdio.h> #include <windows.h> #include <time.h> LARGE_INTEGER initialTimeStamp, finalTimeStamp, freq; DWORD ThreadProc(LPVOID lpdwThreadParam) { SwitchToThread(); return 0; } int main() ...

Need batch file that will call the server name from text file

Hello Expert, I need batch file that will call the server name in the listed text file and run he command on the same. eg. Script.bat xcopy c:\Tool\DiskCleanp.bat \\%ServerName%\C$\Tool\ /Z /Y >> C:\result.txt Psexce \\%ServerName% c:\tool\DiskCleanp.bat C:\result.txt Server.txt Server01 Server02 Server03 Server04 Or Is ther...

Read ONLY x lines from a txt file with a windows batch file

How can I read only X lines from a a.txt file? The file contains all the names of a directory, I would like to read only x lines. X can be a number that can varies from 1 to 99 ...

Get the callstack(s) when a kernel32.dll function is called

I have a process that changes its current directory, and I would to know when and where it happens. How could I do that? I tried setting a breakpoint in SetCurrentDirectoryA/SetCurrentDirectoryW with Visual Studio, but it does not work. ...

Windows Form form size truncated on Japanese OS

We have a Japanese user reporting that a form size is truncated (smaller size, not all controls are shown) on his Japanese machine. In the windows form .designer.cs file, we have these settings: this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; Moreove...

implement bonjour sdk in visual c++ windows forms application

Hello I have succesfully implemented the bonjour sdk in a visual c++ console app. but when I am trying to implement the same code in a windows forms app (visual c++) I am receiving weird errors probably related to some local heap problem with the bonjour dll. The following assertion in the file dbgheap.c fails: /* * If this ASSERT f...

Unable to run .exe installer from ASP.NET page

I'm attempting to create an ASP.NET/C# page that runs a PowerShell script that will run an .exe installer. The ASP.NET page is currently running in IIS 6.0 on Windows Server 2003. The PowerShell script works correctly from the PS command line but when invoked from the ASP.NET page the page just hangs. No processes are created and it ap...

horizontally center vertically maximized WPF window

I have a WPF window that has a MaxWidth set, so when I hit the Maximize button, it maximizes vertically but not horizontally. This is expected behavior. However, the window always docks to the left side of the screen (Windows 7, if that matters) and I want it to be centered horizontally when Maximized. I tried adding the following Sta...

Rails + SQL Server: what to put in database.yml?

I'm trying to connect Rails to SQL Server. I installed the activerecord-sqlserver-adapter and ruby-odbc gems, but I'm not sure what to put in my database.yml file. What exactly is a DSN, and why do I need it? (Is this some windows-specific thing?) What do I do if I want to use Windows Authentication, instead of specifying a username an...

Limiting Starts or Run Time for Evaluation Software in C# and Windows

Are there any good ways to limit the number of times an application can start or limit how long it can be used for under Windows 7 and using C#? As far as I can see the registry can be easily edited, there are programs to report any kind of file access, virtual machines can be used to change the system time back to when the application ...

access/view linux ide notebook drive from windows box

hey. trying to figure out if/how i can view the contents of a notebook linux ide from the usb port of a windows box... should be straightforward.. don't want to write to the disk, just read.. also.. if i have a linux box, and i assume that the drive was formatted, using the default processes (using fedora/centos), what's the basic cmd...

How do I create batch file to rename large number of files in a folder?

I'd like to rename a large number of files within a folder on a WinXP system, preferably using a batch file. The files are currently named like this: Vacation2010 001.jpg Vacation2010 002.jpg Vacation2010 003.jpg And I'd like to change them to: December 001.jpg December 002.jpg December 003.jpg How can I perform this...

boost library..........pre-built variants??

Hi, im just installing the boost library using an installer. Its asking me which variants (about 8 options, 6 multithreaded and 2 single threaded) do i want to install. Im only installing this to get to grips and have a practice with boost, so im unsure? Also, how do i use the libraries from VS02010 once ive 'installed' them using the ...

How to install both Python 2.x and Python 3.x in Windows 7

I do most of my programming in Python 3.x on Windows 7, but now I need to use the Python Imaging Library (PIL), ImageMagick, and wxPython, all of which require Python 2.x. Can I have both Python 2.x and Python 3.x installed in Windows 7? When I run a script, how would I "choose" which version of Python should run it? Will the aforementi...

Win32 Low Level Assembly

Hi guys, do you know where I can find Windows Low Level Assembly examples programs? I have some exemples using macros (NASM, MASM) but I want pure assembly, in order I can build a shellcode later. Thanks a lot guys! ...

LoadLibrary Reference Counting

From MSDN: The system maintains a per-process reference count on all loaded modules. Calling LoadLibrary increments the reference count. Where is that reference count stored? ...

How to start stop Windows Services using Scripting Language like Vb Script or something?

I Just want to manage Windows Services through Scripting languages( VB Script or Something ). Like Starting, stopping, Getting the status, Checking the dependencies etc. Please help with Code snippets or URL referances. ...

Proper Queue threading technique in c#?

I wanted to implement a windows service that captures dropped flat delimited files to a folder for import to the database. What I originally envision is to have a FileSystemWatcher looking over new files imported and creating a new thread for importing. I wanted to know how I should properly implement an algorithm for this and what tec...

convert BSTR to wstring

How to convert a char[256] to wstring? update. here is my current code: char testDest[256]; char *p= _com_util::ConvertBSTRToString(url->bstrVal); for (int i = 0; i <= strlen(p); i++) { testDest[i] = p[i]; } // need to convert testDest to wstring to I can pass it to this below function... writeToFile(testDestwstring); ...