Getting the handle of a window?

Just starting out? Need help? Post your questions and find answers here.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Getting the handle of a window?

Post by dagcrack »

I got the handle of the winamp window using Spy++ tool from VC++.
handle is 00BF0236.

What I need is to find the position and size of that window, I've seen all this on Spy++ also, and thats what I need tho. so far I got the window data, but now?..
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Messing a bit with commands I got this so far:

Code: Select all


decimalized = HexToDec_("00BF0236")
Debug Str(decimalized)

Is that the decimal handle of the window then? :D
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

But I'm getting a real long handle which is more than 5000 (12517942) is that ok? :?
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Check this out :

viewtopic.php?t=10622

Use that to get the handle..
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

damn.. its the real handle! tested with

CloseWindow_(decimalized)

and the winamp window minimized... cool, I got the handle then.

I still dont imagine how to get its co-ords and size but I think I coudl manage that if I research a bit.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

lo Karbon, thx for your reply. I'll be reading it. but I got the real handle anyway with the source I posted. its the real handle as the window minimized using closewindow_() command. so I guess im not wrong so far.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

I wonder though - will that handle always be the same every time Winamp is started?
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

I think Window handles are assigned by windows when they get launched...

(or not) :wink:
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Hope it isnt a random one.. im checking now tho!

/me closes winamp
/me opens winamp
/me tests script

Dammit! it's a random one! .. now im doomed.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

I'm just.. doomed.. Winamp caption is always random as its the name of the mp3 playing... the handle changes everytime you open it.. then how im supossed to get the size and position data from winamp ? (I have 2.91 version tho, not newer ones as I found them IDIOTIC MEMORY AND PROCESS WASTERS)
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

I wonder if there is a way to detect what windows are owned by a certain process? Then you could look for the window(s) owned by the winamp exe..

Just an idea, I have no clue how to do it or if it's possible..
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

I have no idea..
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

...,

want to learn more about windows and how to get handles and other information ?

Play first with the following code and launch Winamp. Then come back with more questions if required ....

:lol:

Code: Select all

#GWW_HINSTANCE = -6

EOL.s

Global EOL

Procedure EnumChildProc(hwnd.l, lParam.l)
    sSave.s = Space(GetWindowTextLength_(hwnd) + 1)
    GetWindowText_(hwnd, sSave, Len(sSave))
    sSave = Left(sSave, Len(sSave))
    If sSave <> ""
        Debug "  => Name = " + sSave
    EndIf
    ProcedureReturn #TRUE
EndProcedure

Procedure EnumWindowsProc(hwnd.l, lParam.l)
    Ret.l = GetWindowTextLength_(hwnd)
    sSave.s = Space(Ret)
    GetWindowText_(hwnd, sSave, Ret + 1)
    Debug "Window  " + "Handle = " + Str(hwnd) + " Name = " + sSave
    EnumChildProc(hwnd, lParam)
    ProcedureReturn #True
EndProcedure

Procedure EnumDesktopProc(lpszDesktop.l, lParam.l)
    Buffer.s = PeekS(lpszDesktop)
    Debug "Desktop  " + Buffer
    ProcedureReturn #True
EndProcedure

;
; Main starts here
;

