Right now I'm using the functions GetCaretPos() and GetGUIThreadInfo() to get the current keyboard cursor/caret coordinates. These work properly in applications like Notepad and Wordpad and return the correct coordinates, but in applications such as Firefox, Thunderbird, and others, the coordinates returned are always 0, 0, no matter whe...
I was wondering if there are any differences - mostly performance wise - between the two Win32 API functions EnumProcesses() and CreateToolhelp32Snapshot() for enumerating all active processes and loaded modules. Or if one is better than the other to use and why.
...
Hi,
I got an old application which was written in a C++. I have 0 experience with it but I am suppose to make some changes in app. One of them is to change some text. Problem is that part of updated text needs to be bold, but i have no idea how to do that. I googled but with no much success. Only think I now is to go to new line with \n...
I'm not able to use GetAltTabInfo. Probably a stupid mistake but what's wrong with this?
HWND taskSwitcher = FindWindow(L"TaskSwitcherWnd", L"Task Switching");
ALTTABINFO altTabInfo = {};
altTabInfo.cbSize = sizeof(ALTTABINFO);
GetAltTabInfo(taskSwitcher, -1, &altTabInfo, NULL, 0);
I have verified that taskSwitcher is the task switchi...
Hello, Is it possible to do some operations with a window from other process having it's handle? What I would like to do is:
-remove window decoration
-move window to any position of the screen
-let window stay on top without making it modal
A link to a command line tool, script or C/C++ code snippet be great.
Thank you very much!
...
Scenario: In an Access project a main form has to be positioned and rearranged depending on the size of the Access-Application window. This should be done using VBA.
As far as I know there is no way in Microsoft Access VBA to capture the Restore/Maximize-Event of the Access-Application window (I refer to the Access Window itself not any...
I want to position a window at the bottom of the screen. If the start menu is present, I want it to lie along the top of the start menu. If it is not (or it is auto-hidden), I still want it to be in the same position as it would be if the start menu was there, meaning there will be a gap of a few pixels.
Currently I get the monitor work...
Please bare with me. I am learning how to make these DLLs properly. Hopefully my questions become more intelligent as I go.
I would like to make a Win32 DLL (unmanaged code) using Visual Studio 2008. After selecting New Project, in Project types -> Other Languages -> Visual C++ -> Win32 I selected Win32 Project as the project type. ...
How is should a HLOCAL data type be converted to a LPTSTR data type? I'm trying to get a code snippet from Microsoft working, and this is the only error, of which I'm not sure how to resolve:
// Create a HDEVINFO with all present devices.
hDevInfo = SetupDiGetClassDevs(NULL,
0, // Enumerator
0,
DIGCF_PRESENT | DIGCF_ALLCLAS...
Hello.
I need restriction for time changes coming from different sources.
The best way, as i think, is to hook WINAPI function SetSystemTime (and maybe SetLocalTime).
I tried to hook this by using EasyHook library with injection in all running processes, owned by current system user. But it had no effect.
How can I do that?
...
Hello,
I'm building an Authentication Package for Windows and I'm now just trying to make a skeleton for the package that I'm going to build.
The Package at some point in time will need to call MSV1_0 but the workflow of my authentication is forbidding me from implementing it as a SubAuthentication Package for MSV1_0.
Now, please exa...
Hi,
I was wondering if there is a way to add (programatically, of course) an icon/button/whatever besides plain text to a window (Microsoft Windows window...)'s title bar or next to where the minimize/maximize/close buttons are. I could draw it myself and create an illusion it is a part of the window, but I wonder if in the user32 api t...
Hello,
I want to extend an open/save dialog with a "drop-box" which should look like a TPanel (bevel). The code is already there - I use CreateWindowEx() with WNDCLASS name "Edit".
I have searched for a solution to draw a TPanel (resp. a beveled STATIC) with pure WinAPI, but did not found anything.
MS Spy++ tells me that a TPanel has ...
I wish to securely delete (not even a trace in memory) anything that user types into a textbox. I wonder if setting it to "" is secure enough.
SetWindowText is a function in Win32 API, in user32.dll.
In the program:
SetWindowText(myHandle, "Hello");
SetWindowText(myHandle, "Goodbye");
//Was the buffer containing chars "Hello" overwrit...
Greetings,
I feel kinda stupid for asking this, but I want to set the windows sdk build environment so that any process (including some non MS developer tools) can access the correct setup, without me trying to inject setenv.cmd /x86 into every process's startup.
I can't seem to find the right search terms for this, and I don't want t...
I'm writing a WPF program in C# that needs to render a set of files in a file browser to the end user. The ExplorerBrowser control found inside the Microsoft Windows API CodePack contains much of the functionality I need... e.g. thumbnails of different sizes, sorting, browsing, etc...
The catch is that the files are not coming from t...
I have a native C++ ATL in-proc COM server. A separate test program
calls CoInitialize(),
calls CoCreateInstance(), then
calls Release() on the pointer,
then calls CoUnitialize() and exits.
If I run the test program under Visual C++ debugger the debug CRT reports a single memory leak and each time the allocation number is the same.
...
Hi All,
Today I ran into the ExplorerBrowser from the Windows API Code Pack... This looks like a fantastic control to use as a Explorer like control in my application.. However, I am trying to modify the Commands toolbar, which is located on the top of the ExplorerBrowser control. I have noticed I have some control..I can Hide the Comma...
I have a system with two HID keyboards (actually, one's a barcode scanner.)
I registered for raw input with RIDEV_NOLEGACY to block the system from creating WM_KEY* messages for the barcode scanner, which tediously also blocks the messages from the other keyboard.
My goal is to keep the WM_* messages for any keybaord device that isn't ...
I have a win32 app which uses DialogBox() to display its main window.
I now want to start this app up with the dialog box invisible, and later set it visible with
SetWindowPos(hDlg, HWND_TOPMOST, ...
Unfortunately
http://msdn.microsoft.com/en-us/library/ms645452(VS.85).aspx
The function displays the dialog box (regardless of wh...