windows

how to send return(enter button) character through program

how to send return(enter button) character through program in windows c/c++? I want to send an external program "user name" with enter button through pipe but "\n" and "\r" and EOF are not working.. ...

How to get entire svn commit message in window bat?

I need get the SVN commit message in post-commit hook bat in Windows, so I do this: FOR /F "tokens=*" %%a in ('"svnlook log %1 -r %2"') do @SET MSG=%%a I test it, it's ok for most case. but, when I input multiple lines in SVN commit message, the command can only get the last line of commit message, I think it's caused by the windows b...

Which has the greater precedence: Windows Group Policy or Registry Keys

Hi, Say there is a group policy that prevents the user from using the "run" command in Windows. What would happen if there was a registry key that contradicted this i.e. allowed the user to use the run command? Would the user be able to use "run" or not? Thanks a lot for any answer! ...

send the enter button input through pipe

how to send return(enter button) character through program in windows c/c++? I want to send an external program "user name" with enter button through pipe but "\n" and "\r" and EOF are not working. consider if pPipe is the pipe stream for sending the data to the remote process stdin... fprintf(pPipe,"username\n"); ...

What are the differences between BringWindowToTop, SetForegroundwindow, SetWindowPos etc.?

BringWindowToTop, SetForegroundWindow, SwitchToThisWindow, SetWindowPos, ShowWindow all are described as showing and activating a window. What are the real differences between them? When and why would BringWindowToTop be preferred to SetForegroundWindow, (Or SwitchToThisWindow or even SetWindowPos with the flags to activate and show)? ...

How do I create a monitor for a specific directory?

Using Java over Windows Vista, I'm trying to create a kind of a monitor for a directory, so every time this directory is modified (new, renamed, updated or deleted files) a process is triggered. I tried to do this with a loop that will execute a dir in the directory and analyze all the files. But this is very time and memory consuming, s...

Non-intrusively unlock file on Windows

Is there a way to unlock a file on Windows with a Python script? The file is exclusively locked by another process. I need a solution without killing or interupting the locking process. I already had a look at portalocker, a portable locking implementation. But this needs a file handle to unlock, which I can not get, as the file is alre...

Error: The requested service provider could not be loaded or initialized. - socket(2)

I am running a ruby script that uses Ruby/MySQL and net/ftp. The script is running on a Windows Vista box and is trying to create a database and ftp connection to the same remote Solaris server. Here is the gist of the code: require 'mysql' require 'net/ftp' dbh = Mysql.real_connect(db["host"], db["user"], db["pass"], db["name"]) ftp ...

Order of execution of waiting threads blocked by mutex

I have a mutex that controls access to a single object from multiple threads. When a thread has finished the mutex is unlocked to allow order threads to operate on the object. On Windows using the WaitForSingleObject function is there an order that threads are signaled? I want the first thread that attempts to lock the mutex to now be al...

What is a good way to build a lot of small tools in Visual Studio?

Suppose you have some source code that comes from the unix world. This source consists of a few files which will create a library and a lot of small .c files (say 20 or so) that are compiled into command-line tools, each with their own main() function, that will use the library. On unixy systems you can use a makefile to do this easily...

Controlling other windows from C# app

I'm writing a C# app that will aggregate control of several applications (WMP, Google Earth, etc.). For apps that I am not writing myself, I am launching as a process, so I have their handles (handle = Process.Start("C:\whatever.exe"); is the code, I believe). For it to work smoothly, I need to be able to control the minimized/maximized...

Are there any tricks for counting the number of lines in a text file?

Say you have a text file - what's the fastest and/or most memory efficient way to determine the number of lines of text in that file? Is it simply a matter of scanning through it character by character and looking for newline characters? ...

Windows processes vs. applications

I can easily identify running processes by looping through the WMI Win32_Process elements. Is there a similar way to identify "applications" as in Task Manager? I assume that this is comparable to knowing whether the process has an open window. For example, when you exit Outlook, the OUTLOOK.EXE process keeps running. Task Manager no...

checkbox - change notification

What notification code is sent with the wm_command message to the dialog box procedure when a check box changes state? And more importantly, where would I look in the msdn to find the notification codes for various controls? ...

How to ask a remote windows machine to automatically launch an application?

I have a windows server 2003 up in the internet. But sometime I need to restart it. After restart, I want one of the applications to run. I want to do this all programatically. I can now remotely restart the server. But the question is how can I ask that piece of software to be executed (more precisely, I want to execute a .BAT file to...

Activate Speakerphone on Windows Mobile with C#

Hello. I am trying to make an application for Windows Mobile 6 and one of it's features is enabling and disabling the speakerphone. How can this be done in C# code? I'm guessing a P/Invoke. Please let me know, I need this information to get my application really going. Thanks ...

How can I redirect all shortcuts to a given executable? Is there any equivalent to a symlink on Windows?

I am working on a program which includes a general purpose engine, some program specific content, and a custom automatic updater to handle updating the many gigabytes worth of media in our content as efficiently as possible. In a recent release of the engine, we have reorganized our directory structure, such that instead of the executabl...

how to create minidump for my process when it crashes

Hi I am not able to create minidump form my process by changing system setting.So my Question is Will system create a minidump for user process when they crashes If yes , which setting i need to configure Or do i have to create minidump programmatically. How much effective minidumps are while investigating a crash ...

Signing data in C++ compatible with PHP's openssl library

I'm looking for a way to sign some data in C++ code which will then be sent to a PHP script for verification and processing. I want to use the OpenSSL module there, namely the *openssl_verify* function so I need something compatible with that. The application will be only for Windows so CryptoAPI might be fine but looking at the samples...

mplayer -ao pcm:file=C:\x.wav

Not sure where this should be posted... Anyway, if i run the following command in a windows XP console it gives me a weird error and i have no ideea why. mplayer "1.mp3" -vc "null" -vo "null" -ao "pcm:file=C:\1.wav" Could not parse arguments at the position indicated below: file=C:\1.wav ^ Failed to initialize audio driver 'pcm...