windows

Microsoft Detours - DetourUpdateThread?

Hi, I have a few quick questions about the Microsoft Detours Library. I have used it before (successfully), but I just had a thought about this function: LONG DetourUpdateThread(HANDLE hThread); I read elsewhere that this function will actually suspend the thread until the transaction completes. This seems odd since most sample code c...

TCP Connection Creation and Closing Event Hooking

Dear Devs I would like to write an application that tells when a tcp port opened and closed on windows platform please if some can give me piece of code or sample my preference is C# code. Regards ...

cross-platform scripting for windows, Linux, MacOS X

Hi. I'm looking for cross-platform scripting (language) for windows, Linux, MacOS X. I'm tired of .bat / bash . I would like to do things like for example ,,lock workstation'' at automatic login (I had this in X-Window but the solution was pretty ugly; now, I would like that on MS Windows and not that ugly :-) ). Generally: automate tas...

[Batch]: Remove language from regional settings in Windows

Would it be possible to somehow, probably in the registry, remove a language from your accounts regional settings on Windows XP using batch scripting? If someone could point me to the correct registry key i could then just export it modified and import it with Batch. ...

What Color is the Windows' System.Control? (Visual Studio Design View)

In Visual Studio Design View, the selection of Form Colors in the Properties Pane are selectable from the "Custom", "Web", and "System" tabs. Of course, the color number can be used, too. When the "System" Tab is selected, the colors in the list depend on what type of Theme the Computer User has set on the PC. I'd like to stick with th...

Can I use XpsDocument class in a Windows Form app

I'm trying to convert an XPS document to a BMP so that a C# Windows Forms app using MODI can read it, because my understanding is that MODI cannot read XPS files, only .tif and .bmp I can't seem to locate the XpsDocument class. Can anyone tell me how to incorporate this into my Windows Forms app? thanks! ...

Detect a USB drive being inserted - Windows Service

I am trying to detect a USB disk drive being inserted within a Windows Service, I have done this as a normal Windows application. The problem is the following code doesn't work for volumes. Registering the device notification: DEV_BROADCAST_DEVICEINTERFACE notificationFilter; HDEVNOTIFY hDeviceNotify = NULL; ::Zero...

Executing Custom Actions immediately in WIX

Is there any way to execute a custom action in WIX as soon as the first dialog (welcome) appears? The requirement is to check prerequisites, and some of those require a custom action. The custom action could be executed as we click to the next dialog, but then the standard WIX prereqs are determined apart from our custom prereq. (The ...

Duplicate entries in uninstall registry key when compiling list of installed software

I'm trying to compile a list of installed software on a workstation. After some research I settled on using the information from the following registry key to compile the list. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall It has been a good source and it also lists items that are not listed using Win32_Produ...

CRT, do we still need to redistribute it ?

Do we still need to bother with vcredist.exe when distributing windows native applications ? Does any of these come bundled with Win-7 ? If not, are there any technical reasons these are not shipped to people via e.g. windows update - insteadof letting us burden the customers with yet-another-thing-that.must-work ? (Ok, that might sound...

Windows is not passing command line arguments to Python programs executed from the shell.

I'm having trouble getting command line arguments passed to Python programs if I try to execute them directly as executable commands from a Windows command shell. For example, if I have this program (test.py): import sys print "Args: %r" % sys.argv[1:] And execute: >test foo Args: [] as compared to: >python test.py foo Args: ['fo...

Can sed be made recursive in for windows?

I'm using sed for windows to do search and replace on some javascript files, and I was wondering if using some other utility I could make it work recursively. ...

Unwanted SDL_QUIT Event on mouseclick.

I'm having a slight problem with my SDL/Opengl code, specifically, when i try to do something on a mousebuttondown event, the program sends an sdl_quit event to the stack, closing my application. I know this because I can make the program work (sans the ability to quit out of it :| ) by checking for SDL_QUIT during my event loop, and ma...

Using python to write text files with DOS line endings on linux

I want to write text files with DOS/Windows line endings '\r\n' using python running on Linux. It seems to me that there must be a better way than manually putting a '\r\n' at the end of every line or using a line ending conversion utility. Ideally I would like to be able to do something like assign to os.linesep the separator that I wan...

Have minimized windows with a unique icon/color?

Are there any programs or way to get a specific icon or any icon for that matter into a minimized window? The reason why I ask is that I hate having 3 or more windows of the same program minimized on my taskbar using the same icon. When I want to open up the program i'm not sure which window to activate. -edit I'm asking for a program...

windows C system call with spaces in command

I cannot make system calls with spaces in the names and parameters. For example: system("c:\\program files\\something\\example.exe c:\\my files\\example.txt"); I have tried escaping in every way I know how, and NOTHING works. I have tried: system("\"c:\\program files\\something\\example.exe\" \"c:\\my files\\example.txt\""); and s...

Best windows iphone app development alternative

What do you think is the best way to develop iphone apps on windows? What are the pros / cons of your method, and why do you use it over other options? How complex is your method in relation to other options? I am more interested in standalone and web apps but fell free to discuss gaming graphics. Yes I know you need to build on a mac...

SysInternal's WinObj device listing mechanism

SysInternals's WinObj can list all device objects. I wonder how it can list the devices. Is there any open source we can read?(or a code snippet) What is the most significant function I should know? ...

Difference in Solicit and unsolicit messages/events?

Can someone pls tell me do we have solic & unsolic message/events in MFC or window programming? In devices solic response and unsolic response is said as immediate response (like acknowledgement to commands) and late response (generated without any further commands being sent) respectively. Likewise can we say events as solic / unsolic...

vlc python bindings - how to receive keyboard input?

I'm trying to use VLC's python bindings to create my own little video player. The demo implementation is quite simple and nice, but it requires all the keyboard commands to be typed into the console from which the script was run. Is there any way I can handle keyboard input also when the video player itself has focus? Specifically, I ca...