windows

Is there a way to replace the "openwith" name for java apps in windows?

i have a java app in windows, put in the registy the entries for the file extension and for the app. HKEY_CLASSES_ROOT/.xxx -> (Default)=xxxApp, Content Type=..., PerceivedType=... HKEY_CLASSES_ROOT/.xxx/OpenWithProgIDs -> (Default)=xxxApp HKEY_CLASSES_ROOT/.xxx/ShellNew -> command=c:\java... -jar xxxApp.jar and ItemName=xxxApp HKE...

PostThreadMessage returns ERROR_INVALID_THREAD_ID

I have a multi-threaded simulation running on Windows Vista. When I use PostThreadMessage to send messages between threads, I am getting ERROR_INVALID_THREAD_ID, even though I am quite certain (from stepping through the debugger) that the thread id is valid, and the thread has a message queue, since I call PeekMessage from every thread a...

Remove border on activex ie control

For the application im building, i use an activex ie control. It works greate but i cant work out how to remove the border around it. I have tried overriding the invoke call and setting DISPID_BORDERSTYLE to zero but it looks like it never gets hit. Any ideas? ...

How to get a list of Windows sessions?

Hello all, I am trying to find a way to get a list of Windows sessions? I need the same information as the one displayed in the Task Manager on the User tab. I need to know if the user is active or not and if s/he is logged on in the Remote Desktop session. Any idea on how to do that with C# / Windows XP Pro? Thanks, Martin ...

Getting/setting security attributes of files on a network share

I am able to get/set security attributes (group, owner, DACL, SACL) of files on a NTFS volume by using the GetSecurityInfo/SetSecurityInfo API. The handles I pass to these APIs must be opened with specific access rights (READ_CONTROL, ACCESS_SYSTEM_SECURITY, WRITE_DAC, WRITE_OWNER) which require certain privileges (SE_SECURITY, SE_BACKUP...

How does Windows File Explorer automaticaly refresh itself?

Does it run in a loop polling the contents? (Highly unlikely and inefficient.) Or is it done with some event trigger? In fact, what I am really wondering is how does Windows Explorer refresh itself when it shows the contents of another computer over a network? How does the computer (or the OS) with the content notify the computer with...

How to programmatically discover mapped network drives on system and their server names?

I'm trying to find out how to programmatically (I'm using C#) determine the name (or i.p.) of servers to which my workstation has current maps. In other words, at some point in Windows Explorer I mapped a network drive to a drive letter (or used "net use w: " to map it). I know how to get the network drives on the system: DriveInfo[] ...

In .NET/C# test if user is an administrative user

Is there a canonical way to test to see if a user has administrative privileges on a machine? I'm going to be starting a long running process, and much later in the process' lifetime it's going to attempt some things that require admin privileges. I'd like to be able to test up front if the user has those rights rather than later on....

Associate scheme (eg. cms://) to a Windows program

Possible Duplicates: how do I create my own URL protocol? (e.g. so://…) How do I register a custom URL protocol in Windows? Is there a way to associate a scheme, like cms:// to a Windows program? So when an user types cms://user:[email protected], it opens the program and can automatically connect using the given credentials....

Same Header File for both DLL and Static Library.

So the common (at least VS 2005 states) way to define exports/imports for a DLL is: #ifdef MY_EXPORTS #define MY_API __declspec(dllexport) #else #define MY_API __declspec(dllimport) #endif class MY_API MyClass { ... }; This works great if I'm just building my code as a DLL. However, I want to have the option of using a static lib...

Ruby IDE for windows with autocompletion for my user defined classes

Is there a Ruby IDE for windows that supports auto completion for user defined classes (like textmate does)? class MyClass attr_accessor :name, :age def initialize(name, age) @name, @age = name, age end end mc = MyClass.new mc.... The last line should list [name, age] ...

writing .net software for a mac

I develop code using .net, and sometimes using ruby. My friend wants me to develop a small time keeping application for use on a mac. Basically a windows form application. I want to develop on my pc (it has all my tools) - I know the writing/deployment process for windows. Is it different if I want to make it work on a mac? Does th...

Using Python to call Mencoder with some arguments

Hello, I'll start by saying that I am very, very new to Python. I used to have a Windows/Dos batch file in order to launch Mencoder with the right set of parameters, without having to type them each time. Things got messy when I tried to improve my script, and I decided that it would be a good opportunity to try coding something in pyt...

Desktop Application Longevity

Say if you had to develop a huge windows desktop app what language/technology you believe will be supported longer by MS (or by its manufacturer if not MS product)? What language/framework would give the app greater longevity without the need to be adapted or rewritten in order to run on newer versions of windows as they are released? ...

What is CString::StringTraits? What is it for? There seems to be no documentation

Using Visual Studio 2005 As per the title; MSDN and google can't tell me, I'm hoping it'll let me know if the contained string contains Unicode characters or not - but that's a different problem! ...

Hang a process

Is there a (more or less) easy way to force the process of a windows application to hang, and not respond? Or is this entirely dependent on the application/process in question? Edit: What I wanted to try is this: The application in question has a web GUI, and several running processes in the background. There was a report that when one ...

WriteConsole() weird characters?

I use this snippet to create a console fron inside a dll. That dll gets loaded in a game. CODE SNIPPET The console window creates fine. But when i write stuff to it, i just get stuff like "???D??". I know i have to use the printf() syntax. So i use wprintf("%s", "test"); Any pointers? ...

Execute xp_cmdshell command as specific user

Hello, I would like to run xp_cmdshell (TSQL procedure) in order to mount a network drive and then access remotes mdb files. I am administrator on the MS SQL server and I have allowed xp_cmdshell execution accordingly. However, there is still a problem: When I call xp_cmdshell, the user executing the command is the SQL SysAdmin, i.e...

Meaning of hex number in Windows crash dialog

Every now and then (ahem...) my code crashes on some system; quite often, my users send screenshots of Windows crash dialogs. For instance, I recently received this: Unhandled win32 exception @ 0x3a009598 in launcher2g.exe: 0xC00000005: Access violation writing location 0x00000000. It's clear to me (due to the 0xc0000005 code as well...

Windows XP - mute/unmute audio in programmatically in Python

My machine has two audio inputs: a mic in that I use for gaming, and a line in that I use for guitar. When using one it's important that the other be muted to remove hiss/static, so I was hoping to write a small script that would toggle which one was muted (it's fairly inconvenient to click through the tray icon, switch to my input devic...