Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdWindow #24

Open
47 of 56 tasks
sancarn opened this issue Mar 24, 2021 · 2 comments
Open
47 of 56 tasks

stdWindow #24

sancarn opened this issue Mar 24, 2021 · 2 comments
Labels
enhancement New feature or request lib-stdWindow megathread Many bundled feature requests for an individual class
Projects

Comments

@sancarn
Copy link
Owner

sancarn commented Mar 24, 2021

stdWindow

A class for creating and obtaining window objects, and extracting/controlling properties of them.

Constructors

  • Create(sClassName,sCaption,dwStyle, x, y, Width, Height, hWndParent, hMenu, hInstance, lpParam) as stdWindow
  • CreateHighlightRect(x, y, Width, Height, BorderWidth, BorderColor) as stdWindow
  • CreateFromDesktop() as stdWindow
  • CreateFromHwnd(hwnd) as stdWindow
  • CreateFromPoint(x, y) as stdWindow
  • CreateFromEvent() as stdWindow
  • CreateFromIUnknown(obj) as stdWindow
  • CreateFromContextMenu() as stdWindow 'Class == "#32768"
  • CreateFromShellWindows() as Collection i.e. shell.application.windows. See stdWindow - shell windows #22

Properties

  • Get handle() as LongPtr
  • Get hDC() as LongPtr
  • Get Exists as Boolean
  • Get/Let Visible() as Boolean
  • Get/Let State() as EWndState 'Normal,Minimised,Maximised
  • Get IsFrozen() as Boolean
  • Get/Let Caption() as string
  • Get Class() as string
  • Get RectClient() as Long()
  • Get/Let RectWindow() as Long()
  • Get/Let X() as Long
  • Get/Let Y() as Long
  • Get/Let Width() as Long
  • Get/Let Height() as Long
  • Get ProcessID() as long
  • Get ProcessName() as string
  • Get/Set Parent() as stdWindow
  • Get AncestralRoot() as stdWindow
  • Get/Let Style() as Long
  • Get/Let StyleEx() as Long
  • Get/Let UserData() as LongPtr
  • Get/Let WndProc() as LongPtr
  • Get/Let Resizable() as Boolean
  • Get Children() as Collection
  • Get Descendents() as Collection
  • Get ThreadID() as Long
  • Get/Let AlwaysOnTop
  • Get HTMLObject as Object Removed feature requirement, RE: IE deprecation.
  • stdWindow - Improvements  #86 Add to taskbar

Methods

  • SetHook(idHook, hook, hInstance, dwThreadID) as LongPtr
  • AttatchThread(wnd as stdWindow, bAttatch as boolean)
  • Redraw()
  • SendMessage(wMsg, wParam, lParam)
  • PostMessage(wMsg, wParam, lParam)
  • SendMessageTimeout(wMsg, wParam, lParam, TimeoutMilliseconds)
  • ClickInput(x?, y?, Button?)
  • ClickEvent(x?, y?, Button?, isDoubleClick?, wParam?)
  • SendKeysInput(sKeys, bRaw?, keyDelay?)
  • SendKeysEvent(sKeys, bRaw?, keyDelay?)
  • Activate()
  • Close()
  • FindFirst(query)
  • FindAll(query)
  • Screenshot() Removed requirement, see stdImage

General

  • Unit Tests
  • Documentation
  • Mac compatibility
@sancarn sancarn added the enhancement New feature or request label Mar 24, 2021
@sancarn sancarn added this to READY in Roadmap Mar 24, 2021
@sancarn sancarn added the megathread Many bundled feature requests for an individual class label Mar 24, 2021
@sancarn sancarn changed the title [Megathread] stdWindow stdWindow Mar 24, 2021
@sancarn
Copy link
Owner Author

sancarn commented Mar 26, 2021

Activate needs to follow this kind of structure:

'Force the window specified by the hWND supplied to the top/front
'@param {ByVal Long} hWND of window to make active
Private Sub ForceWindowToTop(ByVal hwnd As Long)
    Dim lMyPId As Long
    Dim lCurPId As Long
    Dim Handle As Long
    Handle = GetForegroundWindow()
    lMyPId = GetWindowThreadProcessId(hwnd, 0)
    lCurPId = GetWindowThreadProcessId(Handle, 0)
    
    If Not (lMyPId = lCurPId) Then
        AttachThreadInput lCurPId, lMyPId, True
        SetForegroundWindow hwnd
        AttachThreadInput lCurPId, lMyPId, False
    End If
    
    If Not (GetForegroundWindow() = hwnd) Then
        SetForegroundWindow hwnd
    End If
End Sub

@sancarn
Copy link
Owner Author

sancarn commented Jun 2, 2024

Fixed SendKeysInput()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lib-stdWindow megathread Many bundled feature requests for an individual class
Projects
Status: READY
Roadmap
  
READY
Development

No branches or pull requests

1 participant