winapi

Process-wide hook using SetWindowsHookEx

I need to inject a dll into one or more external processes, from which I also want to intercept keybord events. That's why using SetWindowsHookEx with WH_KEYBOARD looks like an easy way to achieve both things in a single step. Now I really don't want to install a global hook when I'm only interested in a few selected processes, but Wind...

Cannot run Python script on Windows with output redirected??

This is running on Windows 7 (64 bit), Python 2.6 with Win32 Extensions for Python. I have a simple script that just print "hello world". I can launch it with python hello.py. In this case I can redirect the output to a file. But if I run it by just typing hello.py on the command line and redirect the output, I get an exception. C:> py...

why parent window don't get notifications from child combobox?

Hi! I create a simple window with a comboboxex (with inserting few bitmaps), I need to know when user has selected an item from combo-box(I need CBEN_ENDEDIT I think). But Parent window don't get any WM_NOTIFY from that combo-box except one value. Can anyone help me with this please? Why I can't get the notifications ? //Window creati...

How can you prevent an individual window being captured by Print-Screen?

I noticed a few times than when I print-screen while Media Player is running, the content is replaced with a grey rectangle. I've no idea if it's deliberate due to DRM, or some technical issue, but it struck me that being able to deliberately block screen-capture might be a useful feature in some scenarios. I am not looking to fix the pr...

How can I notify an application of a programmatically set scrollbar value?

My code involves standard Scroll Bar control and it happens that I need to change its value programmatically in some cases. I do this using SetScrollInfo function, as in this example: void setScrollBarValue( HWND scrollBar, int value ) { SCROLLINFO si = { sizeof( SCROLLINFO ); } si.fMask = SIF_POS; si.nPos = value; ::Set...

DWMEnableBlurBehind makes my interface controls semi transparent

I have enabled blur on my window. I have some edit fields and some custom controls and I would not want these to be affected by the blur, they are semi transparent as a result. How could I only blur the main window itself, not its child controls (sort of like Chrome). Thanks ...

Sound Manager Classes for Windows

I need some classes for playing short wav sounds, this classes would load this wav files into memory when an instance created, play sounds in background when needed, release this wav files from memory when an instance disposed. How can I do this on C# for windows (.Net 2.0)? (Win API's sndPlaySound, OpenAL or may be any wrapper) Ideall...

How to get Win32 to use Windows XP style fonts

I'm writing a Win32 application using plain C and WinAPI. No MFC or C++ is allowed. To get the controls to draw using the appropriate style, I use a manifest, as described in the corresponding MSDN article. Everything is fine, and when I change the system style, my application changes style as well. But the font used is just ugly. How do...

Memory ReAllocation

What is the right and best way to reallocate memory? for example I allocate 100 bytes with WinAPI function HeapAlloc then I fill 100 bytes of that memory with some data and now I want to add more new data at end of previous... What Should I do? Make a new allocation with more bytes and then copy old+new to new location and free old memo...

Win32: No Window Appears

I was programming the example code from Frank Luna's book "Introduction to 3D Game Programming with DirectX 10". The code is the first Win32 example in the Appendix A: Windows Programming section. Right now, the program compiles under both VC++ 2008/2010, but no window appears, although the debug session has started and I have to forcef...

Java Speech recognition api

HI, i am currently developing an android application where i am required to implement speech recognition...could u suggest a link where i could find a java speech recognition API...? Thanks ...

List of Windows Native Functions for XP, VISTA and Windows 7

Hi, On the MSDN is there some sort of reference which details every native function inside the Windows API for different versions say from Windows XP upwards? I have been googling and looking round the MSDN but I must not be looking for the correct thing. Any help would be appreciated. Cheers, Andrew ...

How to encapsulate a WinAPI application into a C++ class

There is a simple WinAPI application. All it does currently is this: register a window class register a tray icon with a menu create a value in the registry in order to autostart and finally, it checks if it's unique using a mutex As I'm used to writing code mainly in C++, and no MFC is allowed, I'm forced to encapsulate this into C+...

Accessing and inheriting Windows Message for other Windows Message in Delphi

I am using WMSysCommand messages to modify Caption bar button ( Maximize / Minimize ) behaivor and recent update requiered to use WMNCHitTest, but I do not want to split these two related messages in multiplie procedures because of lengthy code. Can I access private declaration ( message ) from other message? And if I can - How to do it...

LsaOpenPolicy Access Denied on Windows 2003

When calling this API I'm sometimes getting an error 5 (Access Denied). I'm using a user with administrative privileges and is part of the Administrators group. The strange thing is that the problem occurs sometimes and then suddenly disappears. ...

In Windows, should I use CreateFile or fopen, portability aside?

What are the differences, and in what cases one or the other would prove superior in some way? ...

Why do ZeroMemory, etc. exist when there are memset, etc. already?

Why does ZeroMemory, and similar calls exist in the Windows API when there are memset and related calls in the C standard library already? Which ones should I call? I can guess the answer is "depends". On what? ...

C++ vector and struct problem win32

I have a structure defined in my header file: struct video { wchar_t* videoName; std::vector<wchar_t*> audio; std::vector<wchar_t*> subs; }; struct ret { std::vector<video*> videos; wchar_t* errMessage; }; struct params{ HWND form; wchar_t* cwd; wchar_t* disk; ret* returnData; }; When I try to add my video structure to a vecto...

Closing a window when it's "no longer needed".

This is kind of a hard question to describe, and I've searched for about an hour now to no avail. Essentially, picture a small 'flyout' window like the Windows 7 Wireless Control or the Volume Slider from the system tray(notification area). When you click on the icon, the application pops up with focus, and if you click off of it, the w...

Is there a such thing as a double right-click in Win32?

I haven't found anything mentioning a double right-click windows message but am curious if anybody knows of events that fire for a double right-click. Any ideas? ...