Monday, August 23, 2004

Load image from library or a resource from .DLL

Set hLibrary = LoadLibraryA( "your_dll.dll" )
Set hBitmap = LoadBitmapA( hLibrary, "#Resource_Id" )
Call FreeLibrary( hLibrary )

Set difference text color for each tab folder

Here is sample code to make different color of text label for each tab folder, dont forget to add Set bStaticsAsWindows = TRUE, which can add at the SAM_AppStartup

!!CB!! 174
Set hWndLabel = SalGetFirstChild( hWndForm, TYPE_BkgdText | TYPE_Picture )
While hWndLabel != hWndNULL
Set sDummy = ''
Call SalWindowGetProperty( hWndLabel, 'TabChildNames', sDummy )
If sDummy = 'tabNameEmployee'
Call SalColorSet( hWndLabel, COLOR_IndexWindowText, COLOR_Red )
Else If sDummy = 'tabNameEditCov'
Call SalColorSet( hWndLabel, COLOR_IndexWindowText, COLOR_Blue )
If SalGetType( hWndLabel ) = TYPE_Picture
Call SalColorSet( hWndLabel, COLOR_IndexWindowText, COLOR_Blue )
! If SWTabsIsAssociatedWithTab( picTabs, 1, hWndLabel )
Call SalColorSet( hWndLabel, COLOR_IndexWindowText, COLOR_Red )
! Else
Call SalColorSet( hWndLabel, COLOR_IndexWindowText, COLOR_Blue )
! Call SalColorSet( hWndLabel, COLOR_IndexWindowText, COLOR_Blue )
Set hWndLabel = SalGetNextChild( hWndLabel, TYPE_BkgdText | TYPE_Picture )

bStaticsAsWindows
(From Centura/Gupta/SQL Windows Help)

The bStaticsAsWindows variable alters the configuration of static objects. Static objects are background text, lines, and frames. In SQLWindows 4.0 and later, static objects are painted. This change improves runtime performance when creating and painting form windows and dialog boxes.
The bStaticsAsWindows variable allows you to force an application to create lines, frames, and background text as real windows. By setting this variable to TRUE, you eliminate the performance advantage of the SQLWindows 4.0 and later implementation.

Setting this variable to TRUE

Before creating a top level window, go to the On SAM_AppStartup portion of the SQLWindows Outline. Under Global Declarations, set bStaticsAsWindows to TRUE. Since bStaticsAsWindows is a global system variable, the value will persit until you change it.

Wednesday, March 31, 2004

Tips and Trik in Window

Change Dialog/Window Icon runtime
WM_SETICON
Set hIcon = ExtractIconA( GetWindowLongA( hWndForm, GWL_HINSTANCE ),
"USER32.DLL", 2 )
Call SalSendMsg( hWndForm, WM_SETICON, ICON_SMALL, hIcon )

Mencari suatu windows di open atau tidak
If SalFindWindow( hWndMDI, 'fwEmployee') != hWndNULL

Multi line text pada button
On WM_NCCREATE
Call SetWindowLongA( hWndItem, GWL_STYLE,
GetWindowLongA( hWndItem, GWL_STYLE ) | BS_MULTILINE )

atau dengan:
Call VisWinSetStyle( hWndItem, BS_MULTILINE, TRUE )

Thursday, March 18, 2004

Posting Gupta Centura Software

Bagian ini sengaja gue buat untuk posting macem-macem tips, trik, masalah, news dan lain-lain nya dengan topik ngga jauh dari Gupta/Centura Software.

Kenapa?
Karena software ini (Bukan VB, Delphi atau pun C++) yg di pilih kantor untuk menyelesaikan berbagai project.