ACTIVATE DIALOG oDlg CENTERED ON INIT MySays(oDlg)
//--------------------
Function MySays(oDlg)
local n
For n := 1 to len(oDlg:aControls)
//if oDlg:aControls[n]:CLASSNAME == "TSAY"
//MsgInfo(oDlg:aControls[n]:cTitle)
msginfo(oDlg:aControls[n]:CLASSNAME)
//endif
Next
Return nil
#define GW_CHILD 5
#define GW_HWNDNEXT 2
#define GWL_ID -12
function FindControlsById( oDlg )
local n, hCtrl := GetWindow( oDlg:hWnd, GW_CHILD )
WHILE hCtrl != 0
if GetWindowLong( hCtrl, GWL_ID ) == -1 // You may also use GetClassName( hCtrl ) == cClassName
...
endif
hCtrl = GetWindow( hCtrl, GW_HWNDNEXT )
END
return nil
#include "FiveWin.ch"
#include "xbrowse.ch"
#define GW_CHILD 5
#define GW_HWNDNEXT 2
#define GWL_ID -12
//----------------------------------------------------------------------------//
function Main()
local oDlg, lSave := .f.
local c100 := "TEST ELVIRA "
local c101 := 0
local c102 := 0
local c103 := 0
DEFINE DIALOG oDlg RESOURCE "ELVIRA" TITLE "Prueba Elvira"
REDEFINE GET c100 ID 100 OF oDlg
REDEFINE GET c101 ID 101 OF oDlg PICTURE "@E 9,999,999" SPINNER
REDEFINE GET c102 ID 102 OF oDlg PICTURE "@E 9,999,999"
REDEFINE GET c103 ID 103 OF oDlg PICTURE "@E 9999" SPINNER
REDEFINE BUTTON ID 701 OF oDlg ACTION( lSave := .T., oDlg:End() )
REDEFINE BUTTON ID 702 OF oDlg ACTION( lSave := .F., oDlg:End() )
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT FindControlsById( oDlg )
return nil
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
function FindControlsById( oDlg )
//----------------------------------------------------------------------------//
local n, hCtrl := GetWindow( oDlg:hWnd, GW_CHILD )
WHILE hCtrl != 0
if GetWindowLong( hCtrl, GWL_ID ) == -1 // You may also use GetClassName( hCtrl ) == cClassName
alert(" ...")
endif
hCtrl = GetWindow( hCtrl, GW_HWNDNEXT )
END
return nil
//----------------------------------------------------------------------------//
function FindControlsById( oDlg )
//----------------------------------------------------------------------------//
local n, hCtrl := GetWindow( oDlg:hWnd, GW_CHILD )
WHILE hCtrl != 0
MsgInfo( GetClassName( hCtrl ) ) // new
if GetWindowLong( hCtrl, GWL_ID ) == -1 // You may also use GetClassName( hCtrl ) == cClassName
alert(" ...")
endif
hCtrl = GetWindow( hCtrl, GW_HWNDNEXT )
END
return nil
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 7.00".
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
ELVIRA DIALOG DISCARDABLE 23, 16, 258, 163
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION
CAPTION "Búsquedas"
FONT 10, "MS Sans Serif"
{
CONTROL "", 100, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 51, 14, 86, 12
CONTROL "", 101, "Edit", ES_RIGHT|ES_AUTOHSCROLL|WS_VSCROLL|WS_BORDER|WS_TABSTOP, 52, 60, 49, 11
CONTROL "", 102, "Edit", ES_RIGHT|WS_BORDER|WS_TABSTOP, 152, 60, 24, 11
CONTROL "", 103, "Edit", ES_RIGHT|ES_NUMBER|ES_AUTOVSCROLL|WS_VSCROLL|WS_BORDER|WS_TABSTOP, 208, 60, 36, 11
CONTROL "&Nombre:", -1, "Static", WS_GROUP, 10, 16, 28, 8
CONTROL "&Págs.:", -1, "Static", SS_RIGHT|WS_GROUP, 184, 60, 19, 12
CONTROL "&Vols:", -1, "Static", SS_RIGHT|WS_GROUP, 30, 63, 17, 8
CONTROL "&Ejemplares:", -1, "Static", SS_RIGHT|WS_GROUP, 112, 60, 38, 8
CONTROL "&Aceptar", 701, "Button", WS_TABSTOP, 73, 128, 36, 14
CONTROL "&Cancelar", 702, "Button", WS_TABSTOP, 140, 128, 36, 14
}
elvira wrote:And can you please teach us how to change the SAY´s text in rutime mode?.
SetWindowText( hCtrl, "New text" )
if GetWindowText( hCtrl ) = "&Ejemplares:"
SetWindowText( hCtrl, "New text:" )
endif
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 38 guests