hwnd

Loading a window texture from a HWND into an OpenGL texture

六眼飞鱼酱① 提交于 2019-12-10 10:36:23
问题 So what I'm trying to accomplish is getting a handle to a window by name (e.g. Slack) and copying that windows pixel information into an OpenGL texture. I've been basically learning C++ and OpenGL as I've been trying to accomplish this. Before this I had mostly worked with Java. I managed to load a picture of a cute kitten into a texture and display that on a quad. I've also found a HWND handle to a specific window. The problem I have is loading the pixel information from the window and

How to get WNDCLASS from HWND?

只谈情不闲聊 提交于 2019-12-10 09:44:15
问题 I'm working now with playground SDK and need to get WNDCLASS of my game window. I haven't found anything in SDK, thats why I'm trying to do this with hWnd of game window. So is there any way to get WNDCLASS from HWND? I need this to change system cursor in game window 回答1: I don't know about the SDK in question, but as long as it provides access to the native HWND type, you can use native calls. To change the cursor for all windows of that class: Use the SetClassLongPtr function:

hwnd to ppm issue

Deadly 提交于 2019-12-08 13:09:50
问题 I have a function which save a hwnd into a ppm file. This function is inspired by a msdn example. Both the msdn sample and my function work but ... I have an issue ... But first, here is the function. int CaptureAnImage(HWND hWnd) { HDC hdcWindow; HDC hdcMemDC = NULL; HBITMAP hbmScreen = NULL; RECT rc; BITMAPINFOHEADER bi; DWORD dwBmpSize; HANDLE hDIB; char *lpbitmap; int w, h; FILE *f; // Retrieve the handle to a display device context for the client // area of the window. hdcWindow = GetDC

C# HwndSource from Process.MainWindowHandle

╄→尐↘猪︶ㄣ 提交于 2019-12-08 07:26:18
问题 I am trying to "hook" in to the messages of a window to detect a minimize/maximize. I've looked around, and think that the only/best solution to do this, is to hook into the messages of a window, and check for the WM_WINDOWPOSCHANGED message, and then check it's status. I've run into a problem. System.Windows.Interop.HwndSource source = System.Windows.Interop.HwndSource.FromHwnd(System.Diagnostics.Process.GetProcessesByName("notepad")[0].MainWindowHandle); System.Windows.Interop

WindowsFromDc return null

纵饮孤独 提交于 2019-12-07 11:09:00
问题 I need some help about the win32 api and especially WindowsFromDc. I have a application which hook a another application. This two application communicate by a NamedPipe. In the second application, I have hook the DrawTextExW function and I get a HDC from this function. But when I do a WindowsFromDC with the DC returned by the DrawTextEx function, i got a null return. So, I have some question about that : -Is it possible a HDC don't have a HDWN with ? -How I can get the HWND of the window

C# show hidden window

旧城冷巷雨未停 提交于 2019-12-06 08:28:24
问题 I am developing an add in for excel. At some point, I can receive async events. I need to be able to show the Excel window if hidden on these events. I am able to store the Hwnd property, which I believe must be an immutable int/reference to identify my Excel window. Can someone elaborate on this Hwnd ? and explain how I can show a hidden window from C# using it ? Thanks in advance folks ;) UPDATE : shortly, that was the piece of code that sorted my problems : /// <summary>Enumeration of the

Discover hWnd where mouse is

一个人想着一个人 提交于 2019-12-06 05:53:04
A long time ago I remember using a program where I just moved my mouse around the screen and it displayed the hWnd information (and some other stuff) of the window (and parent, and child) to where you were pointing your mouse. Does anyone know of something like this? I cant find it anymore. (btw this is windows 7) Edited : it's not yet any of these, but Winspector seems to do what I want. I remember that it was done by a guy that was a master in window Subclassing in the VB5/6 days Windowse is free, lightweight and great. I use it anytime I don't have an explicit need for the extra

I want to disable the shadow effect on a specific aero window

时间秒杀一切 提交于 2019-12-06 05:24:57
问题 I want to disable the shadow effect on a specific aero window. All I have is the HWND of this window, is this possible? 回答1: The shadow is defined by the theme currently used by the OS. You cannot disable it for one window only. You can change the theme and disable shadows, but it will be a system-wide change, not specific to one window. In your case, one of the best approached would be creating your own window structure (starting from a borderless window) that will have similar transparency

WindowsFromDc return null

别等时光非礼了梦想. 提交于 2019-12-05 18:13:47
I need some help about the win32 api and especially WindowsFromDc. I have a application which hook a another application. This two application communicate by a NamedPipe. In the second application, I have hook the DrawTextExW function and I get a HDC from this function. But when I do a WindowsFromDC with the DC returned by the DrawTextEx function, i got a null return. So, I have some question about that : -Is it possible a HDC don't have a HDWN with ? -How I can get the HWND of the window which call DrawTextEx ? There are other way do to that ? Thank you. Ps : Sorry for my bad english...

Is HWND visible?

落花浮王杯 提交于 2019-12-05 10:14:51
Those darned users and their minimized windows. In C#, if I have a window's HWND, is there a way to tell if it is visible on the desktop? The GetWindowPlacement function returns a WINDOWPLACEMENT structure which has a field showCmd : Specifies the current show state of the window. The details of this read as though you would be setting the window state, but I suspect that this is because they've been copied from somewhere else and not updated. There's the Visible property, but that checks the visible flag, it doesn't tell you whether the window is being covered by another window, or off the