I'm planning on creating a C# Windows Forms app as an extension for a third-party Win32 application but I'm stumped as to how to do this right now. The farthest I've gotten is knowing it involves Win32 Hooking and that there's this open source project called EasyHook that's supposed to allow me to do this.
I'd like to know how I can ge...
I am trying to find if there is a system color used here, so I can use the same value in my custom control. But I cannot find any reference, and none of these system colors sound right.
Is there a sys-color or constant I can use? Failing that, what's the RGB?
...
According to the WM_ENDESSION docs, when lParam is ENDSESSION_CLOSEAPP and wParam is FALSE, "the application should not shut down".
So, should I just ignore that and use the default response?
What is it's purpose?
(I'm listening to Windows events/messages in Qt (C++) to shutdown some launched processes, but that's just the context a...
I'm using the WinAPI to set the time zone on a Windows XP SP3 box. I'm reading the time zone information from the HKLM\Software\Microsoft\WindowsNT\Time Zones\<time zone name> key and then setting the time zone to the specified time zone.
I enumerate the keys under the Time Zones key, grab the TZI value and stuff it into a TIME_ZONE_IN...
It's tough to write a good title for this one.
I'm working on a WPF application which needs to know about the existence of all other open windows on the system. I'm able to do this by calling the native EnumWindows method just fine, and I can call other native methods to filter out just the windows I'm interested in. This works well.
T...
I'm trying to port some old Linux code to run on Windows and am running into a whole bunch of compiler errors that seem to be stemming from the considerable use of template classes. Are there really any significant differences between how templates must be implemented for linux vs MSVC? If so, could someone give an overview of what's a...
I've got window on a WinForm that I want to get the bitmap representation of.
For this, I use the following code (where codeEditor is the control I want a bitmap representation of):
public Bitmap GetBitmap( )
{
IntPtr srcDC = NativeMethods.GetDC( codeEditor.Handle ) ;
var bitmap = new Bitmap( codeEditor.Width, co...
I have a FileSystemWatcher instance running in the background of my PoSh session watching for changes to text files. A PoSh event subscriber is attached to this event and, when fired, it launches a console program by calling Start-Process. This program steals de focus from the current foreground window (my PoSh console). Calling SetForeg...
I am trying to show a progress bar while my process is going on...in my application there will be a situation where I gotta read files and manipulate them(it will take some time to complete)..want to display a progress bar during this operation..the particular function I am calling is an win 32 ...so if you check my code below ...I am ab...
I need to perform certain operations on a process started with ShellExecuteEx - like waiting for it, duplicating handles, querying and setting information etc. Now I am wondering if I can do all these things on the hProcess member which is returned in the SHELLEXECUTEINFO structure I pass to ShellExecuteEx. Does anybody know this?
Does...
I have the following template declaration:
template <typename T>
void IterTable(int& rIdx,
std::vector<double>& rVarVector,
const std::vector<T>& aTable,
const T aValue,
T aLowerBound = -(std::numer...
I'm seeing a strange problem when calling Win32 GDI Polyline() when printing out. On screen it all looks ok, however if printing it will stop the polyline when it encounters a large value. I think this discrepency is due to the scaling for printing yielding larger POINT values.
It appears as if the polyline stops drawing if it hits ...
I'm using WinApi.
Is SendMessage/PostMessage a good, thread safe method of communicating with the main window?
Suppose, the working thread is creating a bitmap, that must be displayed on the screen. The working thread allocates a bitmap, sends a message with a pointer to this bitmap and waits until GUI thread processes it (for example u...
The Windows API FindFirstFile() and FindFirstFileEx() accept wildcard characters for the path to search, "for example, an asterisk (*) or a question mark (?)". No where can I actually find an explanation of which others (if any) characters it accept, and more importantly what they mean in the context of FindFirstFile.
Can someone please...
Hi, I'm trying to create a fullscreen application using Win32 and OpenGL. I change the resolution using EnumDisplaySettings and ChangeDisplaySettings and the OpenGL functions work fine. On its WndProc I handle WM_ACTIVATEAPP and detect when the user switched focus to another window, then I minimize the application's window. When the wind...
Hi all,
I have two windows that I send scripted input to. The procedure goes as this
BringWindowToTop( window1 );
i = Build input structures( window1 );
SendInput(i);
BringWindowToTop( window2 );
i = Build input structures( window2 );
SendInput(i);
I was having trouble with inputs not being sent and the correct time. I put delays af...
On Win32, how can a C++ program determine how many threads are active in my program's process? Is there an API call?
...
I can't get this to work right. This should press left for 1 second then wait 10 seconds, then right 1 second, etc.:
keybd_event(0x25, 0xCB, 0, 0); // press left
cout << "Ldown\n"; // so i know it worked
Sleep(1000); // hold it for 1sec
keybd_event(0x25, 0xCB, KEYEVENTF_KEYUP, 0);// let go of the key
co...
Reading up on this, and specifically reading the Microsoft docs, it looks like it should be returning the number of PHYSICAL processors, and that you should use GetLogicalProcessorInformation to figure out how many LOGICAL processors you have.
Here's the doc I found on the SYSTEM_INFO structure: http://msdn.microsoft.com/en-us/library/m...
I am developing window application in that I am having 2 child windows on left and right side.
I want to handle input events for both windows separately.
How to achieve it?
My code:
class EditorWindow : public DxWindow
{
public:
CSplitterWindow m_vSplit;
CPaneContainer m_lPane;
CPaneContainer m_rPane;
PropertyDialog m...