Open sancarn opened 10 months ago
Hi. I'm not used to github :|) so i don't know if this is the place to write. Did you ever get anywhere with the Hooking part of the stdWindow class?
Hi. I'm not used to github :|) so i don't know if this is the place to write. Did you ever get anywhere with the Hooking part of the stdWindow class?
Hi Adelina, not as yet, unfortunately this would require thunks, and I just don't have the time to put in the effort at the moment to get this working as desired.
Added HICON
and stdImage
:
Private Sub UserForm_Initialize()
With stdWindow.CreateFromIUnknown(Me)
Call .setOwnerHandle(0)
.HICON = stdWindow.CreateFromHwnd(Application.VBE.MainWindow.hWnd).HICON
.HICON = stdImage.CreateFromStdPicture(Image1.picture).HICON
.HICON = stdImage.CreateFromShape(Sheet1.Shapes("Picture 2")).HICON
.HICON = stdImage.CreateFromFile("C:\Users\sancarn\Pictures\yuumi.png").HICON
End With
End Sub
Tracker
Change window
owner
SetWindowLongPtr(GWL_HWNDPARENT, hwnd)
can be used to change the owner of a window. IfSetWindowLongPtr(GWL_HWNDPARENT,0)
is used the owner is affectively removed, and the window is treated as it's own "top level application" in a sense. Where asSetWindowLongPtr(GWL_HWNDPARENT, Application.hwnd)
will make the window only appear whenApplication
is also visible.Show menu bar buttons
Example:
Set icon of window
Enable addition and removal of window from TaskBar maybe more relevant for
stdCOM
...See https://www.mrexcel.com/board/threads/display-userform-in-taskbar-with-custom-icon-and-hide-excel-mimicking-a-standalone-application.1123368/page-2