windows

Win32: Modal dialog not returning focus

Hi, I'm writing a win32 wrapper classes, mainly to learn more about win32 programming. To get around the problem of c-style callbacks, the following method stores/retrieves the pointer using SetWindowLong/GetWindowLong and passes it to the actual winproc. LRESULT CALLBACK WinClass::WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l...

Why does Microsoft's _wspawnv return EINVAL?

I'm calling Microsoft's _wspawnv function, and it keeps returning -1 with errno set to 22; errno.h defines this as EINVAL. According to Microsoft's documentation for _wspawnv, this code should only be returned if the mode parameter is invalid. I've tried calling it with _P_WAIT and _P_NOWAIT in the first parameter, and both return the ...

How to determine the keyboard layout for another process (Windows)?

I'm working on a program that needs to record and play back keystrokes. The main process runs as a service, so it needs a configuration program to record the keystrokes. The problem comes when the system default keyboard layout is (say) English, and the user's keyboard layout of the moment is (say) German. The user enters a 'ü' characte...

Resolve Windows environment variables in PHP

I want to write to a file in the windows temp directory. I know that in the command line you can use the environment variable %TEMP% to get the right path, however trying to do something like this: file_put_contents("%TEMP%\\myfile.txt"); ...does not work because the environment variable isn't being resolved. Is there a way to do this...

How to read output and give input to a program from c program?

This is with reference to the below question http://stackoverflow.com/questions/70842/execute-program-from-within-a-c-program How do I do the same on windows with Tiny C Compiler? I need to execute a .exe fro c program and give input to it from within the same C program by using a file or string as source and read the output from it into...

Windows Update API c# code can't get update history

I'm writing a code to automatically patch Windows Operation Systems with security hotfixes in a corporate intranet. (I'm using Visual Studio .NET, thus .NET framework 1.1, and developing in c#.) As a first step, I'd like to list the hotfixes already applied to the system using the WUApi. I've added the reference to the "tlbimped" wuapi.d...

How can i fix this debugging error.

hi, I have an executable built in windows(exe).I want to pass that exe to an out file built by Cygwin(DOS version). It is going well upto half the way. After that it is showing the following error,which is related to Cygwin dll files(ACL check) . Program received signal SIGSEGV, Segmentation fault. 0x6108829e in cygwin1!aclcheck () fro...

Overlaying on a 3D fullscreen application

I want to display some custom graphics on top of a 3rd party fullscreen Windows application. Have you played any Steam games? It has an executable, GameOverlayUI.exe that lets you access Steam windows from within a game. (The GUI elements look custom-drawn, I don't know if that is a necessity; but they look exactly the same inside a gam...

Pipe incoming email to a script on Windows IIS SMTP?

I have a web application running on Windows IIS. This app has a database where each item has a unique key (1, 2, 3...), and a list of email addresses (among other things). I would like users to send email to the server, using an email address that identifies the item, then have the server relay the message to the email addresses for tha...

How can I deliberately slow Windows?

How do I reversably slow a PC with XP? I want to achieve this without using visible CPU-cycles, so I'm guessing some hardware settings might do. I don't want my app to run slow, I want the whole OS to be slow. I know some network lookups especially out of a trusted environment (think Active Directory) slow a PC way down. This is the ef...

\Windows\ versus \Windows\System32 - File location conventions

Is there a standard convention for the types of files that go in \Windows\ versus those that go in \Windows\System32 ?? I'm working on an SDK that has a variety of DLLs a helper exe, and a Windows service exe. The previous guy who worked on the code put the two exe files in \Windows\ and the DLLs in \Windows\System32\ But it seems t...

Switching all aspx files from local encoding to utf-8

Hello, how can I save all files in a directory using utf-8? There is a need to change the default file encoding in IIS to display all foreign characters correct. The problem is: all old files are saved in (different/random) encodings. Is there a way to open (in current) and save all those files safely to UTF-8? ...

How can I enumerate objects in the windows system tray in .Net?

I want to monitor the windows system tray for icon text changes. How can I do this in .Net preferably in C#? ...

Where to install SDK DLLs on a system so that they can be found by apps that need them.

I've got an SDK I'm working on and the previous developer just dropped the DLLs in System32 (Apparently a serious offense: see here) So assuming I move them out into \Program Files\\SDK (or whatever), how do I make sure that all the apps that needs those DLLs can access them? And to clarify, all apps that access these are doing early (...

Can IMAPI2 burn files with the size > 4Gb?

IMAPI2 interface IFileSystem uses COM IStream interfaces to represent file data. There is AddTree method that adds specified directory contents to IFileSystem. So AddTree must create IStream's in the process. I wonder what implementation of IStream it uses? If it uses the standard OLE implementation than we have a nasty problem because O...

USB Hierarchy Driver

Is it possible to create a driver (windows/mac) for a custom usb hub such that it appears as one device in My Computer / Finder and the attached usb card readers each show up as a sub-folder within that device? Any pointers to the right direction to look at would be appreciated. ...

Get a Winstation Name from a Process ID

I am trying to get the name of the winstation (for example "winsta0") that a separate process has opened using only its Process ID. I can't find anything that does this on MSDN. They only seem to have GetProcessWindowStation() which only works for your own process. Any ideas? UPDATE: Maybe this is part of the puzzle... BOOL ProcessId...

32 bit application failed to run on x64 Win2003 due to

Here is my problem: I have developed an application which can be run on various platforms, including windows and unix. This app runs well on pure Win32 box (WinXP) or a pure Win64 (Win2K3 x64 edition) and other unix platforms. It only fails when running on a 64 bit Win2K3 in 32 bit mode. This app invokes a third party dll at the runti...

How can I get the users network login name?

I'm building a C# application, and I want to identify users by their username. For example, if I logged onto the domain mydomain as the user myusername I'd want to get the mydomain\myusername so I can identify the user. How can I do this with C#? ...

how to parse windows inf files for python ?

hi please help me. example inf file : ;============================================================================= ; ; Copyright (c) Intel Corporation (2002). ; ; INTEL MAKES NO WARRANTY OF ANY KIND REGARDING THE CODE. THIS CODE IS ; LICENSED ON AN "AS IS" BASIS AND INTEL WILL NOT PROVIDE ANY SUPPORT, ; ASSISTANCE, INSTALLATION, TR...