windows

Cross-Platform equivalent to windows events

I'm trying to port some Windows code to Linux, ideally through platform-independent libraries (eg boost), however I'm not sure how to port this bit of event code. The bit of code involves two threads (lets call them A and B). A wants to do something that only B can, so it sends B a message, then waits for B to say its done. In windows t...

Programmatically Changing NameServer in Windows TCP/IP

Hello, I am building a VPN application where I need to set DNS server programmatically. I am changing NameServer parameter in the registry (in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces) to prepend a name server to the list of existing entries. Once I do this, if I try to look up a host name using ns...

PrintWriter Encoding Problem

Hi, I´m developing a netsh thread that keeps netsh open so I just have to call it once. Everything worked fine until I tried my app in a Spanish-Windows enviroment... netsh tells me that it can´t find the interfaces I´m specifying on the commands and I´m pretty sure that the cause of this is because some of these interfaces names have...

javac not working in windows command prompt

I'm trying to use javac with the windows command prompt, but its not working. After adding the directory "C:\Program Files\Java\jdk1.6.0_16\bin\" to the end of the environment path variable, the java command works fine, but using javac gives me the error: 'javac' is not recognized as an internal or external command, operable program or...

setting the environment path permanently

I want to make a batch file for setting the %PATH% environment variable permanently - ie adding a value to the path permanently (in Windows XP). ...

Is there any way to use UNIX GREP commands on WIndows operating system

All, I need some command like GREP in UNIX for WINDOWS Operating system, If there any way to use grep or any equivalent command in Windows? Please help ...

How to open a file with the standard application?

My application prints a PDF to a temporary file. How can I open that file with the default application in Python? I need a solution for Windows Linux (Ubuntu with Xfce if there's nothing more general.) Related Open document with default application in Python ...

How to implement an automatic update detection model

Our software is not ever officially installed on Windows, and currently has an update model like this: Connect to Internet Click an Update Button Connect to server-side program Server-side program creates an md5 hash list of all the files in the server program directory. Client-side program creates an md5 hash list of all the files in ...

Create process as user in ruby

The following code is in a file called run.rb, the idea is to run ruby as a different user so I can do some testing. require 'rubygems' require 'win32/process' domain = 'WORLDWIDE' user_name = 'user' password = 'password' rubyScript = 'ruby test.rb' Process.create(:command_line => rubyScript, :domain => domain, :with_logon => user_name...

Timer Queues, immediately terminate a timer?

I'm trying to achieve high frame-per-second on Windows GDI by using Windows Timer Queues. The relevant APIs are CreateTimerQueue, DeleteTimerQueueEx, CreateTimerQueueTimer, and DeleteTimerQueueTimer . The timer is created using CreateTimerQueueTimer(&m_timer, m_timer_queue, TimerCallback, this, 0, 20, WT_EXECUTEINTIMERTHREAD); to achiev...

Atomic Operation C++

In C++, Windows platform, I want to execute a set of function calls as atomic so that execution doesn't switches to other threads in my process. How do I go about doing that? Any ideas, hints? EDIT: I have a piece of code like: someObject->Restart(); WaitForSingleObject(handle, INFINITE); Now the Restart() function does its work asy...

Disable "Foo has encountered a problem and needs to close" window

Is there a way (other than WerAddExcludedApplication which won't work in Windows XP) to disable the window "Application has encountered a problem and needs to close" from appearing when my application crashes? (image taken from Bil Simser' blog) I need this to work in Windows XP. ...

Change encoding to UTF-8 recursively on Windows?

Does anybody know a tool, preferably for the Explorer context menu, to recursively change the encoding of files in a project from / to UTF-8 and other encodings? Freeware or not too expensive would be great. Edit: Thanks for the answers, +1 for all of them as they are all fine but I am a lazy bastard sometimes, and would really like to ...

When do windows xp services get started?

Hi, When a machine reboots, do all the services which are run under the accounts (system/service/network service) get run before a user logs on? JD. ...

How to tell if I'm leaking IMalloc memory?

I'd like to just know if there is a well-established standard way to ensure that one's process doesn't leak COM based resources (such as IMalloc'd objects)? Take the following code as an example: HRESULT STDMETHODCALLTYPE CShellBrowserDialog::OnStateChange(__RPC__in_opt IShellView *ppshv, ULONG uChange) { TRACE("ICommDlgBrowser::On...

Access svn repository on windows from Ubuntu 9.10

Hello, I am new to Linux and I am trying to setup eclipse with subclipse plugin to access my svn repository which is hosted on a Windows server. Everything is installed fine. When I try to create a new repository location, I am not sure how to identify the location in sublipse. I have successfully mounted the windows share and I can b...

osCommerce images not displaying

Hi, i really hope someone can help me. I am hosting osCommerce on a windows server 2003, PHP Version 4.3.10. i recently move hosting provider and uploaded my site via FTP and setup database etc, everything appears to be working correctly however for some unknown reason no images are showing on the website. When i view the source of the...

Windows Service : most appropriate location of the service specific files (database)

I have a windows service that hosts a WCF end-point that is a front-end for a SQL Server CE database. At the moment I have it at: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) Question: what is most appropriate location for this file (database.sdf)? ...

How can I read key input on windows in Perl?

I want to develop some utility on perl for autocompleting words. Is there any effective way in Perl to hook the keyboard on win32 (thread hook/surelly not system hook ) and catch an event when a key is clicked? I want to intercept the keyboard before the message sent to the OS like setwindowshookex win32 api and to process the message ...

Drawing on the desktop background as wallpaper replacement (Windows/C#)

I'm trying to make an application that needs to draw on the desktop, behind the icons so it appears to replace the desktop wallpaper. I've found a few solutions to this, but most of them didn't work very well (lots of flickering). One solution seems to be what I'm looking for, but I don't really get it. I've done mostly C# applications u...