winapi

Scrollbar moves back after WM_VSCROLL

I have a window with its own H and V scrolling. I'm handling the event like this: case WM_VSCROLL: SetScrollPos(hWnd, SB_VERT, (int)HIWORD(wParam), TRUE); break; all I want is for the position of the scroll bar to stay once I release my mouse but what it's doing is just going back to the top after. What am I doing wr...

WPF HwndHost keyboard focus

The chart area in the screenshot is a HwndHost control which hosts a native Win32 window (with it's own registered WNDCLASS) implemented in C++/CLI and drawn with Direct2D. The HwndHost is hosted in a WPF Border control. The problem I have is that I can't set the keyboard focus to the hosted Win32 window. I want the focus to move to the...

Screen capture code produces black bitmap

I need to add the ability to take a screenshot of the entire screen, not just the current window. The following code produces a bmp file with the correct dimensions, but the image is completely black. What am I doing wrong? void CaptureScreen(LPCTSTR lpszFilePathName) { BITMAPFILEHEADER bmfHeader; BITMAPINFO ...

windows beneath not being painted when using a layered window

Hi, I will try to explain my problem the best i can, I'm creating a layered window in c++ (using windowsXP), all works fine until i drag my created window near the windows start button, and then when i press the star button of windows taskbar and close it again all the windows beneath of my layered window aren't being painted (only in ...

Changing windows Xp appearance or theme programatically

The company I work for has windows xp installed and under group policy, I am not able to change the desktop appearnce or themes. Because admin has disabled the appearance and themes tab via group policy registry. I am looking for an application or Vb.net form which is able to switch the appearance and themes under limited access xp accou...

Handle window's scroll bar's mouse move (WinAPI)

I have a window that has scroll bar styles so it has its own scrollbars. I want something to happen when the mouse hovers over the scroll bars, but handling the window's mouse move doesn't do the trick. How can I handle the scrollbars' mousemove event? Thanks ...

Why can't I pass an argument to create this window using wxpython?

I am trying to learn how to make a GUI in python! Following an online tutorial, I found that the following code 'works' in creating an empty window: import wx from sys import argv class bucky(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, 'Frame aka window', size=(300, 200)) if __name__=='__...

Creating a menustrip in WinAPI?

Is there a way to get a menustrip instead of an HMENU when using the WinAPI? Like menus that .Net applications use? Because the HMENU just doesn't fit my color scheme, I need a darker menu. Thanks ...

reference other projects in visual studio for win32 projects

Hi All I am working with win32 API and my language of choice is pure C and no C++. Assume I have a project A that is present in Solution S in visual studio I want to add another project B(which has some common utility functions) in to S Now I want to reference Project B in Project A... So that I can use those utility functions from ...

Is RegSetValueEx thread safe?

I suspect that RegSetValueEx is thread safe, but would like some confirmation from the community. If called from multiple threads, will there be any side effects? The RegSetValueEx MSDN documentation doesn't mention thread safety at all. ...

Launching an external application from within a NPAPI Plugin

I am trying to work out why an NPAPI plugin I have written, which works fine in terms of performing operations triggered via Javascipt calls, cannot use CreateProcess() or ShellExecute() to launch an application from a path specified via the Javascript call. I can seemingly use either of these methods and they return success, i.e. no e...

C++ Draw things on riched32.dll

Hi! I'm using riched32.dll to display and edit rich text. now I would like to draw some custom markings to the text, like for example the red underline in office word displaying wrong spelling. or text marking boxes with rounded corners or something like this. Of course those markings should scroll properly with the text. How can I do ...

Procedure entry point InitializeConditionVariable could not be located in kernel32.dll

I am running producer consumer problem( using windows thread ).It compiling successfully but on running it showing following error The procedure entry point InitializeConditionVariable could not located in the dynamic library Kernel32.dll. can u tell what would be reason ...

Set size of scroll thumb?

I'v looked on MSDN and can't find how to do this. It lets me set the range and position but not the thumb that the user clicks and drags. Thanks ...

Windows Filesystem Minifilter Drivers: can I monitor and prevent FS operations using them?

I need to: 1. Monitor operations on certain drives/paths 2. Prevent read and/or write operations on certain drives/paths For example: C://Users D: Can this be done using Windows Filesystem Minifilter Drivers ? I am mostly interested in step 2. In other words can a minifilter cancel a IRP ? ...

How to delete ProgIDs from other user accounts when uninstalling from Windows?

I've been investigating "how should a modern windows c++ application register its file types" with Windows (see http://stackoverflow.com/questions/2828637/c-how-do-i-correctly-register-and-unregister-file-type-associations-for-our-ap). And having combed through the various MSDN articles on the subject, the summary appears to be as follo...

Why peekmessage before getmessage?

Why the peekMessage statement is required before Getmessage() for creating message queue? ...

what is the win32 alternative to the Unix daemon() subroutine?

I have to call several (> 10) .exe command line programs in the background. Creating a Windows Services doesn't sound very appealling in this context - c'mon, that's a bit overpowered for such a simple task. Is there anything like a daemon(3) subroutine for Windows? ...

Using a class callback for a custom control?

I'm creating a custom control class and since I want complete control of it, I register the class and want to use the class's LRESULT CALLBACK OGLTOOLBAR::ToolProc(HWND, UINT, WPARAM, LPARAM) but it's not letting me. I'm doing: HWND OGLTOOLBAR::create(HWND parent,HINSTANCE hInst, int *toolWidthPtr) { if (toolhWnd != NULL) ...

SHBrowseForFolder and shortcuts

In my C++ Windows application, I have a function that is supposed to allow the end-user select a folder. I'm using SHBrowseForFolder and it is working fine except that folder shortcuts are not being displayed in the dialog. Does anyone know if it is possible to configure SHBrowseForFolder so that the end-users will be able to navigate f...