hwnd

What is the lifetime of a CWnd obtained from CWnd::FromHandle?

According to msdn, when I get a CWnd* with CWnd::FromHandle, The pointer may be temporary and should not be stored for later use. What is meant by "later use" is not clear to me. Is it only the scope of the current method? As far as I know, there is no GC in Win32! ...

Converting HWND object to other object type

I want HWND object to be converted to my user defined object..may i know how can i archive this? Below is my sample code : File1.cpp { XYZ(*this); } File2.cpp { XYZ(HWND hwnd) { // Here i want to access instance of File1.So can i type cast the HWND object } } } ...

WPF Memory Leak on XP (CMilChannel, HWND)

My WPF application leaks memory at about 4kb/s. The memory usage in Task Manager climbs constantly until the application crashes with an "Out of Memory" exception. By doing my own research I have found that the problem is discussed here: http://stackoverflow.com/questions/801589/track-down-memory-leak-in-wpf and #8 here: http://blogs.ms...

Is HWND visible?

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? ...

How often are windows handles reused

I note an applications handle when I use the shell function to open it. I then use that handle to close the application later. However the user can also close that other application himself. Can that handle then be reused by windows so that when I use that handle I close a different process. If it is possible is it likely? ...

Global hotkey with WIN32 API?

I've been able to set local hotkeys like this RegisterHotKey(hwndDlg, 100, MOD_ALT | MOD_CONTROL, 'S'); how can I set the hotkey to be global?( I want it to be there even when my window is hidden) ...

How can I know which item in a mult-select Microsoft Access listbox was clicked?

Hello, I have a listbox in a Microsoft Access form. The MultiSelect property is set to simple. I want to know which item in the listbox was clicked. Keep in mind that an item may be clicked to SELECT or UNSELECT an item. Is there a simple way to do this? If not is there a complicated way to do this? I tried to use the SendMessa...

Get HWND of containing IE window from toolbar

Hello, I'm developing a toolbar for IE, and I need my toolbar to be able to get the HWND of the containing IE window. It needs to be accurate so that multiple tabs in the same window will all return the same HWND, but different from another IE window. What would be the best way about this? I should be able to do this: MessageBox.Show(P...

How would i make another application's child window into a tab? (C#)

For instance, I have an application that has a main window and then child windows inside of it. http://screenshots.rd.to/sn/e3hek/sapienfullwindow.png http://screenshots.rd.to/sn/e3hek/appscreen8.png What i need is to grab each individual child window of that application, and display them as tabs in my application, or on a panel's handle...

Getting HWND from firefox

I am writing an extension for Firefox, and I need to find out the window's HWND. I can't enumerate running processes or anything like that, as it needs to be able to handle multiple instances and tell one from the other. Is there a way of doing this via a javascript extension in Firefox? ...

Creating a Win32 Window app with English title bar, but the title bar becomes Chinese out of nowhere. How come?

HWND wndHandle; //global variable // code snipped WNDCLASSEX wcex; // code snipped wcex.lpszClassName = (LPCWSTR) "MyTitleName"; // code snipped wndHandle = CreateWindow( (LPCWSTR)"MyTitleName", //the window class to use (LPCWSTR)"MyTitleName", //the title bar text ... ... I am following a tutoria...

Mouse events aren't working in embed browser

Hello folks, i'm making an Itunes plugin with an embed browser attached to it. I can see it, and it works perfectly, but it can't receive mouse inputs! I think that itunes is getting all the inputs for it... anyone knows a way to solve this? ...

Get hWnd of the current window/form in VB6?

Ho do I get hWnd of the current window/form in VB6? ...

Display an Adorner over a WebBrowser control

I'm using the System.Windows.Controls.WebBrowser for various things in my app and I've noticed that adorners are cut off when they are supposed to appear over a WebBrowser. I realize that the WebBrowser control is really a wrapper around a COM component and probably renders differently, but I wondered if anyone figured out how to solve ...

WPF rendering problem with HWND children in the way

I suppose it is safe to say that WPF renders its contents as a window background. There are no child windows in a traditional HWND sense. So, when one introduces something HWND based in a WPF app, like a WebBrowser, things start to go wrong way it terms of visual appearance. Consider a Window having a Grid with two children, WebBrowser ...

How do I clear a Direct2D render target to fully transparent

Hi all, I'm trying to draw semi-transparent rectangles on an invisible HWND. However, clearing the window with ID2D1HwndRenderTarget::Clear just makes the entire window black, so when I draw rectangles on top, they look semi-black. If I don't Clear() and don't draw, then the window is invisible, as it should be. Clear() is the culprit ...

Direct2D window black when not in focus

Hi all, I have a Direct2D window which paints fine when in focus; however, when focus moves to another window (same application or another), the entire window goes black. I pinned the issue down to the use of ID2D1HwndRenderTarget::Clear. This function is vital to my application as without it, painting becomes rather... weird. Is there...

Drawing problem does ShowWindow(hWnd, SW_HIDE) automatically invalidate rectangles?

Hello, I'm running into a problem where, I have a Window that contains a child window. The child window contains another child window where a video is playing using Windows Media Player. Whenever I do call ShowWindow (hWnd, SW_HIDE) on the parent Window and paint over the entire surface, the region occupied by the grand-child window (whe...

How to change the toolbar button's Bitmap in win32 ?

Hi all! I have created a toolbar with some controls on it using ReBar within a window. Can anyone please tell me, How to get the HWND of a buttons/combobox/etc (not normal buttons in a window) if I know (only) the Id of it ? How to obtain the HBITMAP if I know the id of the resource ? How to set the bitmap to the controller ? Send...

Managed form as child of unmanaged HWND

I need to show my System.Windows.Forms.Form as a child window of an unmanaged C++ HWND. This is the C# SDK code that retrieves the NativeWindow: public static NativeWindow MainWindow() { Diagnostics.Process process = Diagnostics.Process.GetCurrentProcess(); if (null == process) return null; IntPtr handle = process.MainWindowHa...