windows

Get notifications of new threads / deleted threads under Windows

When you create a DLL you can get notifications about new threads / exiting threads in the DllMain function (DLL_THREAD_ATTACH/DLL_THREAD_DETACH). Is there a way to get these or equivalent notifications from Windows within an (non managed) Executable? ...

Porting a shared memory JNI app from Linux to Windows for use with NTP

I have a small JNI program that uses shared memory to update NTP on a Linux server. The C portion of the code has three functions: attach the shared memory, set the time stored in the shared memory, and detach the shared memory. I would like to be able to run this program in Windows, while keeping the C code at least somewhat portable....

How can I compile C++ code using another C++ program?

I want to create a program that modifies another c++ source,compiles it and runs the exe. I mean with something like gcc may be I can but on a windows os gcc may not be present. Is it possible? ...

List All Open Files

This is an add-on to another question found here. In short: I would like to list all of the open files on a system and retrieve their associated file names. If this is the wrong approach, or if there's another way, please give me a push in the right direction. Or, if I'm missing any details or something's unclear, please yell at me. ...

Dynamically update app.config file using WiX

I have an msi built using WiX. Part of the installer collects some settings that will be entered into the app.config file of the installed app. Now it works fine if I define Now my question is this: is there a way I can dynamically create this util:XmlFile tag (e.g. from a custom action) so that I don't have to hard code it in to the ...

How do I disable werfault.exe for my app?

I have to run this program millions of times. It's not the most stable beast, and it crashes around 5% of the time. When this happens, I don't want a popup, or WerFault to take 30 sec to take a dump, or anything - I just want it to silently and immediately disappear, and I'll figure out it crashed from the process exit code. I alrea...

Copy a file to all folders batch file?

I need copy credits.jpg from C:\Users\meotimdihia\Desktop\credits.jpg to D:\Software\destinationfolder and all subfolders I read many and i write /R "D:\Software\destinationfolder" %%I IN (.) DO COPY "C:\Users\meotimdihia\Desktop\credits.jpg" "%%I\credits.jpg" then i save file saveall.bat but i run it , it dont work at all. help me ...

How do I get color coded console output from SBT on Windows?

I'm using SBT (Simple Build Tool) to build my Scala projects on Windows. I've seen that one of my friends, that runs OSX, gets color coded output in his terminal windows when running SBT, but mine is just the same color everywhere. Is there any way to enable this for Windows? ...

Is it possible to capture a Windows pop-up message box from inside a Java program?

I have a Java process that runs on a Windows server where I have to kick off a command line exe. I am using Process p = Runtime.getRuntime().exec(command); OutputStream stdin = p.getOutputStream(); InputStreamstderr = p.getErrorStream(); InputStream stdout = p.getInputStream(); to run the process and capture standard in/out streams....

Only allow access to my REST APIs from my own application?

We have a Windows app hosting a WebBrowser control that hits our REST APIs. We like to restrict access to the APIs to be only coming from withing the Windows app itself (for example, the APIs cannot be accessed in a browser, etc). How can we accomplish that? what is the most secure way without having to expose any kind of credential (f...

PrincipalContext.ValidateCredentials Always Returns False With Machine ContextType on XP

I'm using PrinciaplContext.ValidateCredentials to validate a set of credentials against the local machine: string account = Context.ReadLine(); string pass = Context.ReadLine(); using (var context = new PrincipalContext(ContextType.Machine)) { bool valid = context.ValidateCredentials(account, pass); Console.WriteLine("valid: "...

Using WM_SHOWWINDOW to Show a Window instead of ShowWindow()

Hi, I’m trying to use the SendMessage function of a hotkey utility (or NirCMD, etc.) to get a hidden window to pop up. I can for example get windows to close by sending 0x0010 (WM_CLOSE), but when I try sending 0x0018 (WM_SHOWWINDOW) with a wParam of 1 and an lParam of 0, nothing happens. I’ve looked around, and the few places where so...

MS DOS 'for' command to access file contents -- spaces

If a.txt contains a b c abc The command for /f %x in (a.txt) do echo %x is printing a abc What am I doing wrong? ...

dynamically running a DLL at a remote Windows box?

Hello All, Is there a way of dynamically running a DLL at a remote Windows box? Say a user wants to send a his own DLL file to a remote server and run a function in that DLL at the remote site. The user may be able to provide function entry points as well as required parameters, but no more. (e.g. no header file) I am thinking of se...

Save a portion of my program’s own window to a bitmap file using mfc/win32.

Within my mfc program, I need to programmatically capture a portion of that program’s own window, then save it out as a file (bmp or jpg etc). How to do this without using 3rd party library? ...

How to disable windows application crash reporting?

I am trying to invoke external program (in my case IECapt.exe) in php function exec() on windows. It works well most of the time, but when IECapt.exe crash, windows pop-up a crash prompt window, and php script hangs there wait this prompt window closed, so how to disable such pop-up crash window? because my php script need run as a da...

loading binary data for an encryption program

how do i load a file into my program so it's just binary. i want to read the binary from a file then save it to another one so the file will be a clone of the first file (if it's a exe it will run, etc). i would like to store the data in a array or string so i can edit it before i save it. im using windows 7 , microsoft c++ 2008. ...

Is there a replacement for "CLR SPY" Com-Interop "spy" program

This utility used to be on gotdotnet. http://www.ssw.com.au/ssw/Standards/DeveloperGeneral/netTools.aspx#CLRSpy But now it's gone. Is there a replacement for "spying" on com-interop between running programs? ...

getting started with http tunneling

I will soon start work on software which runs on different machines and communicates over the network. I'd like the communication to happen using HTTP tunneling, so no firewall ports need to be opened by the user. This software will be written in C++. My problem is I don't really know where to start looking for resources regarding imp...

How Can I access Windows Service Object by Another Programme

I have a windows service which is creating a Named Pipe in it's service main Function. The code snippet is below: void WINAPI ServiceMain(DWORD argc, LPTSTR *argv) { DWORD status; DWORD specificError; m_ServiceStatus.dwServiceType = SERVICE_WIN32; m_ServiceStatus.dwCurrentState = SERVICE_START_PENDING; m_ServiceStatus.dwContro...