windows

GetIfTable and loopback on Windows Vista

I am using the GetIfTable windows call in C++ with Visual Studio 2005 SP1 on Windows Vista SP2 x86. For a unit test, I am trying to track the bytes sent and bytes received (dwOctets*) on the loopback adapter (loopback software interface 1 or something or other), but those values are always 0. Has anyone successfully used the loopback a...

Does 64-bit Windows use KERNEL64?

I was looking at some libraries with dumpbin and I noticed that all the 64-bit versions were linked to KERNEL32. Is there no KERNEL64 on 64-bit Windows? If not, why? All my operating systems are 32-bit so I can't just look. A google search brings up nothing worthwhile so I suspect that there is no KERNEL64 but I'm still curious as to...

Calculate CPU usage for a process

Given a process ID, how can i get the cpu load from this process with C#? I have tried using PerformanceCounter as described in http://stackoverflow.com/questions/1277556/c-calculate-cpu-usage-for-a-specific-application I have also tried to manually take two values of the total cpu time for the process within a timeframe and divide the...

Instance of WMEncode causes crash (vb .net)

I'm trying to use the windows media encoder sdk to make a function to video capture my screen. I use the WMEncoderlib in VB .Net. When I do dim encoder as wmencode followed by encoder = new wmencode the program crashes immediately, no line numbers, nothing, vshost.exe even crashes when debugging. If I just say dim encoder as wmencod...

Running a command with specific environment settings - one-liner

To run a program with custom env settings, we do this on Linux $ MYVAR=23 ./foo.py On Windows, the only way I know of is: C:\> set MYVAR=23 C:\> .\foo.py C:\> REM unset MYVAR here (but how?) But can't this done be as an one-liner? ...

Coherent access to mainframe files from Win32 application and IBM RDZ/Eclipse?

I have a suite of tools for processing IBM COBOL source code; these tools are built as Win32 applications and talk to Windows (including network) files using traditional Windows file system calls (open, close, read, write) and work just fine, thank you. I'd like to integrate these with Eclipse; we understand how to get Eclipse to do UI ...

Free Compiler for Windows on x86_64

Hello all :) I'm writing a compiler which uses C as an intermediate code which is (Currently) passed out to MinGW for compilation into an EXE file. I'm looking for an x64 compiler that I can include in my releases, so that users of my application can get around Win64's "Windows on Windows" system to access native resources. MinGW allow...

Set Application name in Task Manager's Applications Tab

I have a WinForms application written in C# for .NET 3.5 that needs to show a specific name in the Task Manager's Applications tab. However, I need for this text to be different from the Form's text. The behavior I've seen so far is that the Task Manager Applications tab will show the value of the Text property of the System.Windows.Fo...

Change the dll dependency on windows.

I have to rename some dlls which are used by some xyz.dll. For xyz.dll I don't have the source code is there a way to change xyz.dll to point to renamed dlls, For DYlibs on Mac I used Install_name_tool. For windows still looking for something, Please suggest. ...

listbox control in window application

i have listbox control and i have to display selected item in the listbox. some one send the code. the code like below private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { textBox1.Clear(); foreach (object selectedItem in listBox1.SelectedItems) { textBox1.AppendText(selectedItem.ToString() + Environm...

How can I delete fonts from my code, under Windows?

This article showed me how to install fonts from a script, but now I'm faced with the problem of removing them. How can I do that ? Any language is ok, I'll convert the info to what I need later. EDIT: Okay, so I now know how to uninstall fonts ( most of the part at least ). I'm issuing calls to RemoveFontResource. After that I use Send...

On Windows, how can I find what files a given process is using? Is there software that does this?

I want to know the files a given process is reading/writing. Is there a program that shows this? On Windows XP. Thanks. I've tried Autohotkey Spy, Spy++, and Process Explorer. They show a lot of detail but not which files are being accessed. ...

How to export image field to file?

Hi, I am using Microsoft SQL Server Management Studio to connect to a database. In it I've got a table, one column of which is an Image column containing file data. Another column is a string containing the file name. Is there some way I can write some sql script that will allow me to select a record and write this data to a file? Or i...

Migrating to open systems

I'm a windows (C++/.NET) developer. I want to migrate to UNIX systems because I'm tired of windows shit. Endless MS stupid silly buggy SDKs kill me every day and I'm not really enjoying programming like it was before. My question is what is the possible roadmap. Any chance to find a job in UNIX area with over 8 years of windows-only exp...

Shared memory on Windows that can be accessed (read and written) by separate processes

Can I use shared memory on Windows in order to have a common memory region that can be used by multiple separate processes? Context: Porting a unix application to Windows which has: - a 'setup' process that creates a number of shared memory regions. - a set of other processes (that run at times when the setup process has already fi...

Windows analog to Unix' 'ipcs -m' command

Does Windows have the notion of system-wide shared memory segments and is there a command for listing them? ...

How to avoid locking key-guard in windows-mobile

Hi, Can any one please help me, How to avoid key-guard lock programmatically in windows mobile. i have an application in that after certain minutes key-guard gets lock. i don't want mobile to get locked when my application is running. please suggest me how to do programmatically.. Thanks Grabit ...

Desktop and application menu freezes after ImpersonateLoggedOnUser

Hi. I use the following to elevate the rights of a c++ windows application: LogonUser() LoadUserProfile() ImpersonateLoggedOnUser() The functions do their work and there is no error. But as soon as I want to interact with my application again (clicking on a menu like "File" "Edit", and even right clicking on the desktop) the applicati...

What are good books to study C/C++ programming in Windows?

I'm an experienced Java/C# developer. I studied C/C++ in university but have never used them to build any non-trivial software. Now I'm interested in learning about C/C++ programming in Windows and looking for good books to get started. Specifically, I want to learn about Win32 API, MFC, COM, event hook, screen capturing, multithrea...

What's the cost (in cycles) to switch between Windows Kernel and User mode?

I'm curious what the cost is on modern CPUs in terms of cycles to perform a switch from Kernel and User mode? ...