exobject.as [拡張オブジェクトモジュール]
;*******************************************************************************
; Extension Object module Ver1.0a [2007.09.23]
; Programmed in HSP Ver3.1 ONION software (http://hsp.tv/)
; Copyright (C) 2007 by abo, all rights reserved.
;*******************************************************************************
#ifdef __hsp30__
#ifndef __EXOBJECT__
#define global __EXOBJECT__
#module "exobject"
;#define global WS_VISIBLE 0x10000000
;#define global WS_CHILD 0x40000000
;#define global WS_CLIPCHILDREN 0x02000000
;#define global WS_TABSTOP 0x00010000
;#define global WS_EX_CLIENTEDGE 0x00000200
;#define global GWL_STYLE -16 ;ウィンドウスタイル
;#define global GWL_EXSTYLE -20 ;拡張ウィンドウスタイル
#define global COLOR_3DFACE 15
; ------------------------------------------------------------------------------
; Exobjfont - expansion object font module // 拡張コントロールフォントモジュール
; 戻り値 : exobjhwnd // 拡張コントロールハンドル
;
; Exobjfont(p1)
; p1: exobjhwnd // 拡張コントロールハンドル
; ------------------------------------------------------------------------------
#defcfunc Exobjfont int exobjhwnd
dim LogFont_status,60 ;LOGFONT構造体
mref bmscr,67
hfont=bmscr(38) : holdfon=bmscr(39)
if hfont!holdfon {
holdfon=hfont
GetObject holdfon,60,varptr(LogFont_status) ;オブジェクト情報を取得
hfont=_CreateFontIndirect(varptr(LogFont_status)) ;論理フォントハンドル
}
SendMessage exobjhwnd,WM_SETFONT,hfont,1
dim LogFont_status,0
return exobjhwnd
; ==============================================================================
;// trackbar control
; ==============================================================================
#define global TRACKBAR_CLASS "msctls_trackbar32"
;#define global TBM_GETPOS $00000400
;#define global TBM_SETPOS $00000405
;#define global TBM_SETRANGE $00000406
;#define global TBM_GETTIC $00000403
;#define global TBM_SETTIC $00000404
;#define global TBM_GETRANGEMAX $00000402
;#define global TBM_SETRANGEMAX $00000408
;#define global TBM_CLEARTICS $00000409
;#define global TBM_GETRANGEMIN $00000401
;#define global TBM_SETRANGEMIN $00000407
#define global TBS_AUTOTICKS $0001; //チックマーク(目盛)を自動的に表示する
#define global TBS_VERT $0002; //垂直トラックバー
#define global TBS_HORZ $0000; //水平トラックバー(デフォルト)
#define global TBS_TOP $0004; //チックマークを上側に表示
#define global TBS_BOTTOM $0000; //チックマークを下側に表示(デフォルト)
#define global TBS_LEFT $0004; //チックマークを左側に表示
#define global TBS_RIGHT $0000; //チックマークを右側に表示(デフォルト)
#define global TBS_BOTH $0008; //チックマークを両側に表示
#define global TBS_NOTICKS $0010; //チックマークなし
#define global TBS_ENABLESELRANGE $0020; //範囲選択を可能にする
#define global TBS_FIXEDLENGTH $0040; //スライダーの長さを可変にできる
#define global TBS_NOTHUMB $0080; //つまみなし
; ------------------------------------------------------------------------------
; Createtrackbar - trackbar control module // トラックバーコントロールモジュール
; 戻り値 : trackhwnd // トラックバーコントロールハンドル
;
; Createtrackbar(p1, p2, p3, p4, p5)
; p1: nPosx // X位置
; p2: nPosy // Y位置
; p3: nWidth // Xサイズ
; p4: nHeight // Yサイズ
; p5: Style // スタイルオプション
; -----------------------------------------------------------
; 0 デフォルト(横型:目盛り下側)スタイル
; 1 目盛り自動挿入オプション
; 2 縦型:目盛り右側スタイル
; 4 目盛り反対オプション(横型→上側)(縦型→左側)
; 8 目盛り両側オプション
; $10 目盛り無しオプション
; $20 領域選択スタイル
; $80 スライダーなしスタイル
; $100 ツールチップオプション
; -----------------------------------------------------------
; ------------------------------------------------------------------------------
#defcfunc Createtrackbar int nPosx,int nPosy,int nWidth,int nHeight,int Style
pos nPosx,nPosy : winobj TRACKBAR_CLASS,"",0,WS_VISIBLE|WS_CHILD|Style,nWidth,nHeight
return objinfo_hwnd(stat)
; ------------------------------------------------------------------------------
; settrackrng - トラックバーコントロール範囲の設定
;
; settrackrng p1, p2, p3
; p1: trackhwnd // トラックバーコントロールハンドル
; p2: Value min // 開始位置
; p3: Value max // 終了位置
; ------------------------------------------------------------------------------
#define global settrackrng(%1,%2,%3) sendmsg %1,TBM_SETRANGE,1,MAKELONG(%2,%3)
; ------------------------------------------------------------------------------
; settrackpos - トラックバーコントロールつまみ位置の設定
;
; settrackpos p1, p2
; p1: trackhwnd //トラックバーコントロールハンドル
; p2: Value // 設定値
; ------------------------------------------------------------------------------
#define global settrackpos(%1,%2) sendmsg %1,TBM_SETPOS,1,%2
; ------------------------------------------------------------------------------
; Gettrackpos - トラックバーコントロールつまみ位置の取得
; 戻り値 : Value //設定値
;
; Gettrackpos(p1)
; p1: trackhwnd //トラックバーコントロールハンドル
; ------------------------------------------------------------------------------
#defcfunc Gettrackpos int trackhwnd
sendmsg trackhwnd,TBM_GETPOS,0,NULL
return stat
; ------------------------------------------------------------------------------
; settrackmrk - トラックバーコントロール目盛りの設定
;
; settrackmrk p1, p2
; p1: trackhwnd //トラックバーコントロールハンドル
; p2: Value // 設定値
; ------------------------------------------------------------------------------
#define global settrackmrk(%1,%2) sendmsg %1,TBM_SETTIC,0,%2
; ------------------------------------------------------------------------------
; clrtracktic - トラックバーコントロール目盛りの消去
;
; clrtracktic p1
; p1: trackhwnd //トラックバーコントロールハンドル
; ------------------------------------------------------------------------------
#define global clrtracktic(%1) sendmsg %1,TBM_CLEARTICS,0,0
; ==============================================================================
;// updown control
; ==============================================================================
#define global UPDOWN_CLASS "msctls_updown32"
;#define global UDM_SETRANGE32 $0000046F
;#define global UDM_GETPOS32 $00000472
;#define global UDM_SETPOS32 $00000471
;#define global UDM_GETBUDDY $0000046A
;#define global UDM_SETBUDDY $00000469
;#define global UDS_WRAP $0001; // 範囲を越えたとき値を折り返す
;#define global UDS_SETBUDDYINT $0002; // 位置の変更をバディウィンドウに自動的に表示する
;#define global UDS_ALIGNRIGHT $0004; // アップダウンをバディウィンドウの右に配置
;#define global UDS_ALIGNLEFT $0008; // アップダウンをバディウィンドウの左に配置
;#define global UDS_AUTOBUDDY $0010; // Zオーダが一つ前のウィンドウを自動的にバディとする
;#define global UDS_ARROWKEYS $0020; // キーボード入力スタイル
;#define global UDS_HORZ $0040; // 水平スタイル
;#define global UDS_NOTHOUSANDS $0080; // 三桁ごとの区切り記号を表示しない(スピンコントロールの場合)
;#define global UDS_HOTTRACK $0100; // ホットトラックスタイル
; ------------------------------------------------------------------------------
; Createupdown - updown control module // アップダウンコントロールモジュール
; 戻り値 : updownhwnd //アップダウンコントロールハンドル
;
; Createupdown(p1, p2, p3, p4, p5)
; p1: nPosx // X位置
; p2: nPosy // Y位置
; p3: nWidth // Xサイズ
; p4: nHeight // Yサイズ
; p5: Style // スタイルオプション
; -----------------------------------------------------------
; 0 デフォルト(垂直)スタイル
; 1 最小、最大値に達したときに折り返す
; 2 数値を使う
; 4 オブジェクトの右側に付ける
; 8 オブジェクトの左側に付ける
; $20 キーボード入力スタイル
; $40 水平スタイル
; $100 ホットトラックスタイル
; -----------------------------------------------------------
; ------------------------------------------------------------------------------
#defcfunc Createupdown int nPosx,int nPosy,int nWidth,int nHeight,int Style
pos nPosx,nPosy : winobj UPDOWN_CLASS,"",0,WS_VISIBLE|WS_CHILD|Style,nWidth,nHeight
return objinfo_hwnd(stat)
; ------------------------------------------------------------------------------
; setupdownrng - アップダウンコントロール範囲の設定
;
; updownrng p1, p2, p3
; p1: updownhwnd // アップダウンコントロールハンドル
; p2: Value min // 開始位置
; p3: Value max // 終了位置
; ------------------------------------------------------------------------------
#define global setupdnrng(%1,%2,%3) sendmsg %1,UDM_SETRANGE32,%2,%3
; ------------------------------------------------------------------------------
; setupdownpos - アップダウンコントロール位置の設定
;
; setupdownpos p1, p2
; p1: updownhwnd // アップダウンコントロールハンドル
; p2: Value // 設定値
; ------------------------------------------------------------------------------
#define global setupdnpos(%1,%2) sendmsg %1,UDM_SETPOS32,0,%2
; ------------------------------------------------------------------------------
; Getupdownpos - アップダウンコントロール位置の取得
; 戻り値 : Value // 設定値
;
; Getupdownpos(p1)
; p1: updownhwnd // アップダウンコントロールハンドル
; ------------------------------------------------------------------------------
#defcfunc Getupdnpos int updnhwnd
sendmsg updnhwnd,UDM_GETPOS32,0,NULL
return stat
; ==============================================================================
;// statictext control
; ==============================================================================
;#define global WM_SETTEXT 0x000C
;#define global WM_GETTEXT 0x000D
;#define global WM_SETFONT 0x0030
#define global SS_LEFT 0; // 左寄せテキスト、ワードラップ(デフォルト)
#define global SS_CENTER 1; // 中央寄せテキスト、ワードラップ
#define global SS_RIGHT 2; // 右寄せテキスト、ワードラップ
#define global SS_LEFTNOWORDWRAP 12; // 左寄せテキスト、ワードラップなし、タブ展開
#define global SS_SUNKEN $1000; // 周囲をくぼんだ線で描画する
; ------------------------------------------------------------------------------
; Createstatic - static text control module // スタティックテキストコントロールモジュール
; 戻り値 : statichwnd // スタティックテキストコントロールハンドル
;
; Createstatic(p1, p2, p3, p4, p5, p6)
; p1: nPosx // X位置
; p2: nPosy // Y位置
; p3: nWidth // Xサイズ
; p4: nHeight // Yサイズ
; p5: "String" // スタティックテキストの文字列
; p6: Style // スタイルオプション
; -----------------------------------------------------------
; 0 デフォルト左寄せテキスト
; 1 中央寄せテキスト
; 2 右寄せテキスト
; $1000 周囲をくぼんだ線で描画する
; -----------------------------------------------------------
; ------------------------------------------------------------------------------
#define global ctype Createstatic(%1,%2,%3,%4,%5,%6=0) _Createstatic(%1,%2,%3,%4,%5,%6)
#defcfunc _Createstatic int nPosx,int nPosy,int nWidth,int nHeight,str String,int Style
pos nPosx,nPosy : winobj "STATIC",String,0,WS_VISIBLE|WS_CHILD|Style,nWidth,nHeight
return Exobjfont(objinfo_hwnd(stat))
; ------------------------------------------------------------------------------
; settext - テキストの内容を設定
;
; settext p1, p2
; p1: statichwnd // スタティックテキストコントロールハンドル
; p2: "String" // "テキスト"
; ------------------------------------------------------------------------------
#define global settext(%1,%2) \
sendmsg %1, WM_SETTEXT, 0, %2
; ------------------------------------------------------------------------------
; Gettext - テキストの内容を取得
; 戻り値 : // テキストの内容
;
; Gettext(p1, p2)
; p1: statichwnd // スタティックテキストコントロールハンドル
; p2: nByte // 取得バイト数
; ------------------------------------------------------------------------------
#defcfunc Gettext int statichwnd, int nByte
szBuffer="" : sendmsg statichwnd, WM_GETTEXT, nByte, varptr(szBuffer)
return szBuffer
;--------+---------+---------+---------+---------+---------+---------+---------+
; 3Dラインマクロ
;--------+---------+---------+---------+---------+---------+---------+---------+
#define global SS_ETCHEDHORZ 0x10
#define global SS_ETCHEDVERT 0x11
#define global hline3d(%1,%2,%3,%4) \
pos %1,%2 : winobj "STATIC","",,WS_VISIBLE|WS_CHILD|SS_ETCHEDHORZ,%3-%1+4
#define global vline3d(%1,%2,%3,%4) \
pos %1,%2+1 : winobj "STATIC","",,WS_VISIBLE|WS_CHILD|SS_ETCHEDVERT,,%4-%2+3
#define global frame3d(%1,%2,%3,%4,%5,%6) \
hline3d %1,%2,%3,%2 : vline3d %1,%2,%1,%4 : vline3d %3,%2,%3,%4 : \
hline3d %1,%4,%5,%4 : hline3d %6,%4,%3,%4
; ==============================================================================
;// editbox control
; ==============================================================================
#define global ES_LEFT 0 ;左寄せテキスト(デフォルト)
#define global ES_CENTER 1 ;中央寄せテキスト
#define global ES_RIGHT 2 ;右寄せテキスト
#define global ES_NUMBER 0x2000 ;数値テキストのみ
#define global ES_MULTILINE 0x0004 ;複数行エディットコントロール
#define global ES_NOHIDESEL 0x0100 ;フォーカス持っていない場合も反転表示
#define global ES_READONLY 0x0800 ;編集をできないようにします
; ------------------------------------------------------------------------------
; Createeditbox - static text control module // エディットボックスモジュール
; 戻り値 : edithwnd //エディットボックスハンドル
;
; Createeditbox(p1, p2, p3, p4, p5, p6, p7)
; p1: nPosx // X位置
; p2: nPosy // Y位置
; p3: nWidth // Xサイズ
; p4: nHeight // Yサイズ
; p5: Variable // 変数
; p6: Style // スタイルオプション
; -----------------------------------------------------------
; 0 左寄せテキスト(デフォルト)
; 1 中央寄せテキスト
; 2 右寄せテキスト
; $2000 数値テキストのみ
; -----------------------------------------------------------
; p7: exStyle // 拡張スタイルオプション
; -----------------------------------------------------------
; 0x00000200 フレーム付き(デフォルト)
; 0 フレーム無し
; -----------------------------------------------------------
; ------------------------------------------------------------------------------
#define global ctype Createeditbox(%1,%2,%3,%4,%5,%6=ES_LEFT,%7=WS_EX_CLIENTEDGE) _Createeditbox(%1,%2,%3,%4,%5,%6,%7)
#defcfunc _Createeditbox int nPosx,int nPosy,int nWidth,int nHeight,var Variable,int Style,int exStyle
pos nPosx,nPosy : Variable="" : winobj "EDIT",Variable,exStyle,WS_VISIBLE|WS_CHILD|Style,nWidth,nHeight
return Exobjfont(objinfo_hwnd(stat))
; ==============================================================================
;// object
; ==============================================================================
; ------------------------------------------------------------------------------
; objcursor - オブジェクトのカーソルを設定
;
; objcursor p1, p2
; p1: objecthwnd // オブジェクトハンドル
; p2: リソースID (IDC_ARROW〜IDC_HELP, 省略時は IDC_ARROW)
; ------------------------------------------------------------------------------
;#define global IDC_ARROW 32512
;#define global IDC_HAND 32649
#define global objcursor(%1,%2=IDC_ARROW) \
hwCursor=_LoadCursor(NULL,%2) : SetClassLong %1,-12,hwCursor : SetCursor hwCursor
; ------------------------------------------------------------------------------
; objenable - オブジェクトの使用可能状態を設定
;
; objenable p1, p2
; p1: objecthwnd // オブジェクトハンドル
; p2: 1:有効 0:無効 (省略時は 1)
; ------------------------------------------------------------------------------
#define global objenable(%1,%2=1) EnableWindow %1,%2
; ------------------------------------------------------------------------------
; objshow - オブジェクトの表示状態を設定
; objreshow - オブジェクトの再表示
;
; objshow p1, p2
; p1: objecthwnd // オブジェクトハンドル
; p2: 1:表示 0:非表示 (省略時は 1)
; ------------------------------------------------------------------------------
#define global objshow(%1,%2=1) ShowWindow %1,%2
#define global objreshow(%1) ShowWindow %1,0 : ShowWindow %1,1
;// mesbox object
; ------------------------------------------------------------------------------
; mesboxtab - mesboxオブジェクトのTAB間隔を設定
;
; mesboxtab p1, p2
; p1: mesboxhwnd // オブジェクトハンドル
; p2: TAB間隔(変数)
; ------------------------------------------------------------------------------
; wParam タブストップの設定方法を指定する値
; 0 lParamを無視(デフォルト値を使用)
; 1 lParamの値で一定間隔に設定する
; >1 lParamの配列に従って設定する
; lParam
; wParam=0 lParam=0
; wParam=1 間隔を指定する値
; wParam>1 タブストップ位置の入ったLong型変数の配列
; ------------------------------------------------------------------------------
;#define global EM_SETTABSTOPS 0xCB
#define global mesboxtab(%1,%2) \
sendmsg %1,EM_SETTABSTOPS,1,varptr(%2)
; ------------------------------------------------------------------------------
; StrUpper - 文字列を大文字に変換
; 戻り値 : //大文字
;
; StrUpper(p1)
; p1: String //文字列
; ------------------------------------------------------------------------------
#defcfunc StrUpper str String
szBuffer=String : CharUpper varptr(szBuffer)
return szBuffer
; ==============================================================================
; Createbutton - button(gosub) object module // ボタンモジュール(gosub)
; 戻り値 : buttonhwnd //ボタンハンドル
;
; Createbutton(p1, p2, p3, p4, p5, p6)
; p1: nPosx // X位置
; p2: nPosy // Y位置
; p3: width // Xサイズ
; p4: height // Yサイズ
; p5: String "button name" // ボタンの名前
; p6: pLabel [label pointer] // ジャンプするラベル
; ==============================================================================
#defcfunc Createbutton int nPosx,int nPosy,int nWidth,int nHeight,str String,var pLabel
pos nPosx,nPosy : objsize nWidth,nHeight : button gosub String,pLabel
return objinfo_hwnd(stat)
; ==============================================================================
; Createchkbox - checkbox object module // チェックボックスモジュール
; 戻り値 : chkboxhwnd=チェックボックスハンドル
;
; Createchkbox(p1, p2, p3, p4, p5, p6)
; p1: nPosx // X位置
; p2: nPosy // Y位置
; p3: nWidth // Xサイズ
; p4: nHeight // Yサイズ
; p5: "String" // チェックボックスの文字列
; p6: Variable // チェックボックスの変数
; ==============================================================================
#defcfunc Createchkbox int nPosx,int nPosy,int nWidth,int nHeight,str String,var Variable
pos nPosx,nPosy : objsize nWidth,nHeight : chkbox String,Variable
return objinfo_hwnd(stat)
; ------------------------------------------------------------------------------
; setchkbox - チェックボックスの値を設定
;
; setchkbox p1, p2
; p1: chkboxhwnd // チェックボックスハンドル
; p2: Variable // チェックボックスの変数
; ------------------------------------------------------------------------------
#define global setchkbox(%1,%2) \
sendmsg %1, BM_SETCHECK, %2, 0
; ------------------------------------------------------------------------------
; Getchkbox - チェックボックスの値を取得
; 戻り値 : Value //設定値
;
; Getchkbox(p1)
; p1: chkboxhwnd // チェックボックスハンドル
; ------------------------------------------------------------------------------
#defcfunc Getchkbox int chkboxhwnd
sendmsg chkboxhwnd,BM_GETCHECK,0,0
return stat
; ------------------------------------------------------------------------------
; setstygrpbox - スタイルをグループボックスに設定
;
; setstygrpbox p1
; p1: chkboxhwnd // チェックボックスハンドル
; ------------------------------------------------------------------------------
#define global setstygrpbox(%1) \
sendmsg %1, BM_SETSTYLE, BS_GROUPBOX, 0
;#define global LB_ADDSTRING $0180; // 項目文字列を追加する
;#define global LB_INSERTSTRING $0181; // 項目文字列を挿入する
;#define global LB_DELETESTRING $0182; // 項目文字列を削除する
;#define global LB_RESETCONTENT $0184; // 全項目を削除する
;#define global LB_GETTEXT $0189; // 特定の項目の文字列を取得する
;#define global LB_SETITEMHEIGHT $01A0; // 項目の高さの設定
;#define global LB_GETITEMHEIGHT $01A1; // 項目の高さの取得
; ==============================================================================
; Createlistbox - listbox object module // リストボックスモジュール
; 戻り値 : listboxhwnd // リストボックスハンドル
;
; Createlistbox(p1, p2, p3, p4, p5, p6, p7)
; p1: nPosx // X位置
; p2: nPosy // Y位置
; p3: nWidth // Xサイズ
; p4: nHeight // Yサイズ
; p5: Variable // リストボックスの数値型変数
; p6: nExHeight // 拡張Yサイズ
; p7: "String" // リストボックスの内容を示す文字列
; ==============================================================================
#defcfunc Createlistbox int nPosx,int nPosy,int nWidth,int nHeight,var variable,int nExHeight,str String
pos nPosx,nPosy : objsize nWidth,nHeight : listbox Variable,nExHeight,String
return objinfo_hwnd(stat)
; ------------------------------------------------------------------------------
; lstaddstring - 項目文字列を追加
;
; lstaddstring p1, p2
; p1: listboxhwnd // リストボックスハンドル
; p2: バッファ変数名
; ------------------------------------------------------------------------------
#define global lstaddstring(%1,%2) \
sendmsg %1, LB_ADDSTRING, 0,%2
; ------------------------------------------------------------------------------
; lstreset - 全項目を削除
;
; lstreset p1
; p1: listboxhwnd // リストボックスハンドル
; ------------------------------------------------------------------------------
#define global lstreset(%1) \
sendmsg %1, LB_RESETCONTENT, 0, 0
; ------------------------------------------------------------------------------
; lstcursel - 項目の選択
;
; lstcursel p1, p2
; p1: listboxhwnd // リストボックスハンドル
; p2: index //インデックス
; ------------------------------------------------------------------------------
#define global lstcursel(%1,%2) \
sendmsg %1,LB_SETCURSEL,%2,0
; ------------------------------------------------------------------------------
; Getlsttext - 特定の項目の文字列を取得
; 戻り値 : 項目の文字列
;
; Getlsttext(p1)
; p1: listboxhwnd // リストボックスハンドル
; ------------------------------------------------------------------------------
#defcfunc Getlsttext int listhwnd
szBuffer="" : sendmsg listhwnd,LB_GETTEXT,0,varptr(szBuffer)
return szBuffer
; ==============================================================================
; Createcombox - combox object module // コンボボックスモジュール
; 戻り値 : comboxhwnd //コンボボックスハンドル
;
; Createcombox(p1, p2, p3, p4, p5, p6, p7)
; p1: nPosx // X位置
; p2: nPosy // Y位置
; p3: nWidth // Xサイズ
; p4: nHeight // Yサイズ
; p5: Variable // コンボボックスの数値型変数
; p6: nExHeight // 拡張Yサイズ
; p7: "String" // コンボボックスの内容を示す文字列
; ==============================================================================
#defcfunc Createcombox int nPosx,int nPosy,int nWidth,int nHeight,var variable,int nExHeight,str String
pos nPosx,nPosy : objsize nWidth,nHeight : combox Variable,nExHeight,String
return objinfo_hwnd(stat)
; ------------------------------------------------------------------------------
; cmbcursel - 項目の選択
;
; cmbcursel p1, p2
; p1: comboxhwnd // コンボボックスハンドル
; p2: index //インデックス
; ------------------------------------------------------------------------------
#define global cmbcursel(%1,%2) \
sendmsg %1,CB_SETCURSEL,%2,0
; ------------------------------------------------------------------------------
; childscreen - 子ウィンドウの作成
;
; childscreen p1, p2, p3, p4, p5, p6
; p1: Parenthwnd // 親ウィンドウハンドル
; p2: nChildid // 子ウィンドウID
; p3: nPosx // X位置
; p4: nPosy // Y位置
; p5: nWidth // Xサイズ
; p6: nHeight // Yサイズ
; ------------------------------------------------------------------------------
#deffunc childscreen int Parenthwnd, int nChildid, int nPosx, int nPosy, int nWidth, int nHeight
bgscr nChildid,,,2 ;// 子ウィンドウの作成
SetWindowLong hwnd, GWL_STYLE, _GetWindowLong(hwnd, GWL_STYLE)&$7FFFFFFF|$40000000 ;//子ウィンドウスタイルの変更
SetWindowLong hwnd, GWL_EXSTYLE, _GetWindowLong(hwnd, GWL_EXSTYLE)|$200 ;//子ウィンドウ拡張スタイルの変更
SetParent hwnd, Parenthwnd ;// 親ウィンドウの設定
width nWidth,nHeight,nPosx,nPosy ;// 移動
return
; ------------------------------------------------------------------------------
; listboxarray - リストボックスアレイの作成
;
; listboxarray p1, p2, p3, p4, p5
; p1: nPosx // X位置
; p2: nPosy // Y位置
; p3: hListBox // リストボックスハンドル[配列]
; p4: nList // リストボックス数
; p5: rgbCol3df // リストボックス背景色
; ------------------------------------------------------------------------------
#deffunc listboxarray int nPosx, int nPosy, array hListBox, int nList, int rgbCol3df
#const STC_W1 460
#const STC_W2 20
#const STC_h1 18
#const LST_w1 STC_W2+3
#const LST_h1 STC_h1+4
STC_x1=nPosx
STC_y1=nPosy
LST_x1=STC_x1+25
LST_y1=STC_y1+18
dim hStatic,3
dim hListBox,nList
hCrIdxStc=Createstatic(STC_x1, STC_y1, STC_W1, STC_h1," 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F")
objcolor hCrIdxStc,rgbCol3df,RGB(0,0,0)
repeat nList
if cnt\16=0 {
hStatic(cnt/16)=Createstatic(STC_x1, STC_y1+((cnt/16)+1)*18, STC_W2, STC_h1,strf("%02x",cnt))
objcolor hStatic(cnt/16),rgbCol3df,RGB(0,0,0)
}
hListBox(cnt)=Createlistbox(LST_x1+(cnt\16)*27+((cnt\16)/8)*9,LST_y1+(cnt/16)*18,LST_w1,LST_h1,x,0,""),hListBox(cnt)
SetWindowLong hListBox(cnt), GWL_EXSTYLE, 0 ; スタイルを変えて
SetWindowPos hListBox(cnt),"","","","","",SWP_DRAWFRAME|SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE
sendmsg hListBox(cnt),LB_SETCURSEL,-1,0
objcolor hListBox(cnt),rgbCol3df,RGB(0,0,255)
loop
return
#global
#endif ; __EXOBJECT__
#endif ; __hsp30__
;--------------------------------------------------------------- (EOF) ---------