全站仪 *** 作步骤:在距离控制点较近且和两个控制点同时通视的地方设站,在菜单程序中找到后方交会程序,点击选择,按提示依次输入两个控制点坐标,确认,按输入坐标顺序依次照准两个控制点,按测量键。这样测站点坐标即可求得。
希望能帮到你。
#include <windows.h>#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 = 0i <= 1i++)
{
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 = 0i <= 1i++)
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_TAB1102
#define IDD_TAB2103
#define IDC_TAB11000
#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_VALUE105
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1008
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)