windows

How do you empty a cache when we you measure function's performance.

CPU cache always interrupts what we test a performance of some codes. gettime(); func1(); gettime(); gettime(); func2(); gettime(); // func2 is faster because of the cache.(or page faults of func1()) // But we often misunderstand. When you measure your code performance, how do you remove the cache's influence. I'm finding some funct...

slow down a process ?

How can i slow down a windows process ? I understand that i need to hook queryperformancecounter but what do i need to do next ? Plase help ...

Swing JFrame Responding to Native Window On Close Event

I have a Swing application which consists of a single JFrame set to Always On Top. When running under Windows, I use the following code to open the the native default email client and browser respectively: Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + Utils.formatMailtoUrl(to, subject, body)); Runtime.getRuntime()...

Do I have to pay an annual fee, simply to test/deploy my software on my own phone?

I cant see any way to get around this... ...

How can I locally intercept and respond to browser requests?

I want to set something up on my computer where if something (program, browser, whatever) makes a request (to a certain domain, I guess) I can send my own response to the request. I once saw a program that did that, and I was wondering how it did it. How would it be done? ...

How do I use the Windows Mail Protocols? (C#?)

Well, for my program(s) I'd like to let the user send me an e-mail with any errors. Instead of relying on a forsaken SMTP server, I decided to let the user use his very own e-mail client to send an e-mail to a specified address. So what I need is: A sender (should not be changeable) (example: [email protected]) An attached file...

Is there a better way to shell out a command in C++ than system()?

I have a C++ windows service that sometimes crashes when I call the system() function to shell out a command. I've run the exact text of the command in the windows command-line, and it runs just fine, but for some reason it fails when system() is run. To make matters worse, I can't seem to get any information as to why system() is faili...

Why Windows is not picking up the 128 pixels icons from my exe file?

Hi I created and exe file in which I added 32, 48, 64 and 128 pixels icons. When I put the exe on my desktop or navigate to the folder where the exe is stored, Windows Explorer shows only the 32 and 48 pixels icons. If I set my desktop to show 'Large icons' it still shows the 48 pix icon. Why? Windows 7 32 bit, RBG+Alpha icons, EXE...

back-up database in Linux partition from windows partition!!

Hello I am in a very embarrassing situation, I was trying to upgrade to ubuntu 10.04 from ubuntu 9.10 yesterday and while updating I forgot to put my laptop on charger and the battery ran out. Since we know that there is no track back process in linux, all I get now is a blank terminal screen at the start up. Even if I login, I still am ...

Linking libpng with Borland c++

I made a program on mac osx using opengl and dynamically linking libpng. Im now trying to port it to windows. Whenever I try to compile and link my ported program in borland it gives me this error and about 10 more that are the same but with a different '_png_create_read_struct' Error: Unresolved external '_png_create_read_struct' re...

Suppress system("ping") output in C++

Hi guys, I have written a simple program that pings three sites and then reacts to whether they are reachable or not. My question is: can I suppress system("ping ")'s output? I have written my code in C++ as I know that language the best. Currently the code opens the ping.exe running the system command. If I can prevent the output from...

How can I force the "Run As" form to appear when someone tries to run my .net desktop application?

Hi, I need in to popup thr "Run As" form when user tries to run my application (C#.NET 4, on Win XP), that he could easily to log as other user. It may be in the application itself (in the C# code) or in some other preceeding batch/exe file ("launcher") or such. I didn't find any way to pop this form. How could it be done? thanks. ...

How do I make my dependencies call my global operator new?

Hi, I have a test app that is linked with some DLLs (or .so's). In my main app I defined a global new/delete like this: void* operator new(size_t n) { .... } void operator delete(void* p) { ... } But I noticed the operators are only called for things I allocate in my main app, but not if one of the DLLs does. How do I make ...

How to prevent error pop-up message box for failed program (.exe) when running batch file

I'm running a test script from batch file. Because it is test, the programs are expected to fail once in a while. It is file as long as error code is returned so I can continue and mark specific test as failed. However there is very annoying behavior of executable files under Microsoft Windows - if something fails it pop-ups window lik...

How can I produce an OSD in Windows?

I want to create an on-screen display, i.e. text or simple graphics that appear on top of everything else being displayed. I know in Linux this is achieved with xosd, but how do you do it in Windows? (Assume XP and up if it makes it easier, and I would also be interested in knowing if the method is different in Vista/7) ...

Free GUI framework to create a single exe?

I'm looking for free and easy GUI framework that let me create single exe without dependency (like .Net framework) and to be not GPL as a side note .. im using Qt and its great but i have to be LGPL to use it that means lots of fat dlls . is there any alternative? p.s how did the Dropbox client made of? i know its python but how did...

What IDE / compiler combination should a Linux user use to build Qt apps on Windows while avoiding MS Visual Studio?

I can't help it; I know many people will disagree, but I would really like to avoid Visual Studio as much as possible. My ideal combination would be gcc + Netbeans. I already use those to code in Linux. But my issue is compatibility. For example, there is a library that I want to use that is supposed to work for .NET and Java. Does this...

possible to have a Timeout on ReadFile()?

while(GetExitCodeProcess(processInfo.hProcess, &exitCode) && exitCode == STILL_ACTIVE) { ReadFile(defaultSTDIN, chBuf, 1, &dwRead, 0); WriteFile(writingEnd, chBuf, 1, &dwWritten, 0); } The problem with the code above is that even when the child process referenced through processInfo.hProcess has exited, we are still stu...

Why does LoadPerfCounterTextStrings (lodctr) give the error: "The specified driver is invalid."

After registering the application key with the registry, I'm programmatically creating the .ini and associated header file for LoadPerfCounterTextStrings (both utf-8 encoded). The call fails with the error "The specified driver is invalid". lodctr /r doesn't resolve this. Anyone seen this, know what to do, how I might debug etc? I'm at...

Is there any way to check if the user enters their windows password incorrectly?

Hi, I'm not sure if it is actually possibe in C#, but I was wondering if there was a way to check everytime the user logs into the computer, and if the password was incorrect, call a function within the program. I'm not sure how tight the security is on things like this, so any help would be appreciated. ...