windows

Windows process management using Python

I need a script that check if a particular process is running and return something if not found. I know that this can be done using subprocess, but is there a simpler way to do it? ...

What are the different areas of Memory & Disk?

I'm neither sure about if this is a right place to ask nor sure about how to put my query. Let me put it this way: Main Memory starting at 0x00000 to 0xFFFFF. Diskspace starting at 0x00000000 to 0xFFFFFFFF. But what we'll be able to access will not be from 0th byte till last byte right? On hardisk I guess at the 0th byte we...

How to get the length of data to be read (reliably) in named pipes?

I have created a named pipe with following flags: PIPE_ACCESS_DUPLEX - both side read/write access PIPE_TYPE_MESSAGE - Message type read PIPE_WAIT - blocking read\write From the server side I am calling ConnectNamedPipe and waiting for the clients to connect. From the client side I am calling CallNamedPipe to connect to server and w...

How to send the output of a software to a Microsoft Windows Virtual Keyboard?

I am using xvkdb with X11 to send the content of my Barcode reader to the Keyboard Focus Window. But I am looking to port this Barcode Reader on Microsoft Windows. How would you do that? Here is the bash script : zbarstream /dev/video | xvkbd -file - ...

Fast (lowlevel) method to recursively process files in folders

My application indexes contents of all hard drives on end users computers. I am using Directory.GetFiles and Directory.GetDirectories to recursively process the whole folder structure. I am indexing only a few selected file types (up to 10 filetypes). I am seeing in profiler that most of the indexing time is spent in enumerating files a...

when and how to use windbg kernel debugging

I found Windbg is very useful during development and debugging. but mostly i use windbg in use mode debugging. What kernel debugging can do in windbg? or When should I use windbg's kernel debugging? Is there a toturial about kernel debugging in windbg? Thanks in advance. ...

How to get current username in Windows Powershell?

How to get the current username in Windows Powershell? ...

Can 2 WCF service processes listen the same port?

I know 2 processes can't listen the same port, but as it happens with HTTP requests in the port 80, I know Windows can receive the packets and reroute to the appropriate services. I just don't know if it also happens with other ports and protocols (net.tcp for instance). ...

WiX: Calling Custom Action on Merge Module only if Feature is selected

I have a WiX installer which has 3 Projects. 2 Creates Merge Moduels, 1 Creates the installer. The code in the mergemodules should only be executed if the corresponding feature is selected. Is there any chance to get this to work with custom actions? From my experience the custom actions are always called - wether or not a certain feat...

How to best convert CString to BSTR to pass it as an "in" parameter into a COM method?

I need to convert a CString instance into a properly allocated BSTR and pass that BSTR into a COM method. To have code that compiles and works indentically for both ANSI and Unicode I use CString::AllocSysString() to convert whatever format CString to a Unicode BSTR. Since noone owns the returned BSTR I need to take care of it and relea...

Determining HID interface to be POS or Keyboard in C++

I've got some bar code scanner devices that can handle a variety of USB interfaces (COMM Emulation, HID Keyboard, HID POS, etc.) The problem is that, while I can tell if the device is in a HID mode, I need to be able to determine if it's HID Keyboard or HID POS. Is there a way to determine this using Win32 C++, preferably with the buil...

iPhone SDK windows ?

Is there an official iPhone SDK for Windows? I thought there was none, but a colleague at work said he downloaded one from Apple. Which one of us is wrong? I thought Apple doesn't release it's developer tools for windows. Or is that just Windows on non-apple computers ? ...

Embed webserver in desktop app: wxRuby and Sinatra

I would love to give my windows based desktop applications a web interface and vice versa. My desktop application is written in wxRuby and the webserver is Sinatra (using webrick). The simplest idea was just to mash them together, this does not work. This code does not work. The webserver and gui app do not run simultaneously. The...

Windows Workflow Foundation 4.0 and Tracking

I'm working with the Beta 2 Version of Visual Studio 2010 to get some advanced learning of how to use WF4. I'm using code similar to that in the SqlTracking sample from the SDK, and am trying to track complex objects, of types that I have created, that I have passed into the workflow as arguments. In the CustomerTrackingEventsTable in ...

How to read a REG_MULTI_SZ type value from the registry using RegQueryValueEx(..) in c++

In our vc++ win32 application we are reading a registry value of type reg_multi_sz, its working fine on 32-bit but giving empty buffer when i ran on 64- bit. How can I read values of 64 bit registry from my 32-bit application ? ...

Windows Gadget Font Error

I've written a Sidebar gadget in Windows 7, and added a g:textObject, and later on change the value through variable.value. But when run in Windows Vista, the text seems to compress itself strangely. Is there anything wrong with this code? var clock = document.getElementById("background").addTextObject("Time", "Nyala", 18, "white", 11...

How to use windows socket to find: number of bytes in output buffer pending send, but not yet transfer onto wire?

I already did a bit of research & tried a few things... but still can't find how to programmatic detect if there are any bytes (that maybe already be awaiting inside the outgoing queue) which had not been transmitted to the cable. Thanks ...

What are the values in intel x86 CPU stack before running (on Windows)?

I have been debugging some .exe and noticied that before I start debugging step by step, at the very beginning of the program, there are already some values loaded in the stack? What are these? I am using OllyDbg and some of the "labels" for these values are: return to kernel32.7C8... ntdll.7C9... End of SEH chain SE handler Than...

Using USB port from c++

Hello, i was just wondering if somebody could give me any pointers about how to use USB ports on Ubuntu(and other unix systems) &&/|| (and/or :]) windows. I was trying to googling some stuff up but i failed horribly. Even names of libraries to be used etc would be appriciated. Thanks, Tomas Herman ...

Premptively getting files into Windows page cache

I have a program written in C that allows the user to scroll through a display of about a zillion small files. Each file needs to undergo a certain amount of processing (read only) before it's displayed to the user. I've implemented a buffer that preprocesses the files in a certain radius around the user's position, so if they're worki...