Child tables

From Team Developer SqlWindows Wiki
Revision as of 16:19, 22 December 2008 by DaveRabelink (Talk | contribs)

Jump to: navigation, search

This page covers ChildTable tips & tricks.

Contents


Pointer2.png What message is send when a DropDown column item is selected (clicked) Pointer.png

When an item from a column dropdown list is selected, the message SAM_AnyEdit is send to the column message actions section.

Pointer2.png How to hide the window displayed in the taskbar when a column dropdown list is opened Pointer.png

When you open the dropdown list of a table column, a window is shown on the Windows taskbar.
To get rid of this window use this code under the message actions of the table column

First declare these three WinApi functions in the external functions section

Library name: USER32.DLL
   Function: FindWindowA
      Export Ordinal: 0
      Returns
         Window Handle: HWND
      Parameters
         String: LPCSTR
         String: LPCSTR

   Function: GetWindowLongA
      Export Ordinal: 0
      Returns
         Number: LONG
      Parameters
         Window Handle: HWND
         Number: INT

   Function: SetWindowLongA
      Export Ordinal: 0
      Returns
         Number: LONG
      Parameters
         Window Handle: HWND
         Number: INT
         Number: LONG


Also declare these constants

   Number: GWL_EXSTYLE      = -20
   Number: WS_EX_TOOLWINDOW = 0x80


Here the actual code for removing the window from the taskbar

On SAM_DropDown
   Set hWndDropDown = FindWindowA( "Gupta:DropDown", "" )
   If NOT hWndDropDown
      ! Maybe it is an older TD version, so search for another classname
      Set hWndDropDown = FindWindowA( ":DropDown", "" )
   If hWndDropDown
      If NOT GetWindowLongA( hWndDropDown,GWL_EXSTYLE ) & WS_EX_TOOLWINDOW
         Call SetWindowLongA( hWndDropDown, GWL_EXSTYLE, GetWindowLongA( hWndDropDown,GWL_EXSTYLE ) | WS_EX_TOOLWINDOW )

Here you can download a sample: