Windows messages seems a good way to notify an application on Windows OSes. It actually works well, but few question comes up to my mind:
How to specify structured data to the lparam of the SendMessage routines (like many message codes does)? I mean... of course the parameter is a pointer, but how the process access to it? Maybe is it a...
I have run into a weird necessity to make a certain window in the system of a really big height, one that is larger than my display's resolution. I have written a simple WinAPI program that sets a window size by calling SetWindowPos and I have encountered that if the height is greater than current display's resolution, then it is simply ...
Is there a windows api to detect whether or not my dll is running in a system service or a normal user process?
Previously I was looking at the current username and ignoring "SYSTEM", "LOCAL SERVICE" and "NETWORK SERVICE". But now I am seeing GetUsername return machine_name$ in cases where svchost gets run in certain situations befor...
I'm writing an unmanaged Win32 C++ function that gets a handle to a bitmap, and I need to draw on it.
My problem is that to draw I need to get a device context, but when I do GetDC (NULL), it gives me a device context for the WINDOW! The parameter for GetDC () is a window handle (HWND), but I don't have a window; just a bitmap handle.
...
Hi,
Currently I'm building an application that is an image filter that should run in real-time. It's filter that transforms image captured from the camera and displays a transformed image just like the camera preview does.
The problem that I'm having with this is that, the performance is critical to this app, as every captured pixel sh...
There are cases when one needs to start a process based on some events not involving activity of the mouse of keyboard (from hardware or time-based). It works with ShellExecute and ShellExecuteEx generally, but if there's a full-screen app (the one, created borderless with exactly the dimensions of the screen), this launched application ...
Is there a way to programmaticly get the failed logon count for local Windows users in XP and later? Alternatively, is there a way for my service to get a message when a failed logon occurs? Currently coding in VB.NET, but will take any suggestions in any language. Thanks for your time.
...
I have a hidden process that waits for non-standard hardware button messages and runs an application (with CreateProcess). No problem with the user disturbing, it's an action that the user approved himself. Everything is fine when it's usual layout with taskbar shown and multiply captioned and non captioned- windows. But the situation is...
In a dialog template I placed a ListBox, since checked list box is not shown in the visual layout options. I set it to owner-draw and set it up with DDX, changing the associated class variable from type CListBox to CCheckListBox - in other words the only changes I make from what the wizard does for me are set owner-draw, and chnage the m...
I've not been able to find this out, which seems weird. When I add a class variable for the control using the wizard, it wants to add a CButton. Is there a specific control or does one of the basic ones provide this function?
...
I have two executables in C#, lets call them executable A and B, both of them have one form. Executable A gets the MainWindowHandle of B and then calls SetParent(this.Handle, B.MainWindowHandle). How can I set the form of executable B to be a Modal so that the form of executable A wont receive input unless I close the form B. Something l...
Hello all, I want to copy a single file, fairly large (+100MB) using CreateFile(), ReadFile(), and WriteFile().
My program successfully copied text file and other small file (in the range of KBs), but when I wanted to copy a 160 single .EXE file, it crashed and the debugger said "Stack overflow"
...
http://www.adp-gmbh.ch/win/com/bho.html
When I compile, I get lots of errors:
error C2236: unexpected 'class' 'adpbho'. Did you forget a ';'?
error C3381: 'adpbho' : assembly access specifiers are only available in code compiled with a /clr option
..\adpbho.cpp(15) : error C3861: 'MB1': identifier not found
..\adpbho.cpp(24) : error C...
When developing a Win32 Application (non-console application) in Visual Studio 2005, is there any way to get the same sort of output as you do from the console?
For instance, say I want to see log statements (such as I would with cout in a console application) to trace the path my program has taken in the code.
My first thought would b...
We have a requirement that a user can load any standard image into a dialog, the image is displayed, and the image saved as a specific format (JPG) in a database. It seems CImage is the class to be using since it can load and save BMP/GIF/JPG/PNG. But is there an easy way to save the JPG as a BLOB in the database without calling CImage::...
Consider a plain Win32 dialog with listview control (in report mode) written in C++. Upon a certain event all items and all columns are deleted and new columns and items are created. Basically, as content changes, columns are automatically generated based on content.
When old items/columns are removed and new ones added, listview flicke...
I have an app where I use a notifyicon to show some balloon tips. However, it will be running in an environment where there is always a separate main app running in full-screen mode. My problem is making the taskbar come to front - I thought it would automatically when there are balloon tips appearing on the notifyicon in the system tray...
I am generating a pdf for a client. This has two columns ... ID and a blank column for the end user to put in some character. I want the client to be able to upload a bmp/jpg/tif whatever (i can specify) image of the printed pdf with its two columns and turn it into a csv/tab/whatever file with the values of the two columns. Can anyone r...
I need to attach a transparent, layered window to any application window present in the system, with the added feature of the user not losing the keyboard focus.
So I went with the owner method: use GetWindowLongPtr with GWLP_HWNDPARENT and tracking the owner movement with a simple out of context hook (SetWinEventHook).
Also, using WS_...
Most of the Win32 main loops I've seen are all structured like:
while (GetMessage(&message, NULL, 0, 0) > 0) {
TranslateMessage(&message);
DispatchMessage(&message);
}
It was pointed out to me that MsgWaitForMultipleObjects may be used to add some variety to a main loop. But is there a scenario where doing something between GetMes...