windows

Is there a way to simulate DNS Hijacking for testing purposes?

I'm working on an application that connects to URLs, and it responds differently depending on whether or not an address resolves in DNS. I need to find a way to simulate DNS Hijacking so that I can test that my application handles it correctly. Anybody know a way to do that? ...

Hook KeyPress Event in C#

I am reading few articles that explains hooking a key pressed by using globalKeyBoardHook() but didn't told where this dll is. How to get this class available. Please help how to get this dll. Is it a windows dll api or an external dll. ? Currently I am reading this, this article and not getting anything. Can anyone explain all the t...

Windows API GetOpenFileName with template and hook

I'm trying to use a template with GetOpenFileName without success. I've found very little on this topic in the MSDN or on the web. I've based my attempt on what I saw here http://visual-c.itags.org/visual-c-c++/77687/ My code follows. The TEMPLATE comments show where I made changes to code b4 the template attempt; mainly to remove ...

How to implement a hello world shared memory in c/c++ in windows?

Is shared memory stable at the first place? I prefer this way to inter-process/application communication because that way I don't need the overhead of parsing data. Is there a good hello world demo on this in c/c++? ...

Intercept disk activity on the level of physical blocks

I suppose this should be possible via filter driver, but what type exactly I need? ...

Domain Users logged in details for Windows Server 2003

I want to know all the users logged in for a particular domain by executing a script. Kindly help me giving the script or command. Thanks in advance. ...

What's the difference \\.\C: and \\.\C:\

In MSDN, String Meaning \\.\C: Opens the C: volume. \\.\C:\ Opens the file system of the C: volume. I could open \\.\C: volume device. But I couldn't open \\.\C:\ directory by CreateFile. How can I open the directory by CreateFile with \\.\ prefix. And if I open the directory, what can I do by using the handle. Are ...

How can I call a exported function using ordinal number.

If a dll exports some functions and the functions have only ordinal numbers, how can I call the functions? Give me a short example please. ...

Python Tool Windows

TL.attributes('-toolwindow', True) I'm making a GUI in Tkinter that uses a tool window, is there anyway to make this window show up in the task bar? ...

Fully qualified path Vs. Canonical Path.

There is a canonical path concept in Java. And there is a fully-qualified path in WinApi. I know well what canonical path is, but I don't understand fully-qualified path's concepts. For a file or directory, does fully-qulified path exist only one thing? -like canonical path. Are both of them totally same concepts? Edit: One more thin...

The process cannot access the file because it is being used by another process.

I have a program I made in C that will restart my Java application after running for 2 hours. First of all, I run my java program using a batch file, @echo off java -server -Xmx1024m -Xbootclasspath/p:"bin;" website.Server >>C:\web_logs\console.log It works perfectly fine, but after the 2 hours is up I use Runtime.getRuntime(); in Ja...

Adding program arguments to C

How can I load the batch file console to my C console? I know in batch The command is Showme.bat /B and it'll load the console into whatever console you called that file from. What would that be in C? ShellExecute(NULL,"open","Showme.bat",NULL,NULL,SW_SHOW); Also, doing that... How could I also add additional arguments such as >>...

Add/remove programs in Windows XP with Python script

I would like to add add/programs like adobe acrobat reader and other application in windows XP using Python script. Kindly looking for some help. Thanks in advance! Everest. ...

How can I use Delphi to test if a Directory is writeable?

Currently I use this function, based on JCL code, which works fine: function IsDirectoryWriteable(const AName: string): Boolean; var FileName: PWideChar; H: THandle; begin FileName := PWideChar(IncludeTrailingPathDelimiter(AName) + 'chk.tmp'); H := CreateFile(FileName, GENERIC_READ or GENERIC_WRITE, 0, nil, CREATE_NEW, FILE...

How to get an HTA to restart itself?

I have an HTML Application that I am using to build a kiosk environment. At the end of every session (when the user clicks "Logout" or after a timeout) I want the HTA to close itself and restart*. I was wondering how I would go about achieving this programatically with VBScript. The process should go something like this User clicks "l...

Sending Email from Windows Azure Through BPOS

I'm trying to send an email via asp.net mvc2, and all works well on our companies mail server. However, we're looking to switch to using our client's BPOS account. This works fine locally, but when deployed to azure, we're getting some timeout errors. Can anybody confirm I have the following correct? SmtpClient smtp = new SmtpClient("...

500.19 error in IIS7 and Windows 2008 with .NET 4.0

Hi, We developed a .NET application to provide REST services. We are trying to deploy it in IIS with the below server configuration: IIS 7.0 SQL Server Express Edition 2008 Windows 2008 Server .NET 4.0 We are getting the error as attached in the picture. Please help This is driving us crazy. THE ERROR MESSAGE IS HTTP Error 500....

Is it possible to avoid static or global variables in dialog functions

If one needs some sort of state in a dialog function, it seems you need some sort of static variable. For example, the hook procedure for GetOpenFileName provides the dialog function with the address of the OPENFILENAME structure on its WM_INITDIALOG call but not on any subsequent calls and the OPENFILENAME structure contains a place fo...

Correct BCP syntax

I am a first time BCP user. I have an XML file that I need to import into a new table in SQL Server. This is using SQL Server 2008 and BCP version 10.50.16. I read through the documentation but I get 370,000 errors! (This is a very large file). When I open the error log, I just see a bunch of question marks. About this XML file: i...

Time Sampling Problems with gprof

I am attempting to profile some c++ code, compiled with g++ including the option -pg, using gprof. However, in spite of the fact that the program takes 10-15 minutes to run on my computer (with the CPU maxed out), the % time, cumulative seconds and self seconds columns of the table produced by gprof are entirely 0.00s! The calls column c...