windows

PeekMessage() throws an unhandled exception (access violation)

Greetings all, in my application i use the following code: bool HandleMessages() { MSG msg; if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) return FALSE; TranslateMessage(&msg); DispatchMessage(&msg); } return true; } This is the standard code for message handling in windows i though...

Can a Java program put a DLL in C:\Windows?

Hi, I'm making an executable JAR that uses the RxTx serial library. It requires access to rxtxSerial.dll and I want the JAR to put it there automatically. That way I don't need an installer -- just a standalone JAR. Can this be done? When I call new FileOutputStream(new File("C:/Windows/rxtxSerial.dll")), I get the following excepti...

Windows: Child Process with Redirected Input and Output

Hello, I'm trying to create a Child Process with Redirected Input and Output (as described here - http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx). For the people that don't want to bother reading the source code on that page, the author is using anonymous pipes to redirect the child's input and output. The parent proc...

Changing a process name in runtime.

For A.EXE PE file, if the program runs as test mode, I would like to change the process name to "A_TEST.exe". And if the program runs as safe mode, I want to change to "A_SAFE.exe" The file name must be same(A.EXE). Is it possible? ...

Jboss Service started and then stopped.

I'm attempting to get my Jboss Server running as a windows service using the JbossService.exe, and I had it working until I uninstalled it (with ./JbossService -uninstall JbossService), and now, while it will install and the service will appear in the windows service list, attempting to start it will only yield the error message: "The J...

.NET: How to pass command-line parameters with a temp file name

This is .NET 2.0 WinForms. I have some code like so string str = Path.GetTempFileName(); Process p = new Process(); ProcessStartInfo psi = new ProcessStartInfo(); psi.Arguments = str psi.FileName = <some executable > p.StartInfo = psi; p.Start(); Now on the "started" process I get the temp file name by saying args[0]. On Win XP this ...

windows service memory usage

I'm currently creating a windows service that will do some update on the database and send email on a timely manner. My issue is that as i run the service, the memory usage increases by 8kb (starts by 18,000kb+) and I'm not sure if it is normal as it would increase after some months/years. I removed any calls from database as well as sen...

How to rename a Network volume's name in WOW64 Apps' Common File Dialog

I'm developing a network redirector like SMB. Once a volume has been connected, I create 4 registry keys to following nodes. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\#UNCPATH HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##UNCPATH HKEY_CURRENT_USER\Software\M...

Where does windows Service status stored?

I could see from MSDN documentations that a new windows service will be stored in the registry HKLM\System\CurrentControlSet\Services However the services registry key does not hold a value for the "service running status" Can anyone let me know where the service running status will be stored? ...

How to shut down from c#, Process.Start("shutdown") not working in windows XP

After some poking around on how to reset my computer and or shut it down from c# I found this explanation on how to do that: ManagementBaseObject outParameters = null; ManagementClass sysOS = new ManagementClass("Win32_OperatingSystem"); sysOS.Get(); // enables required security privilege. sysOS.S...

Keeping persistent data in memory

I am about to develop a Windows service in C#. This service needs to keep track of events in the system, and write some data to files from time to time. These ongoing events form a certain state, so I'll keep the state in memory and update it as events will arrive. I don't want to over-complicate things so I don't want the state to be pe...

Single MSI to install correct 32 or 64 bit c# application

I have a C# application which is built for both x86 (32 bit) and x64 (64 bit) platforms. My build system currently outputs two MSI installers, one for each platform. In case it makes a difference, my C# application includes a windows taskbar toolbar which means that the installed DLL must be loaded by the explorer.exe process. Is it pos...

Closing a MessageBox automatically

I have a third party encryption library, which may create a MessageBox if key creation fails. The failure can be caused by bad random number generation or other rarities, and in most cases, trying again will result in success. My code will attempt key creation up to three times before deciding it failed. Now, the issue is that the progr...

Play avi using animation control

Hi, I,m not c++ programmer on a daily basis, so I need help. I 'wrote' this. It's new project 'Windows Application' in DevC++. I add this #include <Commctrl.h> //... HWND film; //... film = Animate_Create(hwnd, 10, WS_CHILD | WS_VISIBLE | ACS_AUTOPLAY, hThisInstance); Animate_OpenEx(film, hThisInstance, "a.avi"); Animate_Play(film, 0...

How to call an executable as independent process using python in windows

After calling an exe using python script in windows, the exe should run independent of this python script and once it is initiated the control should comeback to python script and executes the further script and control of .py file will die. But on other side before finishing execution, the exe should call this python script. Ideas woul...

How to get motherboard type in C?

Hi! I want to create a small application which gets my motherboards type. How can i do this using C? Thanks, kampi ...

Is Microsoft Going to release final SDK Today of WP7?

Is Microsoft Going to release final SDK Today of WP7? ...

How to do inter-process communication between two instances of the same application?

I was thinking of using WCF, but then the endpoints would collide. What are the other options? The endpoints will collide because the second instance will be created from the same executable file. ...

Comprehensive tutorial for beginners on how to write Windows GUI programs

I'm trying to learn how to write Windows GUI* programs in C++, using Visual Studio 2008, but I haven't found any more comprehensive tutorial for beginners. The more comprehensive tutorials I have found are either only about how to make buttons, menus, etc. OR only about how to write basic C++ console programs. What I haven't found is a...

Version control, deployment and continuous testing in a single-person devteam (.NET platform)

I am the only developer in my company, and as such I control everything from deployment to bugfix to new features. My tool of choice is VS2010 and I code primarily in ASP.NET for new features and Classic ASP (sigh) for the bugfixes. I only have VS2010 Pro and I do not have access to any of the MS Team software. Now we are setting up a n...