by konisi » 2008年4月21日(月) 21:28
コード: 全て選択
Sub MainWnd_CommandButton2_Click()
Dim rc As RECT,pa As POINTAPI
Dim buf[1023] As Byte'表示用
'スクリーン座標の取得
GetWindowRect(GetDlgItem(hMainWnd,Static1),rc)
'クライアント座標(ウインドウ座標)へ変換
pa.x=rc.left
pa.y=rc.top
ScreenToClient(hMainWnd,pa)
'表示
wsprintf(buf,Ex"Screen : %d x %d\r\nWindow : %d x %d",rc.top,rc.left,pa.x,pa.y)
MessageBox(hMainWnd,buf,"pos",MB_OK)
End Sub
こんなコードを作ってみたのですが、説明は必要でしょうか?
[code]Sub MainWnd_CommandButton2_Click()
Dim rc As RECT,pa As POINTAPI
Dim buf[1023] As Byte'表示用
'スクリーン座標の取得
GetWindowRect(GetDlgItem(hMainWnd,Static1),rc)
'クライアント座標(ウインドウ座標)へ変換
pa.x=rc.left
pa.y=rc.top
ScreenToClient(hMainWnd,pa)
'表示
wsprintf(buf,Ex"Screen : %d x %d\r\nWindow : %d x %d",rc.top,rc.left,pa.x,pa.y)
MessageBox(hMainWnd,buf,"pos",MB_OK)
End Sub[/code]こんなコードを作ってみたのですが、説明は必要でしょうか?