winapi

A reliable way to determine if ntfs permissions were inherited

Hello, I have a somewhat obscure question here. What I need: To determine if the permissions (or, strictly speaking, a specific ACE of a DACL) of a file/folder was inherited. How I tried to solve this: using winapi bindings for python (win32security module, to be precise). Here is the stripped down version, that does just that, - it s...

detecting idle time in python

How do I detect if the system is idle in windows using python. i.e. no keyboard or mouse activity. This has already been asked before. And there seems to be no GetLastInputInfo in pywin32 module. ...

ExitProcess from the OnShow event of MainForm in Delphi

I have an application that on startup checks some conditions and launches an external program in the OnShow event of the Main Form. The problem is that if there is an error when launching the external program, I want the application to terminate immediately. But there is an issue with that, in that EurekaLog catches my exceptions and som...

What dissasembler do you recomend?

I'm into hacking challenges (like rankk.com) and some of the challenges require disassembly and little modifications of PE files. I'm looking for a disassembler/debugger that is able to dump the strings, walk the assembler code and allow modifications. My knowledge in this field is very limited so I'm looking for something relatively e...

Interact with other desktop-applications in windows using C# winforms

I was wondering if its possible to interact with other programs someone with my program. For example clicking a button on another program etc. etc. I'm not sure if this is even possible but if it is could someone provide a little sample code in C#. Thanks ...

Preproccessor ignore

I am migrating from Visual Studio 6 to Visual Studio 2008 and I have a function of a component I am using named SetDefaultPrinter. Unfortunately there is a windows library function now, SetDefaultPrinter, with the same name. And the macro associated with it is getting in the way of me using my function. This is my workaround I have to ...

Python script embedded in Windows Registry

We all know that windows has the feature that you can right click on a file and numerous options are shown. Well you can add a value to this menu. I followed this guide : jfitz.com/tips/rclick_custom.html Basically I have a script that runs when I right click on a certain file type. Alright, so everything is going flawlessly, however w...

What exactly is the effect of Ctrl-C on C++ Win32 console applications?

Is it possible to handle this event in some way? What happens in terms of stack unwinding and deallocation of static/global objects? ...

How to copy a RTF string to the clipboard in delphi 2009?

Here is my code that was working in Delphi pre 2009? It just either ends up throwing up a heap error on SetAsHandle. If I change it to use AnsiString as per original, i.e. procedure RTFtoClipboard(txt: string; rtf: AnsiString); and Data := GlobalAlloc(GHND or GMEM_SHARE, Length(rtf)*SizeOf(AnsiChar) + 1); then there is no error but...

Win API to emulate drag of a file onto a window

Is there any Win API to emulate drag of a file onto a window? ...

Different ways of exiting a process in C++

There are various ways of exiting a process: e.g.: ExitProcess, ExitThread (from the main thread), exit, abort, return from main, terminate. I'd like to know the effects each method has on static/global/automatic object destruction. For example, I have a project that crashes (probably due to some deallocation error) when ExitProcess i...

Loading a 32-bit process in a 64-bit environment.

I have a couple of questions as below. CHM is (Compiled HTML File) My CHM file has a link to launch a 32-bit application. The CHM file is coded in Javascript.This works fine in a 32-bit OS environment. But this does not work in a 64 bit OS environment.The reason being: When I open the chm file,64-bit version of hh.exe(an operatin...

Write a shell which can embed other application and run as a separate process

I found an interesting article from HP website. They wrote a TouchSmart Shell application, and it allows other applications to embed in that shell, and run as a separate process. Of course, HP defined some restrictions with the embedded application. I don’t know if C++ and Win32 can do similar thing? http://www.touchsmartcommunity.com/ar...

Win32: Bring a window to top

Hi, I have a Windows program which has two 2 windows in it: hwnd (main interface) hwnd2 (toplevel window, no parent, created by hwnd) When I double click on hwnd, I need hwnd2 to pop up and show some data, so I use this function to bring hwnd2 to top: BringWindowToTop(hwnd2); hwnd2 is brought to top, but there is one thing odd. Wh...

Undocumented Windows API question...

Does anyone know what parameters to pass to dwmapi.dll ordinal #113? (Windows 7) I'm trying to incorporate this method into an application that I'm writing. From what I can tell, this method is responsible for doing the Aero peek thing for windows. If I pass no params to the method it will show the desktop and outlines of all open, non-...

Can autoplay and WIA be programatically reset to the default of "Ask me?"?

I have code that ads both Autoplay and WIA handlers for reading images files from memory cards and digital cameras, respectively, and it works fine. However, I'd like to reset the Autoplay and WIA handlers to the default of "Ask me what to do every time" the first time my application is run. Why? Because if the user has the handlers s...

Finding undocumented APIs in Windows

I was curious as to how does one go about finding undocumented APIs in Windows. I know the risks involved in using them but this question is focused towards finding them and not whether to use them or not. ...

Embedding Mono in Delphi Win32

Does anyone know the specifics of how to embed the Mono runtime in a Delphi Win32 application? The official documentations is not very helpful with regards to the Win32 environment (www.mono-project.com/Embedding_Mono). Upate: I am very familiar with the vagaries of static linking in Delphi and would be perfectly happy with a DLL. Mono...

AddMessageFilter without Windows Forms?

I'd like to use the functionality of System.Windows.Forms.Application.AddMessageFilter but my target application does not use Windows Forms. This functionality adds a filter to monitor Windows messages as they are routed. If anyone knows how this works, I wouldn't mind writing my own code to perform the same function. SetWindowLong wit...

how to check if a directory is writeable in win32 C/winapi?

I know of two methods which are not reliable: _access() - doesn't work on directories (only checks existence) CreateFile() - gives false positives in the presence of virtual store (AFAIK) Most useful would be a code sample, because the win32 ACL access functions are extremely complicated. Please don't post links to msdn, I've been th...