windows

How could VirtualAlloc fail (no mem) despite plenty of phys memory on WinMobile?

I am routinely seeing VirtualAlloc calls to reserve memory fail. I'm requesting 2MB so that the allocations do not count against my per process virtual memory and instead use system shared memory. At the time of failure, the system reports having over 100 MB available in physical memory. I'm running on a windows mobile 6.1 device. So f...

Options for PHP CLI on windows

I'm working with the PHP CLI on windows at the moment to write some small desktop command-line apps. I wanted to know if and how it may be possible to: Clear the screen (cls would be the normal command but exec() won't work with it) Change the color, change the color of parts of the output (seen this in programs before) Make the comma...

How to run a .NET program, automatically, every hour

Hi I have xml data I access through a web service. I need to read the data and copy it locally. The below code works fine. I need now to run this code at least twice or three times a day wihout manual intervention. How do I do that? Thanks! using System; using System.Collections; using System.Data; using System.Xml; class MainClass...

Windows Task Scheduler API 1.0 disable problem under Vista

I have an app that needs to run on XP and Vista. That is it has to interface to the appropriate Task Scheduler (1.0 or 2.0). Because of this I'm using the ITaskScheduler interface (1.0). This works great except when I try to use IScheduledWorkItem GetFlags or SetFlags. Then the OS's that use 2.0 (Vista +) return a different result fr...

What does this registry file entry mean?

Trying to automatize an uninstallation I need to modify a .reg file that is filled with entries like this: [-HKEY_LOCAL_MACHINE\SOFTWARE\SomeSoftware] "Installed"="SomeDate" "Version"="SomeVersion" As far as i understand the way to delete a key would be: [-HKEY_LOCAL_MACHINE\SOFTWARE\SomeSoftware] and the way to delete a value woul...

What is the Win compile switch to turn off #pragma deprecated warning?

Using Visual Studio .NET 2003 C++ and the wininet.dll Am seeing many C4995 warnings More info Any help is appreciated. Thanks. ...

Current program/file name in focus (Windows)

Hello, I am coding an application in C# that needs to know the current program and files a user has in focus. I.e. I want to write functions like: string GetProgramNameCurrentlyInFocus() { ... } string GetFilenameCurrentlyInFocus() { ... } Which return the current program executable filename (e.g. "word.exe") or the actual official ...

How do I exclude specific .dlls from Visual Studio 2003 C++ .NET?

How do I exclude specific .dlls from Visual Studio 2003 C++ .NET? During release build I get the following warnings. Any help is appreciated. Generating Code... Linking... LINK : warning LNK4089: all references to 'ADVAPI32.dll' discarded by /OPT:REF LINK : warning LNK4089: all references to 'SHELL32.dll' discarded by /OPT:REF LINK : wa...

Windows assembly heap and stack?

OS: Windows 7 32bit So in like c++ one has a heap and a stack. But i've been starting on some assembly learning lately and haven't seen anything of the sort, only a stack but it just looks like pure memory. So is heap and stack implementation specific for c++ and other languages? Or do you still get allocated a heap and stack in assemb...

Disable full keyboard and mouse when console of c is running in window OS

Is it possible to disable full keyboard and mouse when I run my c program in window OS. Kindly guide me how can I make it possible. ...

Hide Console of c program in window OS

I want to hide my console of c when I run my application, kindly guide me how can I make it possible so that my application run in the background. ...

safely lock a file then move? windows

I have a file and need to ensure it exist before inserting a row into the db. After i insert i need to use the PK as part of the filename and move it into another location. How do i check if it exist then lock it so it cant be deleted until i can insert into the db then proceed to move the file without it being deleted upon releasing th...

Easiest way to transfer data between 2 C programs?

In ANSI C on Windows what is the best/easiest way to transfer data between two programs running locally without needing to write/read from a file? Data will be basic text and only one program will be sending and the other receiving. Thanks. ...

Python os.path.join on Windows

I am trying to learn python and am making a program that will output a script. I want to use os.path.join, but am pretty confused. According to the docs if I say: os.path.join('c:', 'sourcedir') I get "C:sourcedir". According to the docs, this is normal, right? But when I use the copytree command, Python will output it the desired...

audio recording problem

hi I am recording an audio and storing to the application's folder. But it's not working on production server. I am using Microsoft.visualbasic.devices namespace. (www.codeproject.com/Messages/3398947/Re-How-to-Save-the-voice-record-file-in-the-client.aspx) through this code I am recording audios and listening locally but I am unable to...

Block Access to physical address on Windows

I'm accessing my memory-mapped device via a device-specific physical memory on the PC. This is done using a driver that maps a specific physical address to a pointer in linear memory on my process address space. I wanted to know if there is any way I can obtain a block the specific physical address and prevent other processes or devices...

Windows command line search for exact extension with dir

When I do a search: dir /b /s *.txt I get all files/folders with the extension .txt But I also get them when they have an extension like .txtx But I don't search for .txt How can I search for the exact extension? ...

How to wait for a cloned child process of an invoked process to exit?

I have a program which needs to invoke a process to perform an operation and wait for it to complete the operation. The problem is that the invoked process clones itself and exits, which causes the wait api to return when the process exits. How can I wait for the cloned process to finish execution and return? I am using the windows JOB ...

Using Windows LockResource to access binary resource data

First, my concrete question: In my attempt to access cursor raw data, my call to LockResource succeeds, but the SizeOfResource call tells me that the data is only 20 bytes, which is just too small... What I'm really trying to do: I am exploring possibilities for remoting cursors from mixed code server application to a CLR client applica...

Is there a touch() for .NET/windows? can use while file is readlocked?

Is there a touch() function available? I would like to update the timestamp so my script doesnt delete the file when it becomes X old. Another issue is it should work when the file is locked for reading by another process. ...