CursorPosition.POINT

  EOL = Chr(13) + Chr(10)
  
  Debug "Windows"
  EnumWindows_(@EnumWindowsProc(), 0)
  
  Debug "Desktops"
  EnumDesktops_(GetProcessWindowStation_(), @EnumDesktopProc(), 0)
  
  WindowXSize = GetSystemMetrics_(#SM_CXSCREEN) / 2
  WindowYSize = GetSystemMetrics_(#SM_CYSCREEN) / 2
  FontID = LoadFont(0, "Verdana", 7)
  ImageFlag = #FALSE


  hDebugOutput = FindWindow_("DebugOutput", "PureBasic - Debug Output")
  hListBoxDebugOutput = GetWindow_(hDebugOutput, #GW_CHILD)
  Style = GetWindowLong_(hListBoxDebugOutput, #GWL_STYLE)
  newStyle = Style | #WS_HSCROLL
  SetWindowLong_(hListBoxDebugOutput, #GWL_STYLE, newStyle)

  If OpenWindow(0, 0, 0, WindowXSize, WindowYSize, #PB_Window_ScreenCentered | #PB_Window_Borderless, "MyWindow")
      AddKeyboardShortcut(0, #PB_Shortcut_Left, 21)
      AddKeyboardShortcut(0, #PB_Shortcut_Right, 22)
      AddKeyboardShortcut(0, #PB_Shortcut_Up, 23)
      AddKeyboardShortcut(0, #PB_Shortcut_Down, 24)
      AddKeyboardShortcut(0, #PB_Shortcut_F2, 26)
      AddKeyboardShortcut(0, #PB_Shortcut_Escape, 99)
      
      If CreateGadgetList(WindowID())
          ListIconGadget(100, 10, 200, 120, 120, "toto", 120)
      EndIf
      
      StartDrawing(WindowOutput())
        Box(0, 0, WindowXSize, WindowYSize, $400000)
        DrawingFont(FontID)
      StopDrawing()
      
      Quit = #FALSE
      
      Repeat
        Select WindowEvent()
          Case #PB_Event_CloseWindow
            Quit = #TRUE
          Case #PB_Event_Menu
            Select EventMenuID()
              Case 21
                CursorSpeed + 1
                CursorPosition\x - CursorSpeed
                SetCursorPos_(CursorPosition\x, CursorPosition\y)
                CursorTimer = GetTickCount_()
              Case 22
                CursorSpeed + 1
                CursorPosition\x + CursorSpeed
                SetCursorPos_(CursorPosition\x, CursorPosition\y)
                CursorTimer = GetTickCount_()
              Case 23
                CursorSpeed + 1
                CursorPosition\y - CursorSpeed
                SetCursorPos_(CursorPosition\x, CursorPosition\y)
                CursorTimer = GetTickCount_()
              Case 24
                CursorSpeed + 1
                CursorPosition\y + CursorSpeed
                SetCursorPos_(CursorPosition\x, CursorPosition\y)
                CursorTimer = GetTickCount_()
              Case 26
                ImageFlag = 1 - ImageFlag
                RepaintFlag = #TRUE
              Case 99
                Quit = #TRUE
            EndSelect
          Case #WM_LBUTTONDOWN
            Debug "Left button pushed while in the CA"
            ReleaseCapture_()
            SendMessage_(WindowID(), #WM_NCLBUTTONDOWN, #HTCAPTION, 0)
          Case #WM_PAINT
            RepaintFlag = #TRUE
          Case #WM_MOVE
            RepaintFlag = #TRUE
        EndSelect
        
        GetCapture = GetCapture_()
        GetCursorPos_(@CurrentPoint.POiNT)
        WindowFromPoint = WindowFromPoint_(CurrentPoint\x, CurrentPoint\y)
        
        If GetCapture <> OldGetCapture
            Debug "GetCapture = " + Str(GetCapture)
            OldGetCapture = GetCapture
        EndIf
        
        If WindowFromPoint <> OldWindowFromPoint Or RepaintFlag
            RepaintFlag = #FALSE
            Debug "WindowFromPoint = " + Str(WindowFromPoint)
            OldWindowFromPoint = WindowFromPoint
            
            ClassName.s = Space(1000)
            GetClassName_(WindowFromPoint, @ClassName, 1000)
            Debug "Class name is : " + ClassName

            StartDrawing(WindowOutput())
              DrawingFont(FontID)
              Box(1, 1, WindowXSize, WindowYSize, $400000)
              DrawingMode(4)
              Box(0, 0, WindowXsize, WindowYsize, $FFFFFF)

              GetWindowRect_(WindowFromPoint, WindowRect.RECT)

              FrontColor(255, 255, 255)
              DrawingMode(1)
              X = 10
              Y = 10
  Debug "--------------------"
              Locate(X, Y) : Y + 10
              WindowText.s = Space(255)
              LName = GetWindowTextLength_(WindowFromPoint) + 1
              If lName > 1
                  GetWindowText_(WindowFromPoint, WindowText, lName)
                  DrawText(Chr(34) + WindowText + Chr(34))
                Else
                  Debug "Error : " + Str(GetLastError_())
                  ParentWindow = WindowFromPoint
                  Repeat
                    Debug "Parent : " + Str(GetParent_(ParentWindow))
                    ParentWindow = GetParent_(ParentWindow)
                  Until ParentWindow = 0
              EndIf
              ModuleName.s = Space(#MAX_PATH)
  Debug "GetModule" + Str(GetModuleFileName_(GetWindowWord_(WindowFromPoint, #GWW_HINSTANCE), @ModuleName, #MAX_PATH))
  Debug "ModuleName " + ModuleName
  Debug "--------------------"
              Locate(X, Y) : Y + 10
              DrawText("Handle =" + Str(WindowFromPoint))
;              Locate(X, Y) : Y + 10
;              DrawText("WindowID() = " + Str(WindowID()))
              Locate(X, Y) : Y + 10

;  Result = 
;  WindowName.s = Space(Result)
;  GetWindowText_(WindowFromPoint, WindowName, Result + 1)


              Locate(X, Y) : Y + 10
              DrawText("GetDC_(WindowFromPoint) = " + Str(GetDC_(WindowFromPoint)))
              Locate(X, Y) : Y + 10
              DrawText("#GWL_EXSTYLE = " + Str(GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE)))
              Locate(X, Y) : Y + 10
              DrawText("#GWL_STYLE = " + Str(GetWindowLong_(WindowFromPoint, #GWL_STYLE)))
              Locate(X, Y) : Y + 10
              DrawText("#GWL_WNDPROC = " + Str(GetWindowLong_(WindowFromPoint, #GWL_WNDPROC)))
              Locate(X, Y) : Y + 10
              DrawText("#GWL_HINSTANCE = " + Str(GetWindowLong_(WindowFromPoint, #GWL_HINSTANCE)))
              Locate(X, Y) : Y + 10
              Filiation.s = ""
              HwndParent = GetWindowLong_(WindowFromPoint, #GWL_HWNDPARENT)
              Repeat
                Debug HwndParent
                Filiation = Filiation + " " + Str(HwndParent)
                HwndParent = GetWindowLong_(HwndParent, #GWL_HWNDPARENT)
              Until HwndParent = #FALSE
              DrawText("#GWL_HWNDPARENT = " + Filiation)
              Locate(X, Y) : Y + 10
              DrawText("#GWL_ID = " + Str(GetWindowLong_(WindowFromPoint, #GWL_ID)))
              Locate(X, Y) : Y + 10
              DrawText("#GWL_USERDATA = " + Str(GetWindowLong_(WindowFromPoint, #GWL_USERDATA)))
              Locate(X, Y) : Y + 10
              DrawText("#GWL_DLGPROC = " + Str(GetWindowLong_(WindowFromPoint, #DWL_DLGPROC)))
              Locate(X, Y) : Y + 10
              DrawText("#GWL_MSGRESULT = " + Str(GetWindowLong_(WindowFromPoint, #DWL_MSGRESULT)))
              Locate(X, Y) : Y + 10
              DrawText("#GWL_USER = " + Str(GetWindowLong_(WindowFromPoint, #DWL_USER)))
              Locate(X, Y) : Y + 10
              DrawText("WindowRect = " + Str(WindowRect\left) + ", " + Str(WindowRect\top) + ", " + Str(WindowRect\right) + ", " + Str(WindowRect\bottom))




            StopDrawing()
        a$ = ""

        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_BORDER : a$ = a$ + "-- Creates a window that has a thin-line border." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_CAPTION : a$ = a$ + "-- Creates a window that has a title bar (includes the WS_BORDER style)." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_CHILD : a$ = a$ + "-- Creates a child window. This style cannot be used with the WS_POPUP style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_CHILDWINDOW : a$ = a$ + "-- Same as the WS_CHILD style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_CLIPCHILDREN : a$ = a$ + "-- Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_CLIPSIBLINGS : a$ = a$ + "-- Clips child windows relative To each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_DISABLED : a$ = a$ + "-- Creates a window that is initially disabled. A disabled window cannot receive input from the user." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_DLGFRAME : a$ = a$ + "-- Creates a window that has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_GROUP : a$ = a$ + "-- Specifies the first control of a group of controls. The user can change the keyboard focus from one control in the group To the Next by using the direction keys. All controls defined with the WS_GROUP style after the first control belong To the same group. The Next control with the WS_GROUP style ends the group And starts the Next group." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_HSCROLL : a$ = a$ + "-- Creates a window that has a horizontal scroll bar." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_ICONIC : a$ = a$ + "-- Creates a window that is initially minimized. Same as the WS_MINIMIZE style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_MAXIMIZE : a$ = a$ + "-- Creates a window that is initially maximized." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_MAXIMIZEBOX : a$ = a$ + "-- Creates a window that has a Maximize button." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_MINIMIZE : a$ = a$ + "-- Creates a window that is initially minimized. Same as the WS_ICONIC style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_MINIMIZEBOX : a$ = a$ + "-- Creates a window that has a Minimize button." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_OVERLAPPED : a$ = a$ + "-- Creates an overlapped window. An overlapped window has a title bar And a border. Same as the WS_TILED style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_OVERLAPPEDWINDOW : a$ = a$ + "-- Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, And WS_MAXIMIZEBOX styles. Same as the WS_TILEDWINDOW style. " : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_POPUP : a$ = a$ + "-- Creates a pop-up window. This style cannot be used with the WS_CHILD style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_POPUPWINDOW : a$ = a$ + "-- Creates a pop-up window with WS_BORDER, WS_POPUP, And WS_SYSMENU styles. The WS_CAPTION And WS_POPUPWINDOW styles must be combined To make the System menu visible." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_SIZEBOX : a$ = a$ + "-- Creates a window that has a sizing border. Same as the WS_THICKFRAME style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_SYSMENU : a$ = a$ + "-- Creates a window that has a System-menu box in its title bar. The WS_CAPTION style must also be specified." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_TABSTOP : a$ = a$ + "-- Specifies a control that can receive the keyboard focus when the user presses the TAB key. Pressing the TAB key changes the keyboard focus To the Next control with the WS_TABSTOP style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_THICKFRAME : a$ = a$ + "-- Creates a window that has a sizing border. Same as the WS_SIZEBOX style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_TILED : a$ = a$ + "-- Creates an overlapped window. An overlapped window has a title bar And a border. Same as the WS_OVERLAPPED style. " : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_TILEDWINDOW : a$ = a$ + "-- Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, And WS_MAXIMIZEBOX styles. Same as the WS_OVERLAPPEDWINDOW style. " : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_VISIBLE : a$ = a$ + "-- Creates a window that is initially visible." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #WS_VSCROLL : Debug "--Creates a window that has a vertical scroll bar." : EndIf

        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_3STATE : a$ = a$ + "-- Creates a button that is the same as a check box, except that the box can be grayed as well as checked Or unchecked. Use the grayed state To show that the state of the check box is not determined." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_AUTO3STATE : a$ = a$ + "-- Creates a button that is the same as a three-state check box, except that the box changes its state when the user selects it. The state cycles through checked, grayed, And unchecked." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_AUTOCHECKBOX : a$ = a$ + "-- Creates a button that is the same as a check box, except that the check state automatically toggles between checked And unchecked each time the user selects the check box." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_AUTORADIOBUTTON : a$ = a$ + "-- Creates a button that is the same as a radio button, except that when the user selects it, Windows automatically sets the button's check state to checked and automatically sets the check state for all other buttons in the same group to unchecked." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_CHECKBOX : a$ = a$ + "-- Creates a small, empty check box with text. By default, the text is displayed To the right of the check box. To display the text To the left of the check box, combine this flag with the BS_LEFTTEXT style (Or on Windows 95 only, with the equivalent BS_RIGHTBUTTON style)." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_DEFPUSHBUTTON : a$ = a$ + "-- Creates a push button that behaves like a BS_PUSHBUTTON style button, but also has a heavy black border. If the button is in a dialog box, the user can Select the button by pressing the ENTER key, even when the button does not have the input focus. This style is useful For enabling the user To quickly Select the most likely (default) option." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_GROUPBOX : a$ = a$ + "-- Creates a rectangle in which other controls can be grouped. Any text associated with this style is displayed in the rectangle's upper left corner." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_LEFTTEXT : a$ = a$ + "-- Places text on the left side of the radio button Or check box when combined with a radio button Or check box style. Same as the Windows 95 BS_RIGHTBUTTON style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_OWNERDRAW : a$ = a$ + "-- Creates an owner-drawn button. The owner window receives a WM_MEASUREITEM message when the button is created And a WM_DRAWITEM message when a visual aspect of the button has changed. Do not combine the BS_OWNERDRAW style with any other button styles." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_PUSHBUTTON : a$ = a$ + "-- Creates a push button that posts a WM_COMMAND message To the owner window when the user selects the button." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_RADIOBUTTON : a$ = a$ + "-- Creates a small circle with text. By default, the text is displayed To the right of the circle. To display the text To the left of the circle, combine this flag with the BS_LEFTTEXT style (Or on Windows 95 only, with the equivalent BS_RIGHTBUTTON style). Use radio buttons For groups of related, but mutually exclusive choices." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_USERBUTTON : a$ = a$ + "-- Obsolete, but provided For compatibility with 16-bit versions of Windows. Win32-based applications should use BS_OWNERDRAW instead." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_BITMAP : a$ = a$ + "-- Windows 95 only: Specifies that the button displays a bitmap." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_BOTTOM : a$ = a$ + "-- Windows 95 only: Places text at the bottom of the button rectangle." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_CENTER : a$ = a$ + "-- Windows 95 only: Centers text horizontally in the button rectangle." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_ICON : a$ = a$ + "-- Windows 95 only: Specifies that the button displays an icon." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_LEFT : a$ = a$ + "-- Windows 95 only: Left-justifies the text in the button rectangle. However, If the button is a check box Or radio button that does not have the BS_RIGHTBUTTON style, the text is left justified on the right side of the check box Or radio button." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_MULTILINE : a$ = a$ + "-- Windows 95 only: Wraps the button text To multiple lines If the text string is too long To fit on a single line in the button rectangle." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_NOTIFY : a$ = a$ + "-- Windows 95 only: Enables a button To send BN_DBLCLK, BN_KILLFOCUS, And BN_SETFOCUS notification messages To its parent window. Note that buttons send the BN_CLICKED notification message regardless of whether it has this style. " : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_PUSHLIKE : a$ = a$ + "-- Windows 95 only: Makes a button (such as a check box, three-state check box, Or radio button) look And act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_RIGHT : a$ = a$ + "-- Windows 95 only: Right-justifies text in the button rectangle. However, If the button is a check box Or radio button that does not have the BS_RIGHTBUTTON style, the text is right justified on the right side of the check box Or radio button." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_RIGHTBUTTON : a$ = a$ + "-- Windows 95 only: Positions a radio button's circle or a check box's square on the right side of the button rectangle. Same as the BS_LEFTTEXT style." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_TEXT : a$ = a$ + "-- Windows 95 only: Specifies that the button displays text." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_TOP : a$ = a$ + "-- Windows 95 only: Places text at the top of the button rectangle." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #BS_VCENTER : a$ = a$ + "-- Windows 95 only: Places text in the middle (vertically) of the button rectangle." : EndIf
                      
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_AUTOHSCROLL : a$ = a$ + "-- Automatically scrolls the text in an edit control To the right when the user types a character at the End of the line. If this style is not set, only text that fits within the rectangular boundary is allowed." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_DISABLENOSCROLL : a$ = a$ + "-- Shows a disabled vertical scroll bar in the list box when the box does not contain enough items To scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_DROPDOWN : a$ = a$ + "-- Similar To CBS_SIMPLE, except that the list box is not displayed unless the user selects an icon Next To the edit control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_DROPDOWNLIST : a$ = a$ + "-- Similar To CBS_DROPDOWN, except that the edit control is replaced by a static text item that displays the current selection in the list box." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_HASSTRINGS : a$ = a$ + "-- Specifies that an owner-drawn combo box contains items consisting of strings. The combo box maintains the memory And address For the strings, so the application can use the CB_GETLBTEXT message To retrieve the text For a particular item." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_LOWERCASE : a$ = a$ + "-- Converts To lowercase any uppercase characters entered into the edit control of a combo box." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_NOINTEGRALHEIGHT : a$ = a$ + "-- Specifies that the size of the combo box is exactly the size specified by the application when it created the combo box. Normally, Windows sizes a combo box so that it does not display partial items." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_OEMCONVERT : a$ = a$ + "-- Converts text entered in the combo box edit control. The text is converted from the Windows character set To the OEM character set And then back To the Windows set. This ensures proper character conversion when the application calls the CharToOem function To convert a Windows string in the combo box To OEM characters. This style is most useful For combo boxes that contain filenames And applies only To combo boxes created with the CBS_SIMPLE Or CBS_DROPDOWN style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_OWNERDRAWFIXED : a$ = a$ + "-- Specifies that the owner of the list box is responsible For drawing its contents And that the items in the list box are all the same height. The owner window receives a WM_MEASUREITEM message when the combo box is created And a WM_DRAWITEM message when a visual aspect of the combo box has changed." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_OWNERDRAWVARIABLE : a$ = a$ + "-- Specifies that the owner of the list box is responsible For drawing its contents And that the items in the list box are variable in height. The owner window receives a WM_MEASUREITEM message For each item in the combo box when you create the combo box; the owner window receives a WM_DRAWITEM message when a visual aspect of the combo box has changed." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_SIMPLE : a$ = a$ + "-- Displays the list box at all times. The current selection in the list box is displayed in the edit control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_SORT : a$ = a$ + "-- Automatically sorts strings entered into the list box." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #CBS_UPPERCASE : a$ = a$ + "-- Converts To uppercase any lowercase characters entered into the edit control of a combo box." : EndIf

        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_AUTOHSCROLL : a$ = a$ + "-- Automatically scrolls text To the right by 10 characters when the user types a character at the End of the line. When the user presses the ENTER key, the control scrolls all text back To position zero." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_AUTOVSCROLL : a$ = a$ + "-- Automatically scrolls text up one page when the user presses the ENTER key on the last line." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_CENTER : a$ = a$ + "-- Centers text in a multiline edit control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_LEFT : a$ = a$ + "-- Left-aligns text." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_LOWERCASE : a$ = a$ + "-- Converts all characters To lowercase as they are typed into the edit control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_MULTILINE : a$ = a$ + "-- Designates a multiline edit control. The Default is single-line edit control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_NOHIDESEL : a$ = a$ + "-- Negates the Default behavior For an edit control. The Default behavior hides the selection when the control loses the input focus And inverts the selection when the control receives the input focus. If you specify ES_NOHIDESEL, the selected text is inverted, even If the control does not have the focus." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_NUMBER : a$ = a$ + "-- Windows 95 only: Allows only digits To be entered into the edit control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_OEMCONVERT : a$ = a$ + "-- Converts text entered in the edit control. The text is converted from the Windows character set To the OEM character set And then back To the Windows set. This ensures proper character conversion when the application calls the CharToOem function To convert a Windows string in the edit control To OEM characters. This style is most useful For edit controls that contain filenames." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_PASSWORD : a$ = a$ + "-- Displays an asterisk (*) For each character typed into the edit control. You can use the EM_SETPASSWORDCHAR message To change the character that is displayed." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_READONLY : a$ = a$ + "-- Prevents the user from typing Or editing text in the edit control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_RIGHT : a$ = a$ + "-- Right-aligns text in a multiline edit control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_UPPERCASE : a$ = a$ + "-- Converts all characters To uppercase as they are typed into the edit control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #ES_WANTRETURN : a$ = a$ + "-- Specifies that a carriage Return be inserted when the user presses the ENTER key While entering text into a multiline edit control in a dialog box. If you do not specify this style, pressing the ENTER key has the same effect as pressing the dialog box's default push button. This style has no effect on a single-line edit control." : EndIf

        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_DISABLENOSCROLL : a$ = a$ + "-- Shows a disabled vertical scroll bar For the list box when the box does not contain enough items To scroll. If you do not specify this style, the scroll bar is hidden when the list box does not contain enough items." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_EXTENDEDSEL : a$ = a$ + "-- Allows multiple items To be selected by using the SHIFT key And the mouse Or special key combinations." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_HASSTRINGS : a$ = a$ + "-- Specifies that a list box contains items consisting of strings. The list box maintains the memory And addresses For the strings so the application can use the LB_GETTEXT message To retrieve the text For a particular item. By default, all list boxes except owner-drawn list boxes have this style. You can create an owner-drawn list box either with Or without this style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_MULTICOLUMN : a$ = a$ + "-- Specifies a multicolumn list box that is scrolled horizontally. The LB_SETCOLUMNWIDTH message sets the width of the columns." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_MULTIPLESEL : a$ = a$ + "-- Turns string selection on Or off each time the user clicks Or double-clicks a string in the list box. The user can Select any number of strings." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_NODATA : a$ = a$ + "-- Specifies a no-Data list box. Specify this style when the count of items in the list box will exceed one thousand. A no-Data list box must also have the LBS_OWNERDRAWFIXED style, but must not have the LBS_SORT Or LBS_HASSTRINGS style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_NOINTEGRALHEIGHT : a$ = a$ + "-- Specifies that the size of the list box is exactly the size specified by the application when it created the list box. Normally, Windows sizes a list box so that the list box does not display partial items." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_NOREDRAW : a$ = a$ + "-- Specifies that the list box's appearance is not updated when changes are made. You can change this style at any time by sending a WM_SETREDRAW message." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_NOTIFY : a$ = a$ + "-- Notifies the parent window with an input message whenever the user clicks Or double-clicks a string in the list box." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_OWNERDRAWFIXED : a$ = a$ + "-- Specifies that the owner of the list box is responsible For drawing its contents And that the items in the list box are the same height. The owner window receives a WM_MEASUREITEM message when the list box is created And a WM_DRAWITEM message when a visual aspect of the list box has changed." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_OWNERDRAWVARIABLE : a$ = a$ + "-- Specifies that the owner of the list box is responsible For drawing its contents And that the items in the list box are variable in height. The owner window receives a WM_MEASUREITEM message For each item in the combo box when the combo box is created And a WM_DRAWITEM message when a visual aspect of the combo box has changed." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_SORT : a$ = a$ + "-- Sorts strings in the list box alphabetically." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_STANDARD : a$ = a$ + "-- Sorts strings in the list box alphabetically. The parent window receives an input message whenever the user clicks Or double-clicks a string. The list box has borders on all sides." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_USETABSTOPS : a$ = a$ + "-- Enables a list box To recognize And expand tab characters when drawing its strings. The Default tab positions are 32 dialog box units. A dialog box unit is a horizontal Or vertical distance. One horizontal dialog box unit is equal To one-fourth of the current dialog box base-width unit. Windows calculates these units based on the height And width of the current system font. The GetDialogBaseUnits function returns the current dialog box base units in pixels." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #LBS_WANTKEYBOARDINPUT : a$ = a$ + "-- Specifies that the owner of the list box receives WM_VKEYTOITEM messages whenever the user presses a key And the list box has the input focus. This enables an application To perform special processing on the keyboard input." : EndIf

        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SBS_BOTTOMALIGN : a$ = a$ + "-- Aligns the bottom edge of the scroll bar with the bottom edge of the rectangle defined by the CreateWindow parameters x, y, nWidth, And nHeight. The scroll bar has the Default height For system scroll bars. Use this style with the SBS_HORZ style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SBS_HORZ : a$ = a$ + "-- Designates a horizontal scroll bar. If neither the SBS_BOTTOMALIGN nor SBS_TOPALIGN style is specified, the scroll bar has the height, width, And position specified by the parameters of CreateWindow." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SBS_LEFTALIGN : a$ = a$ + "-- Aligns the left edge of the scroll bar with the left edge of the rectangle defined by the parameters of CreateWindow. The scroll bar has the Default width For system scroll bars. Use this style with the SBS_VERT style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SBS_RIGHTALIGN : a$ = a$ + "-- Aligns the right edge of the scroll bar with the right edge of the rectangle defined by the parameters of CreateWindow. The scroll bar has the Default width For system scroll bars. Use this style with the SBS_VERT style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SBS_SIZEBOX : a$ = a$ + "-- Designates a size box. If you specify neither the SBS_SIZEBOXBOTTOMRIGHTALIGN nor the SBS_SIZEBOXTOPLEFTALIGN style, the size box has the height, width, And position specified by the parameters of CreateWindow." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SBS_SIZEBOXBOTTOMRIGHTALIGN : a$ = a$ + "-- Aligns the lower-right corner of the size box with the lower-right corner of the rectangle specified by the parameters of CreateWindow. The size box has the Default size For system size boxes. Use this style with the SBS_SIZEBOX style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SBS_SIZEBOXTOPLEFTALIGN : a$ = a$ + "-- Aligns the upper-left corner of the size box with the upper-left corner of the rectangle specified by the parameters of CreateWindow. The size box has the Default size For system size boxes. Use this style with the SBS_SIZEBOX style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SBS_SIZEGRIP : a$ = a$ + "-- Windows 95 only: Same as SBS_SIZEBOX, but with a raised edge." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SBS_TOPALIGN : a$ = a$ + "-- Aligns the top edge of the scroll bar with the top edge of the rectangle defined by the parameters of CreateWindow. The scroll bar has the Default height For system scroll bars. Use this style with the SBS_HORZ style." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SBS_VERT : a$ = a$ + "-- Designates a vertical scroll bar. If you specify neither the SBS_RIGHTALIGN nor the SBS_LEFTALIGN style, the scroll bar has the height, width, And position specified by the parameters of CreateWindow." : EndIf

        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_BITMAP : a$ = a$ + "-- Specifies a bitmap is To be displayed in the static control. The given text is the name of a bitmap (not a filename) defined elsewhere in the resource file. The style ignores the nWidth And nHeight parameters; the control automatically sizes itself to accommodate the bitmap." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_BLACKFRAME : a$ = a$ + "-- Specifies a box with a frame drawn in the same color as the window frames. This color is black in the Default Windows color scheme." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_BLACKRECT : a$ = a$ + "-- Specifies a rectangle filled with the current window frame color. This color is black in the Default Windows color scheme." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_CENTER : a$ = a$ + "-- Specifies a simple rectangle And centers the given text in the rectangle. The text is formatted before it is displayed. Words that extend past the End of a line are automatically wrapped To the beginning of the Next centered line." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_CENTERIMAGE : a$ = a$ + "-- Specifies that the midpoint of a static control with the SS_BITMAP Or SS_ICON style is To remain fixed when the control is resized. The four sides are adjusted To accommodate a new bitmap Or icon.If a static control has the SS_BITMAP style And the bitmap is smaller than the control's client area, the client area is filled with the color of the pixel in the upper-left corner of the bitmap. If a static control has the SS_ICON style, the icon does not appear to paint the client area." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_GRAYFRAME : a$ = a$ + "-- Specifies a box with a frame drawn with the same color as the screen background (desktop). This color is gray in the Default Windows color scheme." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_GRAYRECT : a$ = a$ + "-- Specifies a rectangle filled with the current screen background color. This color is gray in the Default Windows color scheme." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_ICON : a$ = a$ + "-- Specifies an icon displayed in the dialog box. The given text is the name of an icon (not a filename) defined elsewhere in the resource file. The style ignores the nWidth And nHeight parameters; the icon automatically sizes itself." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_LEFT : a$ = a$ + "-- Specifies a simple rectangle And left-aligns the given text in the rectangle. The text is formatted before it is displayed. Words that extend past the End of a line are automatically wrapped To the beginning of the Next left-aligned line." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_LEFTNOWORDWRAP : a$ = a$ + "-- Specifies a simple rectangle And left-aligns the given text in the rectangle. Tabs are expanded but words are not wrapped. Text that extends past the End of a line is clipped." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_METAPICT : a$ = a$ + "-- Specifies a metafile picture is To be displayed in the static control. The given text is the name of a metafile picture (not a filename) defined elsewhere in the resource file. A metafile static control has a fixed size; the metafile picture is scaled to fit the static control's client area." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_NOPREFIX : a$ = a$ + "-- Prevents interpretation of any ampersand (&) characters in the control's text as accelerator prefix characters. These are displayed with the ampersand removed and the next character in the string underlined. This static control style may be included with any of the defined static controls." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_NOTIFY : a$ = a$ + "-- Sends the parent window STN_CLICKED And STN_DBLCLK notification messages when the user clicks Or double clicks the control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_RIGHT : a$ = a$ + "-- Specifies a simple rectangle And right-aligns the given text in the rectangle. The text is formatted before it is displayed. Words that extend past the End of a line are automatically wrapped To the beginning of the Next right-aligned line." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_RIGHTIMAGE : a$ = a$ + "-- Specifies that the bottom-right corner of a static control with the SS_BITMAP Or SS_ICON style is To remain fixed when the control is resized. Only the top And left sides are adjusted To accommodate a new bitmap Or icon. " : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_SIMPLE : a$ = a$ + "-- Specifies a simple rectangle And displays a single line of left-aligned text in the rectangle. The text line cannot be shortened Or altered in any way. The control's parent window or dialog box must not process the WM_CTLCOLORSTATIC message." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_WHITEFRAME : a$ = a$ + "-- Specifies a box with a frame drawn with the same color as the window backgrounds. This color is white in the Default Windows color scheme." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #SS_WHITERECT : a$ = a$ + "-- Specifies a rectangle filled with the current window background color. This color is white in the Default Windows color scheme." : EndIf

        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_3DLOOK : a$ = a$ + "-- Windows 95 only: Gives the dialog box a nonbold font And draws three-dimensional borders around control windows in the dialog box.The DS_3DLOOK style is not required by Win32-based applications that are marked with version number 4.0 Or greater; the system automatically applies the three dimensional look to dialog boxes created by these applications." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_ABSALIGN : a$ = a$ + "-- Indicates that the coordinates of the dialog box are screen coordinates; otherwise, Windows assumes they are client coordinates." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_CENTER : a$ = a$ + "-- Windows 95 only: Centers the dialog box in the working area; that is, the area not obscured by the tray." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_CENTERMOUSE : a$ = a$ + "-- Windows 95 only: Centers the mouse cursor in the dialog box." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_CONTEXTHELP : a$ = a$ + "-- Includes a question mark in the title bar of the dialog box. When the user clicks the question mark, the cursor changes To a question mark with a pointer. If the user then clicks a control in the dialog box, the control receives a WM_HELP message. The control should pass the message To the dialog procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help For the control.Note that DS_CONTEXTHELP is just a placeholder. When the dialog box is created, the system checks For DS_CONTEXTHELP and, If it is there, adds WS_EX_CONTEXTHELP To the extended style of the dialog box." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_CONTROL : a$ = a$ + "-- Creates a dialog box that works well as a child window of another dialog box, much like a page in a property sheet. This style allows the user To tab among the control windows of a child dialog box, use its accelerator keys, And so on." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_FIXEDSYS : a$ = a$ + "-- Windows 95 only: Use SYSTEM_FIXED_FONT instead of SYSTEM_FONT." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_LOCALEDIT : a$ = a$ + "-- Applies To 16-bit applications only. This style directs edit controls in the dialog box To allocate memory from the application's data segment. Otherwise, edit controls allocate storage from a global memory object." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_MODALFRAME : a$ = a$ + "-- Creates a dialog box with a modal dialog-box frame that can be combined with a title bar And System menu by specifying the WS_CAPTION And WS_SYSMENU styles." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_NOFAILCREATE : a$ = a$ + "-- Windows 95 only: Creates the dialog box even If errors occur ¾ For example, If a child window cannot be created Or If the system cannot create a special Data segment For an edit control." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_NOIDLEMSG : a$ = a$ + "-- Suppresses WM_ENTERIDLE messages that Windows would otherwise send To the owner of the dialog box While the dialog box is displayed." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_RECURSE : a$ = a$ + "-- Dialog box style For control-like dialog boxes." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_SETFONT : a$ = a$ + "-- Indicates that the dialog box template (the DLGTEMPLATE structure) contains two additional members specifying a font name And point size. The corresponding font is used To display text within the dialog box client area And within the dialog box controls. Windows passes the handle of the font To the dialog box And To each control by sending them the WM_SETFONT message." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_SETFOREGROUND : a$ = a$ + "-- Does not apply To 16-bit versions of Microsoft Windows. This style brings the dialog box To the foreground. Internally, Windows calls the SetForegroundWindow function For the dialog box." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_STYLE) & #DS_SYSMODAL : a$ = a$ + "-- Creates a system-modal dialog box. This style causes the dialog box To have the WS_EX_TOPMOST style, but otherwise has no effect on the dialog box Or the behavior of other windows in the system when the dialog box is displayed." : EndIf
        b$ = ""
        ;If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_ABSPOSITION : b$ = b$ + "--- Specifies that a window has an absolute position. That is, the window does not move when the working area moves." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_ACCEPTFILES : b$ = b$ + "--- Specifies that a window created with this style accepts drag-drop files." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_APPWINDOW : b$ = b$ + "--- Windows 95 only: Forces a top-level window onto the application taskbar when the window is minimized. " : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_CLIENTEDGE : b$ = b$ + "--- Specifies that a window has a border with a sunken edge." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_CONTEXTHELP : b$ = b$ + "--- Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes To a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message. The child window should pass the message To the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help For the child window." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_CONTROLPARENT : b$ = b$ + "--- Windows 95 only: Allows the user To navigate among the child windows of the window by using the TAB key." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_DLGMODALFRAME : b$ = b$ + "--- Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_LEFT : b$ = b$ + "--- Windows 95 only: Window has generic "left-aligned" properties. This is the default." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_LEFTSCROLLBAR : b$ = b$ + "--- Windows 95 only: If the shell language is Hebrew, Arabic, Or another language that supports reading order alignment, the vertical scroll bar (If present) is To the left of the client area. For other languages, the style is ignored And not treated as an error." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_LTRREADING : b$ = b$ + "--- Windows 95 only: The window text is displayed using Left To Right reading-order properties. This is the default." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_MDICHILD : b$ = b$ + "--- Creates an MDI child window." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_NOPARENTNOTIFY : b$ = b$ + "--- Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message To its parent window when it is created Or destroyed." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_OVERLAPPEDWINDOW : b$ = b$ + "--- Windows 95 only: Combines the WS_EX_CLIENTEDGE And WS_EX_WINDOWEDGE styles." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_PALETTEWINDOW : b$ = b$ + "--- Windows 95 only: Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, And WS_EX_TOPMOST styles." : EndIf
        ;If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_RIGHT : b$ = b$ + "--- Windows 95 only: Window has generic "right-aligned" properties. This depends on the window class. This style has an effect only If the shell language is Hebrew, Arabic, Or another language that supports reading order alignment; otherwise, the style is ignored and not treated as an error." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_RIGHTSCROLLBAR : b$ = b$ + "--- Windows 95 only: Vertical scroll bar (If present) is To the right of the client area. This is the default." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_RTLREADING : b$ = b$ + "--- Windows 95 only: If the shell language is Hebrew, Arabic, Or another language that supports reading order alignment, the window text is displayed using Right To Left reading-order properties. For other languages, the style is ignored And not treated as an error." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_STATICEDGE : b$ = b$ + "--- Windows 95 only: Creates a window with a three-dimensional border style intended To be used For items that do not accept user input." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_TOOLWINDOW : b$ = b$ + "--- Windows 95 only: Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the task bar or in the window that appears when the user presses ALT+TAB." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_TOPMOST : b$ = b$ + "--- Specifies that a window created with this style should be placed above all non-topmost windows And should stay above them, even when the window is deactivated. To add Or remove this style, use the SetWindowPos function." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_TRANSPARENT : b$ = b$ + "--- Specifies that a window created with this style is To be transparent. That is, any windows that are beneath the window are not obscured by the window. A window created with this style receives WM_PAINT messages only after all sibling windows beneath it have been updated." : EndIf
        If GetWindowLong_(WindowFromPoint, #GWL_EXSTYLE) & #WS_EX_WINDOWEDGE : b$ = b$ + "--- Windows 95 only: Specifies that a window has a border with a raised edge." : EndIf
        
        Debug "Styles = " + a$
        Debug "ExStyles = " + b$

        ;
        ; Value                       Action
        ;
        ; GWL_EXSTYLE                 Retrieves the extended window styles.
        ; GWL_STYLE                   Retrieves the window styles.
        ; GWL_WNDPROC                 Retrieves the address of the window procedure, Or a handle representing the address of the window Procedure. You must use the CallWindowProc function To call the window Procedure.
        ; GWL_HINSTANCE               Retrieves the handle of the application instance.
        ; GWL_HWNDPARENT              Retrieves the handle of the parent window, If any.
        ; GWL_ID                      Retrieves the identifier of the window.
        ; GWL_USERDATA                Retrieves the 32-bit value associated with the window. Each window has a corresponding 32-bit value intended For use by the application that created the window.
        ;
        ; The following values are also available when the hWnd parameter identifies a dialog box: 
        ; 
        ; Value                       Action
        ; DWL_DLGPROC       Retrieves the address of the dialog box procedure, Or a handle representing the address of the dialog box Procedure. You must use the CallWindowProc function To call the dialog box Procedure.
        ; DWL_MSGRESULT   Retrieves the Return value of a message processed in the dialog box Procedure.
        ; DWL_USER              Retrieves extra information private To the application, such as handles Or pointers.

        EndIf
        
        Delay(1)
        
        StartDrawing(WindowOutput())
          DrawingFont(FontID)
          DrawingMode(0)
          Box(10, WindowYSize - 20, 190, 10, $400000)
          FrontColor(255, 255, 255)
          Locate(10, WindowYSize - 20)
          DrawingMode(1)
          GetCursorPos_(CursorPosition)
          DrawText("CursorPosition = " + Str(CursorPosition\x) + ", " + Str(CursorPosition\y))
          If ImageFlag
              SourceDeviceContext = GetDC_(0)
              DestinationDeviceContext = CreateCompatibleDC_(SourceDeviceContext)
              BitMapID = CreateImage(0, WindowXSize - 201, WindowYSize - 2)
              SelectObject_(DestinationDeviceContext, BitMapID)
              SetStretchBltMode_(DestinationDeviceContext, #HALFTONE)
              StretchBlt_(DestinationDeviceContext, 0, 0, (WindowRect\right - WindowRect\left) >> 1, (WindowRect\bottom - WindowRect\top) >> 1, SourceDeviceContext, WindowRect\left, WindowRect\top, WindowRect\right - WindowRect\left, WindowRect\bottom - WindowRect\top, #SRCCOPY)
              DeleteDC_(DestinationDeviceContext)
              ReleaseDC_(0, SourceDeviceContext)
              DrawImage(BitMapID, 200, 1)
              DeleteObject_(BitMapID)
          EndIf
        StopDrawing()
        
        If GetTickCount_() - CursorTimer > 250
            CursorSpeed = 0
        EndIf
        
      Until Quit
      
  EndIf
  TerminateProcess_(GetCurrentProcess_(), 0)
  
End
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Isn't that a little too short code? :|
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Woah, seems good but I still don't get how could I get the handle of a certain process using that (havent seen the source yet)...
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Post Reply