windows

File size monitoring in C#

Hello, I work in the Systems & admin team and have been given the task of creating a quota management application to try and encourage users to better manage there resources as we currently have issues with disc space and don't enforce hard quotas. At the moment I'm using the code below to go through all the files in a users homespace ...

C# Arranging icons and changing folder display

Is it possible to arrange icons (just placing them at different locations on the desktop/in folders), and if so, could someone point me in the right direction? I'm also interested in changing the properties for a folder programmatically, like "Documents", "Pictures", "Detailed list" and so on. Thanks ...

is it safe to call "plink.exe" in an application

i want to use "plink.exe -u username -pw securepassword" on my windows visual c++ program. will username and password remain safe while calling this command? I mean can a hacker steal or sniff the username and password? (consider hacker can't get to the password directly from the exe file) ...

Trying to read keyboard input without blocking (Windows, C++)

I'm trying to write a Windows console application (in C++ compiled using g++) that will execute a series of instructions in a loop until finished OR until ctrl-z (or some other keystroke) is pressed. The code I'm currently using to catch it isn't working (otherwise I wouldn't be asking, right?): if(kbhit() && getc(stdin) == 26) //The...

How do you take snapshots of an iPhone screen within a C# application?

I would like to be able to take a snapshot of the screen of an attached iPhone from within a C# application I am writing for Windows, similar to how Xcode's Organizer takes snapshots. I have heard that you can use ITunesMobileDevice.dll to communicate with an attached iPhone, but I don't know how to take snapshots using this library. ...

odd problem with jni interacting with dll's - not sure why a change to gc ergonomics fixes it

We were having a problem with our Tomcat jvm blowing up and giving us an hs_* dump at random times but always in the same spot, that wasn't very informative other than saying we had an EXCEPTION_ACCESS_VIOLATION Commenting out various parts of the java that called particular jni functions just made it blow consistently in another spot. ...

HttpSendRequest not getting latest file from server

I am having an issue with my HTTP requests in my app, such that if the remote file is the same size as the local file (even though its modified time is different, as its contents have been changed), attempts to download it return quickly and the newer file is not downloaded. In short, the process I am following is: Setting up an HTTP co...

win32 read java preference from c++ code

One of our program writes program information(window title, memory etc) in Java Preferences. On windows this is available under registry. How can I read the values written by Java program using c (or c++). Looks like API I should use is RegGetValue. Is this guaranteed to work on Windows XP 32 bit? The String written by java is UTF-8 ...

Prevent Sidebargadget from destroying Flyout on lost focus

Does someone know how to prevent the flyout windows in a Windows Sidebar Gadget from being destroyed / hidden when it loses focus? I hope this behaviour isn't hardcoded in the sidebar engine or can somehow be workarounded..... but as soon as the Flyout loses focus the object gets destroyed and I could, so far, not find a way to prevent ...

Is there compilation symbol to detect compact framework?

Is there a compilation symbol to detect if it's running on a compact framework platform ...

Appverifier and Visual Studio for leak detection

Hi, I'm running Appverifier in an application. When it detects a memory leaks the logs saids "Address of the leaked allocation. Run !heap -p -a to get additional information about the allocation." I guess that's when you are running in Windbg, is there any way to access the allocation stack trace from inside Visual Studio ? ...

Python: shutil.rmtree fails on Windows with 'Access is denied'

In Python, when running shutil.rmtree over a folder that contains a read-only file, the following exception is printed: File "C:\Python26\lib\shutil.py", line 216, in rmtree rmtree(fullname, ignore_errors, onerror) File "C:\Python26\lib\shutil.py", line 216, in rmtree rmtree(fullname, ignore_errors, onerror) File "C:\Python26\l...

Java/C++ communication via pipe on Windows

Hi, I have two separate programs, one in Java and one in C++, both running on Windows. We need to do bidirectional interprocess communication between the two. Up until now, we were using this awkward solution of writing to text files and reading them on the other side, where the producer would generate a .lock file when it's done writi...

How can I get the last modified time of a directory in Perl on Windows?

In Perl (on Windows) how do I determine the last modified time of a directory? Note: opendir my($dirHandle), "$path"; my $modtime = (stat($dirHandle))[9]; results in the following error: The dirfd function is unimplemented at scriptName.pl line lineNumber. ...

Enabling Remote Desktop on Windows7

Is there a way to enable Remote Desktop on a machine, remotely from another machine in the same network(with admin privileges on both machines of course). ...

Running VB & C# programs in Ubuntu

I've run the following command in the Ubuntu terminal - sudo apt-get install mono-develop Now how can I run *.vb and *.cs programs using the terminal - What is the command that need to be given? Does the syntax vary when we write code in Windows & Linux environment? ...

tools in masm for files io

How can I operate on files in masm. I mean using standard libraries included to microsoft (masm). Or somethning available in windows without linkink libraries. ...

C#/.NET: Retrieving the contents/file attributes from a file inside a recycle bin

Hi, I just wanna ask if there's a possibility to retrieve the contents of a 'dump' file from the recycle bin programatically. The contents that I'm looking for are file attributes like 'Date Last Modified, 'Data created', 'size', etc (without restoring the file itself to the original location to preserve the original attributes found wh...

How to protect code from crashes in this situation

int arr[ 5 ] = { 0 }; int i = 8; // out of bounds arr[ i ] = 8; I know that I can just check i like this if( i < 0 || i > 5 ) .... I also know about SEH in Visual Studio, but it looks like not working solution. __try { /* code */ } __except(GetExceptionCode() == EXCEPTION_ARRAY_BOUNDS_EXCEEDED) This is not working. As I see SEH...

setup apache virtualhost (windows)

Hi, How to setup virtualhost for multiple domain name on windows ? I will use it for my own test projects. I have 3 projects that I need to setup and at the moment I'm using xampplite for the portable apache. www.foo-bar.com --> direct to c:\xampplite\htdocs\foo-bar\ www.abcdef.com --> directo to c:\xampplite\htdocs\abcdef\ www.qwert...