windows

Making Property Handler for my application to add custom properties to a file format

i dont know what i am doing wrong, using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.InteropServices.ComTypes; using Microsoft.Win32; namespace TestShell { [ComImport] [InterfaceType(ComInterfac...

Variable ora (time) with blank

The following assignment: set ora=%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2% returns the value " 9194234" when the time is 9.19.42,34. How can be squeezed the value or better to have the value "09194234"? ...

PowerShell, Object = Start Process?

Hi I would like to start the Internet Explorer without extensions and control it. (Navigate to other pages, click buttons etc.) When I use the command: "Start iexplore.exe -ArgumentList -extoff" I have the IExplore without extensions, but no object. I need the object to navigate to different pages and click buttons. "$ie = Start iexplor...

[Windows Imaging] Prevent GDI+ PNG Encoder from adding Gamma information to a 1-bit PNG

I wonder if its possible to instruct the Imaging PNG Encoder not to add any gamma and chroma informations to a 1-bit PNG. I am creating a 2 color palette for the image ColorPalette* pal = (ColorPalette*)CoTaskMemAlloc(sizeof(ColorPalette) + 2 * sizeof(ARGB)); pal->Count = 2; pal->Flags = 0; pal->Entries[0] = MAKEARGB(0,0,0...

Fast Updating of QPixmap from byte array

I'm working on a vision application and I need to have a "Live View" from the camera displayed on the screen using a QPixmap object. We will be updating the screen at 30frames/second on a continuous basis. My problem is that this application has to run on some 3-5 year old computers that, by todays standards, are slow. So what I would...

ERROR_SHARING_VIOLATION when trying to open file on network shared folder - for hours

I have the following problem: I have a application that, from time to time, opens a file, writes some date and closes it again. I get no errors when opening (with CreateFile) or closing the file (CloseHandle) - everything seems to be OK. My process is the only active user of this file. So far so good. However, if this file is located o...

Why will STA thread "leak small amounts of memory" if it fails to dispatch Windows messages?

After carefully reading this KB article I noticed an interesting statement there. The article says that if I have an STA thread and that thread doesn't dispatch Windows messages then that thread will be unable to receive COM events form a COM server can cause message broadcasters to hang (and thus sometimes cause a deadlock) surprising...

windows Vista screen disappear

I have a Windows Vista Sony Laptop. When I turn it on, the screen shows up for one second and then disappears and never comes back. Can anybody help me please. I really need your help. Thanks. ...

Is rebasing DLLs (or providing an appropriate default load address) worth the trouble?

Rebasing a DLL means to fix up the DLL such, that it's preferred load adress is the load address that the Loader is actually able to load the DLL at. This can either be achieved by a tool such as Rebase.exe or by specifying default load addresses for all your (own) dlls so that they "fit" in your executable process. The whole point of ...

GetKeyState doesn't work in Windows 2000 (C++)

Hello. I have just tested my DirectX game on a Windows 2000 SP4 system but it won't receive any mouse clicks! This is how I check for mouse clicks : unsigned int mButtons = 0; if (GetKeyState(VK_LBUTTON) < 0) mButtons |= HIDBoss::MOUSE_LEFT; if (GetKeyState(VK_RBUTTON) < 0) mButtons |= HIDBoss::MOUSE_RIGHT; if (GetKeySt...

How to get started with parsing network streams in c++?

I'm having hard time getting started with this, can you provide learning resources,hello world demos,or tips? ...

Check CD-ROM Tray Status

I have written a small piece of code to open/close a cd/dvd drive tray using the DeviceIoControl API and the proper IOCTL but I don't seem to be able to check the tray status. According to the msdn page (http://msdn.microsoft.com/en-us/library/aa363404%28v=VS.85%29.aspx), IOCTL_STORAGE_CHECK_VERIFY is supposed to succeed if the drive is...

What kind of windows applications can receive system events?

What kind of windows applications can receive system events? I mean events like closed by user. Windows forms, WPF applications and Windows services can do that. But I am not aware of any others. ...

Downloading to a specific drive

My users must download a program from the interwebs to a microSD card, which can be any drive letter from A-Z. Q: Is there a drop dead simple approach to downloading a file to a specified drive/directory without relying on the user to navigate for me? I can populate the directory with a seed file if necessary to let my program know the ...

Any ideas about securing a Windows 2003 enterprise X64 gameserver ?

Hello. I have a MUonline (link) gameserver running on Windows 2003 enterprise X64. I had a website running there too. I do not know much about security here so I'm asking for some tips or tutorials you know about this as my server was hacked (I don't know how, exactly) and Windows has been erased. So now I want to make a secure gameserve...

Creating a folder with the current time as name

Hi, I'm trying to write a simple backup script in Ruby that copies a folder to a specific directory with a timestamp in its name. My code is (simplified): require 'Fileutils.rb' time = Time.now FileUtils.cp_r "C:/somefolder", "D:/somefolder_backup_#{time}" But I keep getting `fu_mkdir': Unknown error - mkdir failed (SystemCallError...

Named Pipe ReadFile

My Application reads from a Named Pipe and the Problem is, ReadFile returns after the buffer is full or a timeout elaps. I wait for the last bytes to read up to 20 Seconds. Ich have test ist with smaller buffer, but Windows set buffer always to 1020 Bytes. I can't manipulate the Pipe on the other side. The Pipe runs on local Computer. If...

What is Bonjour and why should I use it over?

What are the advantages of using Bonjour in a program (vb.net), is it even possible? Couldn't I get the same end result using just what I program? ...

Volume Shadow Copy in C++

Hi, I'm developing an application which will need to copy files that are locked. I intend on using the Volume Shadow Copy service in Windows XP+ but I'm running into a problem with the implementation. I am currently getting E_ACCESSDENIED when attempting calling CreateVssBackupComponents() which I believe is down to not having backup ...

How to use Java to register a task with the Windows task scheduler ?

I have a Java app runs on Win7, it does something at start and goes to sleep for an hour, then wakes up to do more things after the hour, but Win7 goes into sleep mode after 15 minutes of inactivity, so I wonder if I can register a task with the Windows task scheduler in my Java app before it goes into thread sleep, so that Win7 will wak...