|
|
// *********************************************************
// メッセージボックス
// 戻り値 : 押されたボタンのID
// *********************************************************
int LboxWintool::MsgBox(
HWND hWndOwner, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType )
{
return LboxMsgBox( hWndOwner, lpText, lpCaption, uType );
}
int LboxWintool::MsgBox(
LPCTSTR lpText, LPCTSTR lpCaption, UINT uType )
{
return LboxMsgBox(
LboxWintool::hWndtool,
lpText,
lpCaption,
uType
);
}
| |
|
|
|
|
// *********************************************************
// メッセージのポスト
// 戻り値 : 処理の結果
// *********************************************************
LRESULT LboxWintool::PostMsg( UINT Msg )
{
return PostMessage(
LboxWintool::hWnd,
Msg,
0L,
0L
);
}
LRESULT LboxWintool::PostMsg( UINT Msg, WPARAM wParam )
{
return PostMessage(
LboxWintool::hWnd,
Msg,
wParam,
0L
);
}
LRESULT LboxWintool::PostMsg(
UINT Msg, WPARAM wParam, LPARAM lParam )
{
return PostMessage(
LboxWintool::hWnd,
Msg,
wParam,
lParam
);
}
| |
|
|
ChangeStyle, ChangeExStyle |
|
|
// *********************************************************
// ウインドウの位置とサイズを初期化ファイルに保存
// 戻り値 : 無し
// *********************************************************
void LboxWintool::SavePositonAndSize( LPTSTR lpSection, LboxInifile *obj )
{
if ( IsIconic( LboxWintool::hWnd ) ) {
return;
}
if ( IsZoomed( LboxWintool::hWnd ) ) {
return;
}
RECT rt;
char szWork[20];
GetWindowRect( LboxWintool::hWnd, &rt );
if( rt.left < 0 ) {
return;
}
if( rt.top < 0 ) {
return;
}
if( rt.right-rt.left <= 0 ) {
return;
}
if( rt.bottom-rt.top <= 0 ) {
return;
}
wsprintf( szWork, "%d", rt.left );
obj->WriteString( lpSection, "Left", szWork );
wsprintf( szWork, "%d", rt.top );
obj->WriteString( lpSection, "Top", szWork );
wsprintf( szWork, "%d", rt.right-rt.left );
obj->WriteString( lpSection, "Width", szWork );
wsprintf( szWork, "%d", rt.bottom-rt.top );
obj->WriteString( lpSection, "Height", szWork );
}
| |
|
|
|
|
// *********************************************************
// ウインドウの位置とサイズを初期化ファイルより復帰
// 戻り値 : 通常は true, Left エントリが無かった場合は false
// でなにもしない
// *********************************************************
BOOL LboxWintool::RestorePositonAndSize( LPTSTR lpSection, LboxInifile *obj )
{
int x,y,w,h;
char szWork[20],szSize[20];
obj->GetString( lpSection, "Left", "NOTHING", szWork, 20 );
if ( lstrcmp( szWork, "NOTHING" ) == 0 ) {
return false;
}
else {
x = StrToInt( szWork );
}
obj->GetString( lpSection, "Top", "0", szWork, 20 );
y = StrToInt( szWork );
HWND hDesktop;
RECT rt;
hDesktop = GetDesktopWindow( );
GetWindowRect( hDesktop, &rt );
wsprintf( szSize, "%d", rt.right );
obj->GetString( lpSection, "Width", szSize, szWork, 20 );
w = StrToInt( szWork );
wsprintf( szSize, "%d", rt.bottom - 32 );
obj->GetString( lpSection, "Height", szSize, szWork, 20 );
h = StrToInt( szWork );
LboxWintool::MoveWindow( x, y );
LboxWintool::ChangeWindowSize( w, h );
return true;
}
| |
|
|
GetClientWidth, GetClientHeight |
|
|
// *********************************************************
// WM_COMMAND メッセージのポスト
// 戻り値 : 処理の結果
// *********************************************************
// ウインドウ ID のみ
LRESULT LboxWintool::PostCommand( WORD wID )
{
return PostMessage(
LboxWintool::hWnd,
WM_COMMAND,
MAKEWPARAM(wID,0),
0L
);
}
// ウインドウ ID と NotifyCode
LRESULT LboxWintool::PostCommand( WORD wID, WORD wNotifyCode )
{
return PostMessage(
LboxWintool::hWnd,
WM_COMMAND,
MAKEWPARAM(wID,wNotifyCode),
0L
);
}
// ウインドウ ID と NotifyCode と lParam
LRESULT LboxWintool::PostCommand(
WORD wID, WORD wNotifyCode, DWORD lParam )
{
return PostMessage(
LboxWintool::hWnd,
WM_COMMAND,
MAKEWPARAM(wID,wNotifyCode),
(LPARAM)lParam
);
}
| |
|
|
|