#include "resource.h"
#pragma once
#include <commctrl.h>
#pragma comment(lib,"comctl32.lib")
HWND m_CTab[2]
LRESULT CALLBACK Tab1_DlgProc(HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK Tab2_DlgProc(HWND, UINT, WPARAM, LPARAM)
BOOL CreateTabDialog(HWND hParent)
void UpdateTab(HWND hParent)
HINSTANCE hInst
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd)
{
hInst = hInstance
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC) DlgProc)
return 0
}
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR etat = (LPNMHDR) lParam
switch(Msg)
{
case WM_INITDIALOG:
InitCommonControls()
CreateTabDialog(hWnd)
break
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_QUITTER:
EndDialog(hWnd,IDC_QUITTER)
break
case IDC_APROPOS:
MessageBox(hWnd,"123","A Propos",MB_ICONINFORMATION)
break
}
break
case WM_NOTIFY:
switch(etat->code)
{
case TCN_SELCHANGE:
UpdateTab(hWnd)
break
}
break
case WM_CLOSE:
EndDialog(hWnd,IDC_QUITTER)
break
default:
return(FALSE)
}
return(TRUE)
}
BOOL CreateTabDialog(HWND hParent)
{
HWND hTabCtl = GetDlgItem(hParent, IDC_TABCTL)
TCITEM tci
m_CTab[0] = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TAB1), hParent, (DLGPROC) Tab1_DlgProc)
m_CTab[1] = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TAB2), hParent, (DLGPROC) Tab2_DlgProc)
tci.mask = TCIF_TEXT
tci.pszText = "Onglet 1"
SendMessage(hTabCtl, TCM_INSERTITEM, 0, (LPARAM) &tci)
tci.pszText = "Onglet 2"
SendMessage(hTabCtl, TCM_INSERTITEM, 1, (LPARAM) &tci)
RECT rcTabCtl
GetWindowRect(hTabCtl, &rcTabCtl)
SendMessage(hTabCtl, TCM_ADJUSTRECT, FALSE, (LPARAM) &rcTabCtl)
MapWindowPoints(NULL, hParent, (LPPOINT) &rcTabCtl, 2)
for(int i = 0 i <= 1 i++)
{
RECT rcTab
GetWindowRect(m_CTab[i], &rcTab)
int x = (rcTabCtl.left+rcTabCtl.right)/2 - (rcTab.right-rcTab.left)/2
int y = (rcTabCtl.top+rcTabCtl.bottom)/2 - (rcTab.bottom-rcTab.top)/2
SetWindowPos(m_CTab[i], NULL, x, y, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOREDRAW)
}
SendMessage(hTabCtl, TCM_SETCURSEL, 0, 0)
UpdateTab(hParent)
return true
}
void UpdateTab(HWND hParent)
{
HWND hTabCtl = GetDlgItem(hParent, IDC_TABCTL)
int nSelected = SendMessage(hTabCtl, TCM_GETCURSEL, 0, 0)
for(int i = 0 i <= 1 i++)
ShowWindow(m_CTab[i], (i==nSelected) ? SW_SHOW : SW_HIDE)
}
//tab1
#include <windows.h>
#include "resource.h"
LRESULT CALLBACK Tab1_DlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_MESSAGE:
MessageBox(hDlg,"Juste un ptit message pour dire qu'on est sur l'onglet n?","Onglet 1", MB_ICONINFORMATION)
break
}
break
}
return 0
}
//tab2
#include <windows.h>
#include "resource.h"
LRESULT CALLBACK Tab2_DlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_COUCOU:
MessageBox(hDlg,"Un ptit COUCOU pour dire que tout marche pour le mieux!","Onglet 2", MB_ICONINFORMATION)
break
}
break
}
return 0
}
#define IDD_DIALOG1 101
#define IDD_DIALOG2 102
#define IDD_TAB1 102
#define IDD_TAB2 103
#define IDC_TAB1 1000
#define IDC_TABCTL 1000
#define IDC_CHECK1 1001
#define IDC_RADIO1 1002
#define IDC_MESSAGE 1003
#define IDC_COUCOU 1005
#define IDC_QUITTER 1006
#define IDC_APROPOS 1007
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1008
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
摘要:如果已知每张像片的6个外方位元素,就能确定被摄物体与航摄像片的关系。因此,利用单像空间后方交会的方法,可以迅速的算出每张像片的6个外方位元素。而前方交会的计算,可以算出像片上点对应于地面点的三维坐标。基于这两点,利用计算机强大的运算能力,可以代替人脑快速的完成复杂的计算过程。关键词:后方交会,前方交会,外方位元素,C++编程
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)