![]() ![]() Retrieve it in the userform’s Initialize() event handler using the FindWindowA() function.The way I get a userform’s hWnd from within its own class module is: Option 1 – Get The hWnd From Within A Userform Class Module The red, “wrapper” window has a ThunderDFrame class (ThunderXFrame pre Excel 2000). When we talk about getting a userform’s hWnd, this is the window handle we’re looking for. If you use a tool such as Spy++ you’ll find that a bare userform is actually comprised of two windows: We quite often need the userform’s hWnd so we can use Windows API functions to give the userform features which aren’t available out-of-the-box – such as the minimize and maximize buttons illustrated on that other post. Today I’m going to look at getting the hWnd of a userform in more detail.Ī handle to a window is also called an hWnd. ![]() A necessary part of that process is to get the handle to the userform’s window, but the focus of that post was how to correctly declare the GetWindowLong() and SetWindowLong() API calls across 32-bit and 64-bit environments. In a previous post I wrote about how to add minimize and maximize buttons to a VBA userform. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |