windows

How to check whether a file/dir is writable in batch scripts

In bash, I would use [ -w ... ] What's the equivalent for Windows batch files? ...

What's the environment variable for the path to the desktop?

I'm writing a Windows batch file and want to copy something to the desktop. I think I can use this: %UserProfile%\Desktop\ However, I'm thinking, that's probably only going to work on an English OS. Is there a way I can do this in a batch file that will work on any internationalized version? UPDATE I tried the following batch f...

Drawing lines in win32/GDI with a custom pen style?

I have a need to do some drawing using win32/GDI (Native, not .NET), and I've run into the following problem: I need to draw lines that are "styled." For example, in the attached image, the line marked "A" is a straight line as far as my application data is concerned, it just needs to be drawn with the additional zigzag as a style. Of c...

How do I make my program work in Windows Vista and Windows 7?

I have an application written in Delphi 2006 that was working fine in Windows XP. I packed the application using Inno Setup, using Program Files as the default folder. A few users migrated to Windows Vista and Windows 7. The issue here is that the application creates some files inside its installation folder by its own. This was working ...

Knowledge of windows internals?

I wondered if any of you have knowledge of the internal workings of windows (kernel, interrupts, etc) and if you've found that you've become a better developer as a result? Do you find that the more knowledge the better is a good motto to have as a developer? I find myself studying a lot of things, thinking with more understanding, I'l...

How to install and start a Windows Service under NetworkService account by using WiX?

Dear All, I am trying to create a wix installer to install and start a Windows Service under NetworkService account, but failed, what I got is "Service"() could not be installed. Verify that you have sufficient privileges to install system services." Please advice, my code is as below: <Component Id="service" Guid='myguid'> ...

Cleaning up after calling GetSystemMenu()

I'm using Florian's wrapper class to call GetSystemMenu() to add a custom menu item to the system menu for an application. I'm just curious as to whether there is any cleanup required for the handle returned by calling GetSystemMenu or the additional menu items. I don't see any mention of needing to call CloseHandle() or similar, so my ...

Long lines all messed up on a console application

I'm trying to use a text-to-speech engine, festival, in Windows. I found a pre-compiled binary online, so I can't really re-compile without a whole lot of effort. Here's what happens. I run the program from cmd.exe and try to see the definition for a function: festival> utt.synth #<CLOSURE (utt) (begin "(utt.synth UTT) The main ...

Use Wix installer to add shortcut to subfolder in startmenu programs

I am trying to add my program shortcut to an existing folder in the start menu shortcuts. For example All Programs -> AppNameFolder -> AppNameVersionFolder -> AppShortcut In order to achieve this I added the extra lines: <Directory Id="ProgramMenuFolderApp" Name="App"> <Directory Id="ProgramMenuDir" Name="APP ...

cygwin programming

how do you compile java progrmas in cygwin? ...

How can I get the handle to a Canvas/PictureBox?

I am developing an application which uses the Math Input Panel that comes with Windows 7. The input panel allows users to draw math (using a pen or mouse device) and after recognizing the symbols it sends back MathML(xml). However, I need to get the image of the recognized math as well. I am able to get a window handle for the input pa...

How to draw something to the screen and have the underlying ui interactive

I seeking solution for Windows first. I need to add visual effects to screen image without breaking the interactivity of all and every controls, that are on this screen. The solution can be straightforward: 1. take a screenshot 2. show this screenshot in a separate window, above other windows 3. apply the effect to image, being shown ...

cygwin and java

i am new to cygwin..what are the normal steps that are followed while setting classpath and all for running programs in cygwin? ...

Converting BMPs to avi

I want to convert folders with video-frames in bitmaps into avi or mpeg files. I already have a VBScript which does a lot of stuff on those files, so it would be neat to integrate a functionallity to convert those folders automatically from my script. I can only find solutions that seem pretty low level and unfortunatley I don't know a w...

Long commands split over multiple lines in Windows with quotes

Using the caret to split lines, dir ^ *.bat ^ /w works as expected, but dir ^ "*.bat" ^ won't let me enter the "/w". I guess the caret does not work after a double quote. Is this a bug? Or if this is a feature, what is it's use and how can I get around it? ...

Alternative for windows fullpath API which can take path greater than 255 characters!

_fullpath API of windows takes relative path and gives the corresponding absolute path. But, it fails if the relative path is greater than 255 characters. Is there any other API available in Windows which can convert the relative path to absolute path and doesn't have the problem mentioned above? ...

eclipse and cygwin

i am trying to run a program in hadoop-0.20.1 with cygwin. while starting the 5 nodes my datanode,jobtracker and tasktracker are getting shut down automaticaly. what could be the reason? the name node and secondarynamenode are not starting fully as well. ...

Emacs 23.1.50.1 hangs ramdomly for 6-8 seconds on Windows XP

I have EmacsW32 23.1.50.1 emacs working on my windows XP machine. It hangs randomly for 5 to 8 seconds and quite frustrating. Any one has solution? I even tried using emacs win32 binaries (23.1) from gnu ftp site and that also hangs for few seconds. Here some notable processmonitor logs 10:56:59.9888359 PM CreateFile C:\usr\spool\...

Is there a posix SIGTERM alternative on Windows? - (A gentle kill for console application)

I have a console deamon that is runned by a GUI application. When the GUI application is terminated I'd like to stop the deamon as well. How can I do it in a gentle way on windows? On Linux I would just use SIGTERM is there a similar mechanism on windows for console applications? To provide a bit more details: the deamon app is writte...

In C++ how do i validate a file or folder path?

A user input string for a destination path can potentially contain spaces or other invalid characters. Example: " C:\users\username\ \directoryname\ " Note that this has whitespace on both sides of the path as well as an invalid folder name of just a space in the middle. Checking to see if it is an absolute path is insufficient because...