Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Kelas ini menyediakan metode untuk memanipulasi jendela.
Penting
Kelas ini dan anggotanya tidak dapat digunakan dalam aplikasi yang dijalankan di Windows Runtime.
Sintaks
class CWindow
Anggota
Konstruktor Publik
| Nama | Deskripsi |
|---|---|
CWindow::CWindow |
Konstruktor. |
Metode Publik
| Nama | Deskripsi |
|---|---|
CWindow::ArrangeIconicWindows |
Mengatur semua jendela anak yang diminimalkan. |
CWindow::Attach |
Melampirkan jendela ke CWindow objek. |
CWindow::BeginPaint |
Menyiapkan jendela untuk lukisan. |
CWindow::BringWindowToTop |
Membawa jendela ke bagian atas urutan Z. |
CWindow::CenterWindow |
Tengahkan jendela ke jendela tertentu. |
CWindow::ChangeClipboardChain |
Menghapus jendela dari rantai penampil Clipboard. |
CWindow::CheckDlgButton |
Mengubah status pemeriksaan tombol yang ditentukan. |
CWindow::CheckRadioButton |
Memeriksa tombol radio yang ditentukan. |
CWindow::ChildWindowFromPoint |
Mengambil jendela anak yang berisi titik yang ditentukan. |
CWindow::ChildWindowFromPointEx |
Mengambil jenis jendela anak tertentu yang berisi titik yang ditentukan. |
CWindow::ClientToScreen |
Mengonversi koordinat klien ke koordinat layar. |
CWindow::Create |
Membuat jendela. |
CWindow::CreateCaret |
Membuat bentuk baru untuk tanda sisipan sistem. |
CWindow::CreateGrayCaret |
Membuat persegi panjang abu-abu untuk tanda sisipan sistem. |
CWindow::CreateSolidCaret |
Membuat persegi panjang yang solid untuk sisipan sistem. |
CWindow::DeferWindowPos |
Memperbarui struktur beberapa posisi jendela yang ditentukan untuk jendela yang ditentukan. |
CWindow::DestroyWindow |
Menghancurkan jendela yang terkait dengan CWindow objek. |
CWindow::Detach |
Mencopot jendela dari CWindow objek. |
CWindow::DlgDirList |
Mengisi kotak daftar dengan nama semua file yang cocok dengan jalur atau nama file tertentu. |
CWindow::DlgDirListComboBox |
Mengisi kotak kombo dengan nama semua file yang cocok dengan jalur atau nama file tertentu. |
CWindow::DlgDirSelect |
Mengambil pilihan saat ini dari kotak daftar. |
CWindow::DlgDirSelectComboBox |
Mengambil pilihan saat ini dari kotak kombo. |
CWindow::DragAcceptFiles |
Mendaftarkan apakah jendela menerima file yang diseret. |
CWindow::DrawMenuBar |
Mengurai ulang bilah menu jendela. |
CWindow::EnableScrollBar |
Mengaktifkan atau menonaktifkan panah bilah gulir. |
CWindow::EnableWindow |
Mengaktifkan atau menonaktifkan input. |
CWindow::EndPaint |
Menandai akhir lukisan. |
CWindow::FlashWindow |
Berkedipkan jendela sekali. |
CWindow::GetClientRect |
Mengambil koordinat area klien. |
CWindow::GetDC |
Mengambil konteks perangkat untuk area klien. |
CWindow::GetDCEx |
Mengambil konteks perangkat untuk area klien dan memungkinkan opsi kliping. |
CWindow::GetDescendantWindow |
Mengambil jendela turunan yang ditentukan. |
CWindow::GetDlgControl |
Mengambil antarmuka pada kontrol yang ditentukan. |
CWindow::GetDlgCtrlID |
Mengambil pengidentifikasi jendela (hanya untuk jendela anak). |
CWindow::GetDlgHost |
Mengambil penunjuk ke antarmuka ke kontainer hosting Kontrol ATL. |
CWindow::GetDlgItem |
Mengambil jendela anak yang ditentukan. |
CWindow::GetDlgItemInt |
Menerjemahkan teks kontrol ke bilangan bulat. |
CWindow::GetDlgItemText |
Mengambil teks kontrol. |
CWindow::GetExStyle |
Mengambil gaya jendela yang diperluas. |
CWindow::GetFont |
Mengambil font jendela saat ini. |
CWindow::GetHotKey |
Menentukan hot key yang terkait dengan jendela. |
CWindow::GetIcon |
Mengambil ikon besar atau kecil jendela. |
CWindow::GetLastActivePopup |
Mengambil jendela pop-up aktif terbaru. |
CWindow::GetMenu |
Mengambil menu jendela. |
CWindow::GetNextDlgGroupItem |
Mengambil kontrol sebelumnya atau berikutnya dalam sekelompok kontrol. |
CWindow::GetNextDlgTabItem |
Mengambil kontrol sebelumnya atau berikutnya yang WS_TABSTOP memiliki gaya. |
CWindow::GetParent |
Mengambil jendela induk langsung. |
CWindow::GetScrollInfo |
Mengambil parameter bilah gulir. |
CWindow::GetScrollPos |
Mengambil posisi kotak gulir. |
CWindow::GetScrollRange |
Mengambil rentang bilah gulir. |
CWindow::GetStyle |
Mengambil gaya jendela. |
CWindow::GetSystemMenu |
Membuat salinan menu sistem untuk modifikasi. |
CWindow::GetTopLevelParent |
Mengambil jendela induk atau pemilik tingkat atas. |
CWindow::GetTopLevelWindow |
Mengambil jendela pemilik tingkat atas. |
CWindow::GetTopWindow |
Mengambil jendela anak tingkat atas. |
CWindow::GetUpdateRect |
Mengambil koordinat persegi terkecil yang sepenuhnya menutupi wilayah pembaruan. |
CWindow::GetUpdateRgn |
Mengambil wilayah pembaruan dan menyalinnya ke wilayah tertentu. |
CWindow::GetWindow |
Mengambil jendela yang ditentukan. |
CWindow::GetWindowContextHelpId |
Mengambil pengidentifikasi konteks bantuan jendela. |
CWindow::GetWindowDC |
Mengambil konteks perangkat untuk seluruh jendela. |
CWindow::GetWindowLong |
Mengambil nilai 32-bit pada offset tertentu ke dalam memori jendela tambahan. |
CWindow::GetWindowLongPtr |
Mengambil informasi tentang jendela yang ditentukan, termasuk nilai pada offset tertentu ke dalam memori jendela tambahan. |
CWindow::GetWindowPlacement |
Mengambil status dan posisi acara. |
CWindow::GetWindowProcessID |
Mengambil pengidentifikasi proses yang membuat jendela. |
CWindow::GetWindowRect |
Mengambil dimensi pembatas jendela. |
CWindow::GetWindowRgn |
Mendapatkan salinan wilayah jendela jendela. |
CWindow::GetWindowText |
Mengambil teks jendela. |
CWindow::GetWindowTextLength |
Mengambil panjang teks jendela. |
CWindow::GetWindowThreadID |
Mengambil pengidentifikasi utas yang membuat jendela yang ditentukan. |
CWindow::GetWindowWord |
Mengambil nilai 16-bit pada offset tertentu ke dalam memori jendela tambahan. |
CWindow::GotoDlgCtrl |
Mengatur fokus keyboard ke kontrol dalam kotak dialog. |
CWindow::HideCaret |
Menyembunyikan tanda sisipan sistem. |
CWindow::HiliteMenuItem |
Menyoroti atau menghapus sorotan dari item menu tingkat atas. |
CWindow::Invalidate |
Membatalkan validasi seluruh area klien. |
CWindow::InvalidateRect |
Membatalkan area klien dalam persegi panjang yang ditentukan. |
CWindow::InvalidateRgn |
Membatalkan area klien dalam wilayah yang ditentukan. |
CWindow::IsChild |
Menentukan apakah jendela yang ditentukan adalah jendela anak. |
CWindow::IsDialogMessage |
Menentukan apakah pesan ditujukan untuk kotak dialog yang ditentukan. |
CWindow::IsDlgButtonChecked |
Menentukan status pemeriksaan tombol. |
CWindow::IsIconic |
Menentukan apakah jendela diminimalkan. |
CWindow::IsParentDialog |
Menentukan apakah jendela induk kontrol adalah jendela dialog. |
CWindow::IsWindow |
Menentukan apakah handel jendela yang ditentukan mengidentifikasi jendela yang ada. |
CWindow::IsWindowEnabled |
Menentukan apakah jendela diaktifkan untuk input. |
CWindow::IsWindowUnicode |
Menentukan apakah jendela yang ditentukan adalah jendela Unicode asli. |
CWindow::IsWindowVisible |
Menentukan status visibilitas jendela. |
CWindow::IsZoomed |
Menentukan apakah jendela dimaksimalkan. |
CWindow::KillTimer |
Menghancurkan peristiwa timer. |
CWindow::LockWindowUpdate |
Menonaktifkan atau mengaktifkan gambar di jendela. |
CWindow::MapWindowPoints |
Mengonversi sekumpulan titik dari ruang koordinat jendela ke ruang koordinat jendela lain. |
CWindow::MessageBox |
Menampilkan kotak pesan. |
CWindow::ModifyStyle |
Memodifikasi gaya jendela. |
CWindow::ModifyStyleEx |
Memodifikasi gaya jendela yang diperluas. |
CWindow::MoveWindow |
Mengubah ukuran dan posisi jendela. |
CWindow::NextDlgCtrl |
Mengatur fokus keyboard ke kontrol berikutnya dalam kotak dialog. |
CWindow::OpenClipboard |
Membuka Papan Klip. |
CWindow::PostMessage |
Tempatkan pesan dalam antrean pesan yang terkait dengan utas yang membuat jendela. Mengembalikan tanpa menunggu utas memproses pesan. |
CWindow::PrevDlgCtrl |
Mengatur fokus keyboard ke kontrol sebelumnya dalam kotak dialog. |
CWindow::Print |
Permintaan agar jendela digambar dalam konteks perangkat tertentu. |
CWindow::PrintClient |
Permintaan agar area klien jendela digambar dalam konteks perangkat tertentu. |
CWindow::RedrawWindow |
Memperbarui persegi panjang atau wilayah tertentu di area klien. |
CWindow::ReleaseDC |
Merilis konteks perangkat. |
CWindow::ResizeClient |
Mengubah ukuran jendela. |
CWindow::ScreenToClient |
Mengonversi koordinat layar ke koordinat klien. |
CWindow::ScrollWindow |
Menggulir area klien yang ditentukan. |
CWindow::ScrollWindowEx |
Menggulir area klien yang ditentukan dengan fitur tambahan. |
CWindow::SendDlgItemMessage |
Mengirim pesan ke kontrol. |
CWindow::SendMessage |
Mengirim pesan ke jendela dan tidak kembali hingga prosedur jendela memproses pesan. |
CWindow::SendMessageToDescendants |
Mengirim pesan ke jendela turunan yang ditentukan. |
CWindow::SendNotifyMessage |
Mengirim pesan ke jendela. Jika jendela dibuat oleh utas panggilan, SendNotifyMessage tidak akan kembali hingga prosedur jendela memproses pesan. Jika tidak, ia akan segera kembali. |
CWindow::SetActiveWindow |
Mengaktifkan jendela. |
CWindow::SetCapture |
Mengirim semua input mouse berikutnya ke jendela. |
CWindow::SetClipboardViewer |
Menambahkan jendela ke rantai penampil Clipboard. |
CWindow::SetDlgCtrlID |
Mengubah pengidentifikasi jendela. |
CWindow::SetDlgItemInt |
Mengubah teks kontrol menjadi representasi string dari nilai bilangan bulat. |
CWindow::SetDlgItemText |
Mengubah teks kontrol. |
CWindow::SetFocus |
Mengatur fokus input ke jendela. |
CWindow::SetFont |
Mengubah font jendela saat ini. |
CWindow::SetHotKey |
Mengaitkan hot key dengan jendela. |
CWindow::SetIcon |
Mengubah ikon besar atau kecil jendela. |
CWindow::SetMenu |
Mengubah menu jendela saat ini. |
CWindow::SetParent |
Mengubah jendela induk. |
CWindow::SetRedraw |
Mengatur atau menghapus bendera redraw. |
CWindow::SetScrollInfo |
Mengatur parameter bilah gulir. |
CWindow::SetScrollPos |
Mengubah posisi kotak gulir. |
CWindow::SetScrollRange |
Mengubah rentang bilah gulir. |
CWindow::SetTimer |
Membuat peristiwa timer. |
CWindow::SetWindowContextHelpId |
Mengatur pengidentifikasi konteks bantuan jendela. |
CWindow::SetWindowLong |
Mengatur nilai 32-bit pada offset tertentu ke dalam memori jendela tambahan. |
CWindow::SetWindowLongPtr |
Mengubah atribut jendela yang ditentukan, dan juga menetapkan nilai pada offset yang ditentukan dalam memori jendela tambahan. |
CWindow::SetWindowPlacement |
Mengatur status dan posisi peragaan. |
CWindow::SetWindowPos |
Mengatur ukuran, posisi, dan urutan Z. |
CWindow::SetWindowRgn |
Mengatur wilayah jendela jendela. |
CWindow::SetWindowText |
Mengubah teks jendela. |
CWindow::SetWindowWord |
Mengatur nilai 16-bit pada offset tertentu ke dalam memori jendela tambahan. |
CWindow::ShowCaret |
Menampilkan tanda sisipan sistem. |
CWindow::ShowOwnedPopups |
Memperlihatkan atau menyembunyikan jendela pop-up yang dimiliki oleh jendela. |
CWindow::ShowScrollBar |
Memperlihatkan atau menyembunyikan bilah gulir. |
CWindow::ShowWindow |
Mengatur status peragaan jendela. |
CWindow::ShowWindowAsync |
Mengatur status peragaan jendela yang dibuat oleh utas yang berbeda. |
CWindow::UpdateWindow |
Memperbarui area klien. |
CWindow::ValidateRect |
Memvalidasi area klien dalam persegi panjang yang ditentukan. |
CWindow::ValidateRgn |
Memvalidasi area klien dalam wilayah yang ditentukan. |
CWindow::WinHelp |
Memulai Bantuan Windows. |
Operator Publik
| Nama | Deskripsi |
|---|---|
CWindow::operator HWND |
CWindow Mengonversi objek menjadi HWND. |
CWindow::operator = |
HWND Menetapkan ke CWindow objek. |
Anggota Data Publik
| Nama | Deskripsi |
|---|---|
CWindow::m_hWnd |
Handel ke jendela yang terkait dengan CWindow objek. |
CWindow::rcDefault |
Berisi dimensi jendela default. |
Keterangan
CWindow menyediakan fungsionalitas dasar untuk memanipulasi jendela di ATL. CWindow Banyak metode hanya membungkus salah satu fungsi API Win32. Misalnya, bandingkan prototipe untuk CWindow::ShowWindow dan ShowWindow:
| Metode CWindow | Fungsi Win32 |
|---|---|
BOOL ShowWindow( int nCmdShow ); |
BOOL ShowWindow( HWND hWnd , int nCmdShow ); |
CWindow::ShowWindow memanggil fungsi ShowWindow Win32 dengan meneruskan CWindow::m_hWnd sebagai parameter pertama. Setiap CWindow metode yang secara langsung membungkus fungsi Win32 melewati m_hWnd anggota; oleh karena itu, banyak CWindow dokumentasi akan merujuk Anda ke Windows SDK.
Catatan
Tidak setiap fungsi Win32 terkait jendela dibungkus oleh CWindow, dan tidak setiap CWindow metode membungkus fungsi Win32.
CWindow::m_hWnd menyimpan yang HWND mengidentifikasi jendela. Dilampirkan HWND ke objek Anda saat Anda:
HWNDTentukan diCWindowkonstruktor.Panggil
CWindow::Attach.Gunakan
CWindow.operator =Buat atau subkelas jendela menggunakan salah satu kelas berikut yang berasal dari
CWindow:
CWindowImpl Memungkinkan Anda membuat jendela baru atau subkelas jendela yang sudah ada.
CContainedWindow Mengimplementasikan jendela yang terkandung dalam objek lain. Anda dapat membuat jendela baru atau subkelas jendela yang sudah ada.
CDialogImpl Memungkinkan Anda membuat kotak dialog modal atau tanpa mode.
Untuk informasi selengkapnya tentang windows, lihat Windows dan topik berikutnya di Windows SDK. Untuk informasi selengkapnya tentang menggunakan jendela di ATL, lihat artikel Atl Window Classes.
Persyaratan
Header: atlwin.h
CWindow::ArrangeIconicWindows
Mengatur semua jendela anak yang diminimalkan.
UINT ArrangeIconicWindows() throw();
Keterangan
Lihat ArrangeIconicWindows di Windows SDK.
CWindow::Attach
Melampirkan jendela yang diidentifikasi oleh hWndNew ke CWindow objek.
void Attach(HWND hWndNew) throw();
Parameter
hWndNew
[di] Handel ke jendela.
Contoh
//The following example attaches an HWND to the CWindow object
HWND hWnd = ::GetDesktopWindow();
CWindow myWindow;
myWindow.Attach(hWnd);
CWindow::BeginPaint
Menyiapkan jendela untuk lukisan.
HDC BeginPaint(LPPAINTSTRUCT lpPaint) throw();
Keterangan
Lihat BeginPaint di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object
//and calls CWindow::BeginPaint() and CWindow::EndPaint() in the
// WM_PAINT handler of a CWindowImpl-derived class
LRESULT CMyCtrl::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/,
BOOL& /*bHandled*/)
{
CWindow myWindow;
myWindow.Attach(m_hWnd);
PAINTSTRUCT ps;
HDC hDC = myWindow.BeginPaint(&ps);
//Use the hDC as much as you want
::Rectangle(hDC, 0, 0, 50, 50);
myWindow.EndPaint(&ps);
return 0;
}
CWindow::BringWindowToTop
Membawa jendela ke bagian atas urutan Z.
BOOL BringWindowToTop() throw();
Keterangan
Lihat BringWindowToTop di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::BringWindowToTop() to bring the window to the top
//of the z-order.
CWindow myWindow;
myWindow.Attach(hWnd);
BOOL bOnTop = myWindow.BringWindowToTop();
//check if we could bring the window on top
if(bOnTop)
{
//Do something
}
CWindow::CenterWindow
Tengahkan jendela ke jendela tertentu.
BOOL CenterWindow(HWND hWndCenter = NULL) throw();
Parameter
hWndCenter
[di] Handel ke jendela yang akan dipusatkan. Jika parameter ini adalah NULL (nilai default), metode akan diatur hWndCenter ke jendela induk jendela jika merupakan jendela turunan. Jika tidak, itu akan diatur hWndCenter ke jendela pemilik jendela.
Tampilkan Nilai
TRUE jika jendela berhasil dipusatkan; jika tidak, FALSE.
Contoh
//The following example attaches various HWNDs to the CWindow objects
//and calls CWindow::CenterWindow() for each of them
CWindow childWindow, popupWindow, overlappedWindow;
childWindow.Attach(hWndChild); //a window created with WS_CHILD style
childWindow.CenterWindow(); //This will center the child
//window against its Parent window
popupWindow.Attach(hWndPopup); //a window created with WS_POPUP style
popupWindow.CenterWindow(); //This will center the popup window
//against its Owner window
overlappedWindow.Attach(hWndOverlapped); //a window created with
//WS_OVERLAPPED style
overlappedWindow.CenterWindow(::GetDesktopWindow()); //This will center
//the overlapped window against the DeskTop window
CWindow::ChangeClipboardChain
Menghapus jendela dari rantai penampil Clipboard.
BOOL ChangeClipboardChain(HWND hWndNewNext) throw();
Keterangan
Lihat ChangeClipboardChain di Windows SDK.
CWindow::CheckDlgButton
Mengubah status pemeriksaan tombol yang ditentukan.
BOOL CheckDlgButton(int nIDButton, UINT nCheck) throw();
Keterangan
Lihat CheckDlgButton di Windows SDK.
CWindow::CheckRadioButton
Memeriksa tombol radio yang ditentukan.
BOOL CheckRadioButton(
int nIDFirstButton,
int nIDLastButton,
int nIDCheckButton) throw();
Keterangan
Lihat CheckRadioButton di Windows SDK.
CWindow::ChildWindowFromPoint
Mengambil jendela anak yang berisi titik yang ditentukan.
HWND ChildWindowFromPoint(POINT point) const throw();
Keterangan
Lihat ChildWindowFromPoint di Windows SDK.
CWindow::ChildWindowFromPointEx
Mengambil jenis jendela anak tertentu yang berisi titik yang ditentukan.
HWND ChildWindowFromPoint(POINT point, UINT uFlags) const throw();
Keterangan
Lihat ChildWindowFromPointEx di Windows SDK.
CWindow::ClientToScreen
Mengonversi koordinat klien ke koordinat layar.
BOOL ClientToScreen(LPPOINT lpPoint) const throw();
BOOL ClientToScreen(LPRECT lpRect) const throw();
Keterangan
Lihat ClientToScreen di Windows SDK.
Versi kedua dari metode ini memungkinkan Anda untuk mengonversi koordinat RECT struktur.
CWindow::Create
Membuat jendela.
HWND Create(
LPCTSTR lpstrWndClass,
HWND hWndParent,
_U_RECT rect = NULL,
LPCTSTR szWindowName = NULL,
DWORD dwStyle = 0,
DWORD dwExStyle = 0,
_U_MENUorID MenuOrID = 0U,
LPVOID lpCreateParam = NULL) throw();
Parameter
lpstrWndClass
[di] Penunjuk ke kelas jendela.
hWndParent
[di] Handel ke jendela induk atau pemilik.
rect
[di] Variabel jenis _U_RECT yang menentukan posisi jendela. Nilai defaultnya adalah NULL. Ketika parameter ini adalah NULL, nilai digunakan CWindow::rcDefault .
szWindowName
[di] Menentukan nama jendela. Nilai defaultnya adalah NULL.
dwStyle
[di] Gaya jendela. Nilai defaultnya adalah 0, yang berarti tidak ada gaya yang ditentukan. Untuk daftar nilai yang mungkin, lihat CreateWindow di Windows SDK.
dwExStyle
[di] Gaya jendela yang diperluas. Nilai defaultnya adalah 0, yang berarti tidak ada gaya yang diperluas yang ditentukan. Untuk daftar nilai yang mungkin, lihat CreateWindowEx di Windows SDK.
MenuOrID
[di] Variabel jenis _U_MENUorID yang menentukan handel ke menu atau pengidentifikasi jendela. Nilai defaultnya adalah 0U.
lpCreateParam
Penunjuk ke data pembuatan jendela yang terkandung dalam CREATESTRUCT struktur.
Tampilkan Nilai
Jika berhasil, handel ke jendela yang baru dibuat, ditentukan oleh m_hWnd. Sebaliknya, NULL.
Keterangan
CWindow::rcDefault didefinisikan sebagai __declspec(selectany) RECT CWindow::rcDefault = {CW_USEDEFAULT, CW_USEDEFAULT, 0, 0};.
Lihat CreateWindow di Windows SDK untuk informasi selengkapnya.
Catatan Jika 0 digunakan sebagai nilai untuk MenuOrID parameter, itu harus ditentukan sebagai 0U (nilai default) untuk menghindari kesalahan pengkompilasi.
CWindow::CreateCaret
Membuat bentuk baru untuk tanda sisipan sistem.
BOOL CreateCaret(HBITMAP pBitmap) throw();
Keterangan
Lihat CreateCaret di Windows SDK.
CWindow::CreateGrayCaret
Membuat persegi panjang abu-abu untuk tanda sisipan sistem.
BOOL CreateGrayCaret(int nWidth, int nHeight) throw();
Keterangan
Lihat CreateCaret di Windows SDK.
Meneruskan (HBITMAP) 1 parameter handel bitmap ke fungsi Win32.
CWindow::CreateSolidCaret
Membuat persegi panjang yang solid untuk sisipan sistem.
BOOL CreateSolidCaret(int nWidth, int nHeight) throw();
Keterangan
Lihat CreateCaret di Windows SDK.
Meneruskan (HBITMAP) 0 parameter handel bitmap ke fungsi Win32.
CWindow::CWindow
Konstruktor.
CWindow(HWND hWnd = NULL) throw();
Parameter
hWnd
[di] Handel ke jendela.
Keterangan
Menginisialisasi m_hWnd anggota ke hWnd, yang secara default adalah NULL.
Catatan
CWindow::CWindow tidak membuat jendela. CWindowImplKelas , CContainedWindow, dan CDialogImpl (semuanya berasal dari CWindow) menyediakan metode untuk membuat jendela atau kotak dialog, yang kemudian ditetapkan ke CWindow::m_hWnd. Anda juga dapat menggunakan CreateWindow fungsi Win32.
CWindow::DeferWindowPos
Memperbarui struktur beberapa posisi jendela yang ditentukan untuk jendela yang ditentukan.
HDWP DeferWindowPos(
HDWP hWinPosInfo,
HWND hWndInsertAfter,
int x,
int y,
int cx,
int cy,
UINT uFlags) throw();
Keterangan
Lihat DeferWindowPos di Windows SDK.
CWindow::DestroyWindow
Menghancurkan jendela yang terkait dengan CWindow objek dan mengatur m_hWnd ke NULL.
BOOL DestroyWindow() throw();
Keterangan
Lihat DestroyWindow di Windows SDK.
Ini tidak menghancurkan objek itu CWindow sendiri.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::DestroyWindow() to destroy the window
CWindow myWindow;
myWindow.Attach(hWndChild);
//call the CWindow wrappers
myWindow.DestroyWindow();
hWndChild = NULL;
CWindow::Detach
m_hWnd Melepaskan dari CWindow objek dan mengatur m_hWnd ke NULL.
HWND Detach() throw();
Tampilkan Nilai
Yang HWND terkait dengan CWindow objek.
Contoh
//The following example attaches an HWND to the CWindow object and
//later detaches the CWindow object from the HWND when no longer needed
CWindow myWindow;
myWindow.Attach(hWnd);
//call CWindow wrappers
//We don't need the C++ object any more, so detach it from the HWND.
myWindow.Detach();
CWindow::DlgDirList
Mengisi kotak daftar dengan nama semua file yang cocok dengan jalur atau nama file tertentu.
int DlgDirList(
LPTSTR lpPathSpec,
int nIDListBox,
int nIDStaticPath,
UINT nFileType) throw();
Keterangan
Lihat DlgDirList di Windows SDK.
CWindow::DlgDirListComboBox
Mengisi kotak kombo dengan nama semua file yang cocok dengan jalur atau nama file tertentu.
int DlgDirListComboBox(
LPTSTR lpPathSpec,
int nIDComboBox,
int nIDStaticPath,
UINT nFileType) throw();
Keterangan
Lihat DlgDirListComboBox di Windows SDK.
CWindow::DlgDirSelect
Mengambil pilihan saat ini dari kotak daftar.
BOOL DlgDirSelect(
LPTSTR lpString,
int nCount,
int nIDListBox) throw();
Keterangan
Lihat DlgDirSelectEx di Windows SDK.
CWindow::DlgDirSelectComboBox
Mengambil pilihan saat ini dari kotak kombo.
BOOL DlgDirSelectComboBox(
LPTSTR lpString,
int nCount,
int nIDComboBox) throw();
Keterangan
Lihat DlgDirSelectComboBoxEx di Windows SDK.
CWindow::DragAcceptFiles
Mendaftarkan apakah jendela menerima file yang diseret.
void DragAcceptFiles(BOOL bAccept = TRUE);
Keterangan
Lihat DragAcceptFiles di Windows SDK.
CWindow::DrawMenuBar
Mengurai ulang bilah menu jendela.
BOOL DrawMenuBar() throw();
Keterangan
Lihat DrawMenuBar di Windows SDK.
CWindow::EnableScrollBar
Mengaktifkan atau menonaktifkan panah bilah gulir.
BOOL EnableScrollBar(UINT uSBFlags, UINT uArrowFlags = ESB_ENABLE_BOTH) throw();
Keterangan
Lihat EnableScrollBar di Windows SDK.
CWindow::EnableWindow
Mengaktifkan atau menonaktifkan input.
BOOL EnableWindow(BOOL bEnable = TRUE) throw();
Keterangan
Lihat EnableWindow di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::EnableWindow() to enable and disable the window
//wrapped by the CWindow object
CWindow myWindow;
myWindow.Attach(hWnd);
//The following call enables the window
//CWindow::EnableWindow() takes TRUE as the default parameter
myWindow.EnableWindow();
if(myWindow.IsWindowEnabled())
{
//Do something now that the window is enabled
//Now it's time to disable the window again
myWindow.EnableWindow(FALSE);
}
CWindow::EndPaint
Menandai akhir lukisan.
void EndPaint(LPPAINTSTRUCT lpPaint) throw();
Keterangan
Lihat EndPaint di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object
//and calls CWindow::BeginPaint() and CWindow::EndPaint() in the
// WM_PAINT handler of a CWindowImpl-derived class
LRESULT CMyCtrl::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/,
BOOL& /*bHandled*/)
{
CWindow myWindow;
myWindow.Attach(m_hWnd);
PAINTSTRUCT ps;
HDC hDC = myWindow.BeginPaint(&ps);
//Use the hDC as much as you want
::Rectangle(hDC, 0, 0, 50, 50);
myWindow.EndPaint(&ps);
return 0;
}
CWindow::FlashWindow
Berkedipkan jendela sekali.
BOOL FlashWindow(BOOL bInvert) throw();
Keterangan
Lihat FlashWindow di Windows SDK.
CWindow::GetClientRect
Mengambil koordinat area klien.
BOOL GetClientRect(LPRECT lpRect) const throw();
Keterangan
Lihat GetClientRect di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::GetClientRect() to get the client area rectangle
//of the window
CWindow myWindow;
myWindow.Attach(hWnd);
RECT rc;
myWindow.GetClientRect(&rc);
CWindow::GetDC
Mengambil konteks perangkat untuk area klien.
HDC GetDC() throw();
Keterangan
Lihat GetDC di Windows SDK.
Contoh
// The following example attaches a HWND to the CWindow object,
// calls CWindow::GetDC to retrieve the DC of the client
// area of the window wrapped by CWindow Object, and calls
// CWindow::ReleaseDC to release the DC.
CWindow myWindow;
myWindow.Attach(hWnd);
HDC hDC = myWindow.GetDC();
// Use the DC
myWindow.ReleaseDC(hDC);
hDC = NULL;
CWindow::GetDCEx
Mengambil konteks perangkat untuk area klien dan memungkinkan opsi kliping.
HDC GetDCEx(HRGN hRgnClip, DWORD flags) throw();
Keterangan
Lihat GetDCEx di Windows SDK.
CWindow::GetDescendantWindow
Menemukan jendela turunan yang ditentukan oleh pengidentifikasi yang diberikan.
HWND GetDescendantWindow(int nID) const throw();
Parameter
nID
[di] Pengidentifikasi jendela turunan yang akan diambil.
Tampilkan Nilai
Handel ke jendela turunan.
Keterangan
GetDescendantWindow mencari seluruh pohon jendela anak, tidak hanya jendela yang merupakan anak langsung.
CWindow::GetDlgControl
Panggil fungsi ini untuk mendapatkan penunjuk ke antarmuka kontrol ActiveX yang dihosting oleh kontrol komposit atau dialog hosting kontrol.
HRESULT GetDlgControl(
int nID,
REFIID iid,
void** ppCtrl) throw();
Parameter
nID
[di] ID sumber daya kontrol yang diambil.
iid
[di] ID antarmuka yang ingin Anda dapatkan dari kontrol.
ppCtrl
[out] Penunjuk ke antarmuka.
Tampilkan Nilai
Mengembalikan S_OK keberhasilan atau kesalahan HRESULTyang valid . Misalnya, fungsi mengembalikan E_FAIL jika kontrol yang ditentukan oleh nID tidak dapat ditemukan dan mengembalikan E_NOINTERFACE jika kontrol dapat ditemukan, tetapi tidak mendukung antarmuka yang ditentukan oleh iid.
Keterangan
Dengan menggunakan pointer ini, Anda dapat memanggil metode pada antarmuka.
CWindow::GetDlgCtrlID
Mengambil pengidentifikasi jendela (hanya untuk jendela anak).
int GetDlgCtrlID() const throw();
Keterangan
Lihat GetDlgCtrlID di Windows SDK.
CWindow::GetDlgHost
Mengambil penunjuk ke antarmuka ke kontainer hosting Kontrol ATL.
HRESULT GetDlgHost(
int nID,
REFIID iid,
void** ppHost) throw();
Parameter
nID
[di] ID sumber daya kontrol yang diambil.
iid
[di] ID antarmuka yang ingin Anda dapatkan dari kontrol.
ppHost
[out] Penunjuk ke antarmuka.
Tampilkan Nilai
Mengembalikan S_OK jika jendela yang ditentukan oleh iid adalah Kontainer Kontrol, dan antarmuka yang diminta dapat diambil. Mengembalikan E_FAIL jika jendela bukan Kontainer Kontrol, atau jika antarmuka yang diminta tidak dapat diambil. Jika jendela dengan ID yang ditentukan tidak dapat ditemukan, maka nilai yang dikembalikan sama HRESULT_FROM_WIN32(ERROR_CONTROL_ID_NOT_FOUND)dengan .
Keterangan
Dengan menggunakan pointer ini, Anda dapat memanggil metode pada antarmuka.
CWindow::GetDlgItem
Mengambil jendela anak yang ditentukan.
HWND GetDlgItem(int nID) const throw();
Keterangan
Lihat GetDlgItem di Windows SDK.
CWindow::GetDlgItemInt
Menerjemahkan teks kontrol ke bilangan bulat.
UINT GetDlgItemInt(
int nID,
BOOL* lpTrans = NULL,
BOOL bSigned = TRUE) const throw();
Keterangan
Lihat GetDlgItemInt di Windows SDK.
CWindow::GetDlgItemText
Mengambil teks kontrol.
UINT GetDlgItemText(
int nID,
LPTSTR lpStr,
int nMaxCount) const throw();
BOOL GetDlgItemText(
int nID,
BSTR& bstrText) const throw();
Keterangan
Untuk informasi selengkapnya, lihat GetDlgItemText di Windows SDK.
Versi kedua dari metode ini memungkinkan Anda menyalin teks kontrol ke BSTR. Versi ini mengembalikan TRUE jika teks berhasil disalin; jika tidak, FALSE.
CWindow::GetExStyle
Mengambil gaya jendela jendela yang diperluas.
DWORD GetExStyle() const throw();
Tampilkan Nilai
Gaya jendela yang diperluas.
Keterangan
Untuk mengambil gaya jendela reguler, panggil GetStyle.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::GetExStyle() to retrieve the extended styles of
//the window
CWindow myWindow;
myWindow.Attach(hWnd);
DWORD dwExStyles = myWindow.GetExStyle();
CWindow::GetFont
Mengambil font jendela saat ini dengan mengirim pesan WM_GETFONT ke jendela.
HFONT GetFont() const throw();
Tampilkan Nilai
Handel font.
CWindow::GetHotKey
Menentukan hot key yang terkait dengan jendela dengan mengirim pesan WM_GETHOTKEY .
DWORD GetHotKey() const throw();
Tampilkan Nilai
Kode kunci virtual dan pengubah untuk kunci panas yang terkait dengan jendela. Untuk daftar pengubah yang mungkin, lihat WM_GETHOTKEY di Windows SDK. Untuk daftar kode kunci virtual standar, lihat Winuser.h.
CWindow::GetIcon
Mengambil handel ke ikon besar atau kecil jendela.
HICON GetIcon(BOOL bBigIcon = TRUE) const;
Parameter
bBigIcon
[di] Jika TRUE (nilai default) metode mengembalikan ikon besar. Jika tidak, ikon kecil akan ditampilkan.
Tampilkan Nilai
Handel ikon.
Keterangan
GetIcon mengirim pesan WM_GETICON ke jendela.
CWindow::GetLastActivePopup
Mengambil jendela pop-up aktif terbaru.
HWND GetLastActivePopup() const throw();
Keterangan
Lihat GetLastActivePopup di Windows SDK.
CWindow::GetMenu
Mengambil menu jendela.
HMENU GetMenu() const throw();
Keterangan
Lihat GetMenu di Windows SDK.
CWindow::GetNextDlgGroupItem
Mengambil kontrol sebelumnya atau berikutnya dalam sekelompok kontrol.
HWND GetNextDlgGroupItem(HWND hWndCtl, BOOL bPrevious = FALSE) const throw();
Keterangan
Lihat GetNextDlgGroupItem di Windows SDK.
CWindow::GetNextDlgTabItem
Mengambil kontrol sebelumnya atau berikutnya yang WS_TABSTOP memiliki gaya.
HWND GetNextDlgTabItem(HWND hWndCtl, BOOL bPrevious = FALSE) const throw();
Keterangan
Lihat GetNextDlgTabItem di Windows SDK.
CWindow::GetParent
Mengambil jendela induk langsung.
HWND GetParent() const throw();
Keterangan
Lihat GetParent di Windows SDK.
Contoh
// The following example attaches a HWND to the CWindow object
// and calls CWindow::GetParent to find out the parent
// window of the window wrapped by CWindow object.
CWindow myWindow;
myWindow.Attach(hWnd);
HWND hWndParent = myWindow.GetParent();
CWindow::GetScrollInfo
Mengambil parameter bilah gulir.
BOOL GetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo) throw();
Keterangan
Lihat GetScrollInfo di Windows SDK.
CWindow::GetScrollPos
Mengambil posisi kotak gulir.
int GetScrollPos(int nBar) const throw();
Keterangan
Lihat GetScrollPos di Windows SDK.
CWindow::GetScrollRange
Mengambil rentang bilah gulir.
BOOL GetScrollRange(
int nBar,
LPINT lpMinPos,
LPINT lpMaxPos) const throw();
Keterangan
Lihat GetScrollRange di Windows SDK.
CWindow::GetStyle
Mengambil gaya jendela jendela.
DWORD GetStyle() const throw();
Tampilkan Nilai
Gaya jendela.
Keterangan
Untuk mengambil gaya jendela yang diperluas, panggil GetExStyle.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::GetStyle() to retrieve the styles of the window
CWindow myWindow;
myWindow.Attach(hWnd);
DWORD dwStyles = myWindow.GetStyle();
CWindow::GetSystemMenu
Membuat salinan menu sistem untuk modifikasi.
HMENU GetSystemMenu(BOOL bRevert) const throw();
Keterangan
Lihat GetSystemMenu di Windows SDK.
CWindow::GetTopLevelParent
Mengambil jendela induk tingkat atas jendela.
HWND GetTopLevelParent() const throw();
Tampilkan Nilai
Handel ke jendela induk tingkat atas.
CWindow::GetTopLevelWindow
Mengambil jendela induk atau pemilik tingkat atas jendela.
HWND GetTopLevelWindow() const throw();
Tampilkan Nilai
Handel ke jendela pemilik tingkat atas.
CWindow::GetTopWindow
Mengambil jendela anak tingkat atas.
HWND GetTopWindow() const throw();
Keterangan
Lihat GetTopWindow di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::GetTopWindow() to get the top-level child window
CWindow myWindow;
myWindow.Attach(hWnd);
HWND hWndFavoriteChild = myWindow.GetTopWindow();
CWindow::GetUpdateRect
Mengambil koordinat persegi terkecil yang sepenuhnya menutupi wilayah pembaruan.
BOOL GetUpdateRect(LPRECT lpRect, BOOL bErase = FALSE) throw();
Keterangan
Lihat GetUpdateRect di Windows SDK.
CWindow::GetUpdateRgn
Mengambil wilayah pembaruan dan menyalinnya ke wilayah tertentu.
int GetUpdateRgn(HRGN hRgn, BOOL bErase = FALSE) throw();
Keterangan
Lihat GetUpdateRgn di Windows SDK.
CWindow::GetWindow
Mengambil jendela yang ditentukan.
HWND GetWindow(UINT nCmd) const throw();
Keterangan
Lihat GetWindow di Windows SDK.
CWindow::GetWindowContextHelpId
Mengambil pengidentifikasi konteks bantuan jendela.
DWORD GetWindowContextHelpId() const throw();
Keterangan
Lihat GetWindowContextHelpId di Windows SDK.
CWindow::GetWindowDC
Mengambil konteks perangkat untuk seluruh jendela.
HDC GetWindowDC() throw();
Keterangan
Lihat GetWindowDC di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::GetWindowDC() to retrieve the DC of the entire window
CWindow myWindow;
myWindow.Attach(hWnd);
HDC hDC = myWindow.GetWindowDC();
CWindow::GetWindowLong
Mengambil nilai 32-bit pada offset tertentu ke dalam memori jendela tambahan.
LONG GetWindowLong(int nIndex) const throw();
Keterangan
Lihat GetWindowLong di Windows SDK.
Catatan
Untuk menulis kode yang kompatibel dengan Windows versi 32-bit dan 64-bit, gunakan CWindow::GetWindowLongPtr.
CWindow::GetWindowLongPtr
Mengambil informasi tentang jendela yang ditentukan, termasuk nilai pada offset tertentu ke dalam memori jendela tambahan.
LONG_PTR GetWindowLongPtr(int nIndex) const throw();
Keterangan
Untuk informasi selengkapnya, lihat GetWindowLongPtr di Windows SDK.
Jika Anda mengambil penunjuk atau handel, fungsi ini menggantikan CWindow::GetWindowLong metode .
Catatan
Pointer dan handel adalah 32 bit pada Windows 32-bit dan 64 bit pada Windows 64-bit.
Untuk menulis kode yang kompatibel dengan Windows versi 32-bit dan 64-bit, gunakan CWindow::GetWindowLongPtr.
CWindow::GetWindowPlacement
Mengambil status dan posisi acara.
BOOL GetWindowPlacement(WINDOWPLACEMENT FAR* lpwndpl) const throw();
Keterangan
Lihat GetWindowPlacement di Windows SDK.
CWindow::GetWindowProcessID
Mengambil pengidentifikasi proses yang membuat jendela.
DWORD GetWindowProcessID() throw();
Keterangan
Lihat GetWindowThreadProcessID di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::GetWindowProcessID() to retrieve the id of the
//process that created the window
CWindow myWindow;
myWindow.Attach(hWnd);
DWORD dwID = myWindow.GetWindowProcessID();
CWindow::GetWindowRect
Mengambil dimensi pembatas jendela.
BOOL GetWindowRect(LPRECT lpRect) const throw();
Keterangan
Lihat GetWindowRect di Windows SDK.
CWindow::GetWindowRgn
Mendapatkan salinan wilayah jendela jendela.
int GetWindowRgn(HRGN hRgn) throw();
Keterangan
Lihat GetWindowRgn di Windows SDK.
CWindow::GetWindowText
Mengambil teks jendela.
int GetWindowText(LPTSTR lpszStringBuf, int nMaxCount) const throw();
BOOL GetWindowText(BSTR& bstrText) throw();
int GetWindowText(CSimpleString& strText) const;
Parameter
lpszStringBuf
Buffer untuk menulis teks jendela.
nMaxCount
Ukuran buffer dalam karakter; juga jumlah maksimum karakter yang akan ditulis.
bstrText
tempat BSTR menyimpan teks jendela.
strText
tempat CString menyimpan teks jendela.
Tampilkan Nilai
Jika teks berhasil disalin, nilai yang dikembalikan adalah TRUE; jika tidak, nilai yang dikembalikan adalah FALSE.
Keterangan
Lihat GetWindowText di Windows SDK.
Versi kedua dari metode ini memungkinkan Anda untuk menyimpan teks dalam BSTR; versi ketiga memungkinkan Anda untuk menyimpan hasilnya dalam CString, karena CSimpleString adalah kelas dasar .CString
CWindow::GetWindowTextLength
Mengambil panjang teks jendela.
int GetWindowTextLength() const throw();
Keterangan
Lihat GetWindowTextLength di Windows SDK.
CWindow::GetWindowThreadID
Mengambil pengidentifikasi utas yang membuat jendela yang ditentukan.
DWORD GetWindowThreadID() throw();
Keterangan
Lihat GetWindowThreadProcessID di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::GetWindowThreadID() to retrieve the id of the thread
//that created the window
CWindow myWindow;
myWindow.Attach(hWnd);
DWORD dwID = myWindow.GetWindowThreadID();
CWindow::GetWindowWord
Mengambil nilai 16-bit pada offset tertentu ke dalam memori jendela tambahan.
WORD GetWindowWord(int nIndex) const throw();
Keterangan
Lihat GetWindowLong di Windows SDK.
CWindow::GotoDlgCtrl
Mengatur fokus keyboard ke kontrol dalam kotak dialog.
void GotoDlgCtrl(HWND hWndCtrl) const throw();
Keterangan
Lihat WM_NEXTDLGCTL di Windows SDK.
CWindow::HideCaret
Menyembunyikan tanda sisipan sistem.
BOOL HideCaret() throw();
Keterangan
Lihat HideCaret di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::HideCaret() to hide the caret of the window owning
//the caret
CWindow myWindow;
myWindow.Attach(hWndEdit);
myWindow.HideCaret();
CWindow::HiliteMenuItem
Menyoroti atau menghapus sorotan dari item menu tingkat atas.
BOOL HiliteMenuItem(
HMENU hMenu,
UINT uHiliteItem,
UINT uHilite) throw();
Keterangan
Lihat HiliteMenuItem di Windows SDK.
CWindow::Invalidate
Membatalkan validasi seluruh area klien.
BOOL Invalidate(BOOL bErase = TRUE) throw();
Keterangan
Lihat InvalidateRect di Windows SDK.
Meneruskan NULL RECT parameter ke InvalidateRect fungsi Win32.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::Invalidate() to invalidate the entire client area
CWindow myWindow;
myWindow.Attach(hWnd);
myWindow.Invalidate();
CWindow::InvalidateRect
Membatalkan area klien dalam persegi panjang yang ditentukan.
BOOL InvalidateRect(LPCRECT lpRect, BOOL bErase = TRUE) throw();
Keterangan
Lihat InvalidateRect di Windows SDK.
CWindow::InvalidateRgn
Membatalkan area klien dalam wilayah yang ditentukan.
void InvalidateRgn(HRGN hRgn, BOOL bErase = TRUE) throw();
Keterangan
Untuk informasi selengkapnya, lihat InvalidateRgn di Windows SDK.
void Menentukan jenis pengembalian, sementara InvalidateRgn fungsi Win32 selalu mengembalikan TRUE.
CWindow::IsChild
Menentukan apakah jendela yang ditentukan adalah jendela anak.
BOOL IsChild(const HWND hWnd) const throw();
Keterangan
Lihat IsChild di Windows SDK.
CWindow::IsDialogMessage
Menentukan apakah pesan ditujukan untuk kotak dialog yang ditentukan.
BOOL IsDialogMessage(LPMSG lpMsg) throw();
Keterangan
Lihat IsDialogMessage di Windows SDK.
CWindow::IsDlgButtonChecked
Menentukan status pemeriksaan tombol.
UINT IsDlgButtonChecked(int nIDButton) const throw();
Keterangan
Lihat IsDlgButtonChecked di Windows SDK.
CWindow::IsIconic
Menentukan apakah jendela diminimalkan.
BOOL IsIconic() const throw();
Keterangan
Lihat IsIconic di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::IsIconic() to determine if the window is minimized
CWindow myWindow;
myWindow.Attach(hWnd);
BOOL bIconic = myWindow.IsIconic();
CWindow::IsParentDialog
Menentukan apakah jendela induk kontrol adalah jendela dialog.
BOOL IsParentDialog() throw();
Tampilkan Nilai
Mengembalikan TRUE jika jendela induk adalah dialog, FALSE jika tidak.
CWindow::IsWindow
Menentukan apakah handel jendela yang ditentukan mengidentifikasi jendela yang ada.
BOOL IsWindow() throw();
Keterangan
Lihat IsWindow di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::IsWindow() to verify if the HWND corresponds
//to an existing window
CWindow myWindow;
myWindow.Attach(hWnd);
BOOL bWindow = myWindow.IsWindow();
CWindow::IsWindowEnabled
Menentukan apakah jendela diaktifkan untuk input.
BOOL IsWindowEnabled() const throw();
Keterangan
Lihat IsWindowEnabled di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::IsWindowEnabled() to verify if the window is enabled
//for receiving input
CWindow myWindow;
myWindow.Attach(hWnd);
BOOL bEnabled = myWindow.IsWindowEnabled();
CWindow::IsWindowVisible
Menentukan status visibilitas jendela.
BOOL IsWindowVisible() const throw();
Keterangan
Lihat IsWindowVisible di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::IsWindowVisible() to determine the visibility state
//of the window
CWindow myWindow;
myWindow.Attach(hWnd);
BOOL bVisible = myWindow.IsWindowVisible();
CWindow::IsWindowUnicode
Menentukan apakah jendela yang ditentukan adalah jendela Unicode asli.
BOOL IsWindowUnicode() throw();
Keterangan
Lihat IsWindowUnicode di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::IsWindowUnicode() to determine if the window is a
//UNICODE window or an ANSI one.
CWindow myWindow;
myWindow.Attach(hWnd);
BOOL bUnicode = myWindow.IsWindowUnicode();
CWindow::IsZoomed
Menentukan apakah jendela dimaksimalkan.
BOOL IsZoomed() const throw();
Keterangan
Lihat IsZoomed di Windows SDK.
CWindow::KillTimer
Menghancurkan peristiwa timer yang dibuat oleh CWindow::SetTimer.
BOOL KillTimer(UINT nIDEvent) throw();
Keterangan
Lihat KillTimer di Windows SDK.
CWindow::LockWindowUpdate
Menonaktifkan atau mengaktifkan gambar di jendela dengan memanggil LockWindowUpdate fungsi Win32.
BOOL LockWindowUpdate(BOOL bLock = TRUE) throw();
Parameter
bLock
[di] Jika TRUE (nilai default), jendela akan dikunci. Jika tidak, itu akan dibuka kuncinya.
Tampilkan Nilai
TRUE jika jendela berhasil dikunci; jika tidak, FALSE.
Keterangan
Jika bLock adalah TRUE, metode ini diteruskan m_hWnd ke fungsi Win32; jika tidak, metode ini melewati NULL.
CWindow::m_hWnd
Berisi handel ke jendela yang terkait dengan CWindow objek.
HWND m_hWnd throw() throw();
CWindow::MapWindowPoints
Mengonversi sekumpulan titik dari ruang koordinat jendela ke ruang koordinat jendela lain.
int MapWindowPoints(
HWND hWndTo,
LPPOINT lpPoint,
UINT nCount) const throw();
int MapWindowPoints(
HWND hWndTo,
LPRECT lpRect) const throw();
Keterangan
Lihat MapWindowPoints di Windows SDK.
Versi kedua dari metode ini memungkinkan Anda untuk mengonversi koordinat RECT struktur.
CWindow::MessageBox
Menampilkan kotak pesan.
int MessageBox(
LPCTSTR lpszText,
LPCTSTR lpszCaption = NULL,
UINT nType = MB_OK) throw();
Keterangan
Lihat MessageBox di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::MessageBox() to pop up a Windows message box
CWindow myWindow;
myWindow.Attach(hWnd);
myWindow.MessageBox(_T("Hello World"));
CWindow::ModifyStyle
Memodifikasi gaya CWindow jendela objek.
BOOL ModifyStyle(
DWORD dwRemove,
DWORD dwAdd,
UINT nFlags = 0) throw();
Parameter
dwRemove
[di] Menentukan gaya jendela yang akan dihapus selama modifikasi gaya.
dwAdd
[di] Menentukan gaya jendela yang akan ditambahkan selama modifikasi gaya.
nFlags
[di] Bendera posisi jendela. Untuk daftar nilai yang mungkin, lihat SetWindowPos fungsi di Windows SDK.
Tampilkan Nilai
TRUE jika gaya jendela dimodifikasi; jika tidak, FALSE.
Keterangan
Gaya yang akan ditambahkan atau dihapus dapat dikombinasikan dengan menggunakan operator bitwise "atau" (|). CreateWindow Lihat fungsi di Windows SDKuntuk informasi tentang gaya jendela yang tersedia.
Jika nFlags bukan nol, ModifyStyle memanggil fungsi SetWindowPosWin32 , dan menggambar ulang jendela dengan menggabungkan nFlags dengan empat bendera berikut:
SWP_NOSIZEMempertahankan ukuran saat ini.SWP_NOMOVEMempertahankan posisi saat ini.SWP_NOZORDERMempertahankan urutan Z saat ini.SWP_NOACTIVATETidak mengaktifkan jendela.
Untuk mengubah gaya jendela yang diperluas, panggil ModifyStyleEx.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::ModifyStyle() to add and remove the window styles
CWindow myWindow;
myWindow.Attach(hWnd);
//The following line removes the WS_CLIPCHILDREN style from the
//window and adds the WS_CAPTION style to the window
myWindow.ModifyStyle(WS_CLIPCHILDREN, WS_CAPTION);
CWindow::ModifyStyleEx
Memodifikasi gaya jendela objek yang CWindow diperluas.
BOOL ModifyStyleEx(
DWORD dwRemove,
DWORD dwAdd,
UINT nFlags = 0) throw();
Parameter
dwRemove
[di] Menentukan gaya yang diperluas untuk dihapus selama modifikasi gaya.
dwAdd
[di] Menentukan gaya yang diperluas untuk ditambahkan selama modifikasi gaya.
nFlags
[di] Bendera posisi jendela. Untuk daftar nilai yang mungkin, lihat SetWindowPos fungsi di Windows SDK.
Tampilkan Nilai
TRUE jika gaya jendela yang diperluas dimodifikasi; jika tidak, FALSE.
Keterangan
Gaya yang akan ditambahkan atau dihapus dapat dikombinasikan dengan menggunakan operator bitwise "atau" (|). CreateWindowEx Lihat fungsi di Windows SDK untuk informasi tentang gaya yang diperluas yang tersedia.
Jika nFlags bukan nol, ModifyStyleEx memanggil fungsi SetWindowPosWin32 , dan menggambar ulang jendela dengan menggabungkan nFlags dengan empat bendera berikut:
SWP_NOSIZEMempertahankan ukuran saat ini.SWP_NOMOVEMempertahankan posisi saat ini.SWP_NOZORDERMempertahankan urutan Z saat ini.SWP_NOACTIVATETidak mengaktifkan jendela.
Untuk mengubah jendela menggunakan gaya jendela reguler, panggil ModifyStyle.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::ModifyStyleEx() to add and remove the extended
//window styles
CWindow myWindow;
myWindow.Attach(hWnd);
//The following line removes WS_EX_CONTEXTHELP extended style from
//the window and adds WS_EX_TOOLWINDOW extended style to the window
myWindow.ModifyStyleEx(WS_EX_CONTEXTHELP, WS_EX_TOOLWINDOW);
CWindow::MoveWindow
Mengubah ukuran dan posisi jendela.
BOOL MoveWindow(
int x,
int y,
int nWidth,
int nHeight,
BOOL bRepaint = TRUE) throw();
BOOL MoveWindow(
LPCRECT lpRect,
BOOL bRepaint = TRUE) throw();
Keterangan
Untuk objek jendela tingkat atas, x parameter dan y relatif terhadap sudut kiri atas layar. Untuk objek jendela anak, objek tersebut relatif terhadap sudut kiri atas area klien jendela induk.
Versi kedua metode ini menggunakan RECT struktur untuk menentukan posisi, lebar, dan tinggi baru jendela.
CWindow::NextDlgCtrl
Mengatur fokus keyboard ke kontrol berikutnya dalam kotak dialog.
void NextDlgCtrl() const throw();
Keterangan
Lihat WM_NEXTDLGCTL di Windows SDK.
CWindow::OpenClipboard
Membuka Papan Klip.
BOOL OpenClipboard() throw();
Keterangan
Lihat OpenClipboard di Windows SDK.
CWindow::operator HWND
CWindow Mengonversi objek menjadi HWND.
operator HWND() const throw();
CWindow::operator =
HWND Menetapkan ke CWindow objek dengan mengatur m_hWnd anggota ke hWnd.
CWindow& operator= (HWND hWnd) throw();
CWindow::PostMessage
Tempatkan pesan dalam antrean pesan yang terkait dengan utas yang membuat jendela.
BOOL PostMessage(
UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0) throw();
Keterangan
Lihat PostMessage di Windows SDK.
Mengembalikan tanpa menunggu utas memproses pesan.
Contoh
//The following example attaches an HWND to the CWindow object and
//posts a WM_PAINT message to the Window wrapped by the CWindow object
//using CWindow::PostMessage() with the default values of WPARAM and
//LPARAM
CWindow myWindow;
myWindow.Attach(hWnd);
myWindow.PostMessage(WM_PAINT);
CWindow::PrevDlgCtrl
Mengatur fokus keyboard ke kontrol sebelumnya dalam kotak dialog.
void PrevDlgCtrl() const throw();
Keterangan
Lihat WM_NEXTDLGCTL di Windows SDK.
CWindow::Print
Mengirim pesan WM_PRINT ke jendela untuk memintanya menggambar dirinya sendiri dalam konteks perangkat yang ditentukan.
void Print(HDC hDC, DWORD dwFlags) const throw();
Parameter
hDC
[di] Handel ke konteks perangkat.
dwFlags
[di] Menentukan opsi menggambar. Anda dapat menggabungkan satu atau beberapa bendera berikut:
PRF_CHECKVISIBLEGambar jendela hanya jika terlihat.PRF_CHILDRENGambar semua jendela anak yang terlihat.PRF_CLIENTGambar area klien jendela.PRF_ERASEBKGNDHapus latar belakang sebelum menggambar jendela.PRF_NONCLIENTGambar area non-klien jendela.PRF_OWNEDGambar semua jendela yang dimiliki.
CWindow::PrintClient
Mengirim pesan WM_PRINTCLIENT ke jendela untuk memintanya menggambar area kliennya dalam konteks perangkat yang ditentukan.
void PrintClient(HDC hDC, DWORD dwFlags) const throw();
Parameter
hDC
[di] Handel ke konteks perangkat.
dwFlags
[di] Menentukan opsi menggambar. Anda dapat menggabungkan satu atau beberapa bendera berikut:
PRF_CHECKVISIBLEGambar jendela hanya jika terlihat.PRF_CHILDRENGambar semua jendela anak yang terlihat.PRF_CLIENTGambar area klien jendela.PRF_ERASEBKGNDHapus latar belakang sebelum menggambar jendela.PRF_NONCLIENTGambar area non-klien jendela.PRF_OWNEDGambar semua jendela yang dimiliki.
CWindow::rcDefault
Berisi dimensi jendela default.
static RECT rcDefault;
CWindow::RedrawWindow
Memperbarui persegi panjang atau wilayah tertentu di area klien.
BOOL RedrawWindow(
LPCRECT lpRectUpdate = NULL,
HRGN hRgnUpdate = NULL,
UINT flags = RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
throw()
Keterangan
Lihat RedrawWindow di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::RedrawWindow() to update the entire window using the
//default arguments
CWindow myWindow;
myWindow.Attach(hWnd);
BOOL bRedrawn = myWindow.RedrawWindow();
CWindow::ReleaseDC
Merilis konteks perangkat.
int ReleaseDC(HDC hDC);
Keterangan
Lihat ReleaseDC di Windows SDK.
Contoh
// The following example attaches a HWND to the CWindow object,
// calls CWindow::GetDC to retrieve the DC of the client
// area of the window wrapped by CWindow Object, and calls
// CWindow::ReleaseDC to release the DC.
CWindow myWindow;
myWindow.Attach(hWnd);
HDC hDC = myWindow.GetDC();
// Use the DC
myWindow.ReleaseDC(hDC);
hDC = NULL;
CWindow::ResizeClient
Mengubah ukuran jendela ke ukuran area klien yang ditentukan.
BOOL ResizeClient(
int nWidth,
int nHeight,
BOOL bRedraw = FALSE) throw();
Parameter
nWidth
Lebar baru jendela dalam piksel.
nHeight
Tinggi jendela baru dalam piksel.
bRedraw
Bendera yang menunjukkan apakah akan mengurai ulang perubahan. Defaultnya adalah FALSE, menunjukkan jendela tidak menguras ulang perubahan.
CWindow::ScreenToClient
Mengonversi koordinat layar ke koordinat klien.
BOOL ScreenToClient(LPPOINT lpPoint) const throw();
BOOL ScreenToClient(LPRECT lpRect) const throw();
Keterangan
Lihat ScreenToClient di Windows SDK.
Versi kedua dari metode ini memungkinkan Anda untuk mengonversi koordinat RECT struktur.
CWindow::ScrollWindow
Menggulir area klien yang ditentukan.
BOOL ScrollWindow(
int xAmount,
int yAmount,
LPCRECT lpRect = NULL,
LPCRECT lpClipRect = NULL) throw();
Keterangan
Lihat ScrollWindow di Windows SDK.
CWindow::ScrollWindowEx
Menggulir area klien yang ditentukan dengan fitur tambahan.
int ScrollWindowEx(
int dx,
int dy,
LPCRECT lpRectScroll,
LPCRECT lpRectClip,
HRGN hRgnUpdate,
LPRECT lpRectUpdate,
UINT flags) throw();
Keterangan
Lihat ScrollWindowEx di Windows SDK.
CWindow::SendDlgItemMessage
Mengirim pesan ke kontrol.
LRESULT SendDlgItemMessage(
int nID,
UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0) throw();
Keterangan
Lihat SendDlgItemMessage di Windows SDK.
CWindow::SendMessage
Mengirim pesan ke jendela dan tidak kembali hingga prosedur jendela memproses pesan.
LRESULT SendMessage(
UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0) throw();
static LRESULT SendMessage(
HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam) throw();
Keterangan
Lihat SendMessage di Windows SDK.
Contoh
// The following example attaches a HWND to the CWindow
// object and sends a WM_PAINT message to the window
// wrapped by CWindow object using CWindow::SendMessage.
CWindow myWindow;
myWindow.Attach(hWnd);
myWindow.SendMessage(WM_PAINT, 0L, 0L);
CWindow::SendMessageToDescendants
Mengirim pesan yang ditentukan ke semua turunan CWindow langsung objek.
void SendMessageToDescendants(
UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0,
BOOL bDeep = TRUE) throw();
Parameter
message
[di] Pesan yang akan dikirim.
wParam
[di] Informasi khusus pesan tambahan.
lParam
[di] Informasi khusus pesan tambahan.
bDeep
[di] Jika TRUE (nilai default), pesan akan dikirim ke semua jendela turunan; jika tidak, pesan akan dikirim hanya ke jendela anak segera.
Keterangan
Jika bDeep adalah TRUE, pesan juga dikirim ke semua jendela turunan lainnya.
CWindow::SendNotifyMessage
Mengirim pesan ke jendela.
BOOL SendNotifyMessage(
UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0) throw();
Keterangan
Lihat SendNotifyMessage di Windows SDK.
Jika jendela dibuat oleh utas panggilan, SendNotifyMessage tidak akan kembali hingga prosedur jendela memproses pesan. Jika tidak, ia akan segera kembali.
CWindow::SetActiveWindow
Mengaktifkan jendela.
HWND SetActiveWindow() throw();
Keterangan
Lihat SetActiveWindow di Windows SDK.
Contoh
// The following example attaches a HWND to the CWindow object
// and sets the window as an active window by calling
// CWindow::SetActiveWindow which returns the HWND of the
// previously active window.
CWindow myWindow;
myWindow.Attach(hWnd);
HWND hWndPrev = myWindow.SetActiveWindow();
CWindow::SetCapture
Mengirim semua input mouse berikutnya ke jendela.
HWND SetCapture() throw();
Keterangan
Lihat SetCapture di Windows SDK.
CWindow::SetClipboardViewer
Menambahkan jendela ke rantai penampil Clipboard.
HWND SetClipboardViewer() throw();
Keterangan
Lihat SetClipboardViewer di Windows SDK.
CWindow::SetDlgCtrlID
Mengatur pengidentifikasi jendela ke nilai yang ditentukan.
int SetDlgCtrlID(int nID) throw();
Parameter
nID
[di] Nilai baru yang akan diatur untuk pengidentifikasi jendela.
Tampilkan Nilai
Jika berhasil, pengidentifikasi jendela sebelumnya; jika tidak, 0.
CWindow::SetDlgItemInt
Mengubah teks kontrol menjadi representasi string dari nilai bilangan bulat.
BOOL SetDlgItemInt(
int nID,
UINT nValue,
BOOL bSigned = TRUE) throw();
Keterangan
Lihat SetDlgItemInt di Windows SDK.
CWindow::SetDlgItemText
Mengubah teks kontrol.
BOOL SetDlgItemText(int nID, LPCTSTR lpszString) throw();
Keterangan
Lihat SetDlgItemText di Windows SDK.
CWindow::SetFocus
Mengatur fokus input ke jendela.
HWND SetFocus() throw();
Keterangan
Lihat SetFocus di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::SetFocus() to set the input focus
CWindow myWindow;
myWindow.Attach(hWnd);
HWND hWndLeftFocus = myWindow.SetFocus();
CWindow::SetFont
Mengubah font jendela saat ini dengan mengirim pesan WM_SETFONT ke jendela.
void SetFont(HFONT hFont, BOOL bRedraw = TRUE) throw();
Parameter
hFont
[di] Handel ke font baru.
bRedraw
[di] Jika TRUE (nilai default), jendela akan digambar ulang. Jika tidak, itu tidak.
CWindow::SetHotKey
Mengaitkan hot key dengan jendela dengan mengirim WM_SETHOTKEY pesan.
int SetHotKey(WORD wVirtualKeyCode, WORD wModifiers) throw();
Parameter
wVirtualKeyCode
[di] Kode kunci virtual dari kunci panas. Untuk daftar kode kunci virtual standar, lihat Winuser.h.
wModifiers
[di] Pengubah kunci panas. Untuk daftar nilai yang mungkin, lihat WM_SETHOTKEY di Windows SDK.
Tampilkan Nilai
Untuk daftar kemungkinan nilai yang dikembalikan, lihat WM_SETHOTKEY di Windows SDK.
CWindow::SetIcon
Mengatur ikon besar atau kecil jendela ke ikon yang diidentifikasi oleh hIcon.
HICON SetIcon(HICON hIcon, BOOL bBigIcon = TRUE) throw();
Parameter
hIcon
[di] Handel ke ikon baru.
bBigIcon
[di] Jika TRUE (nilai default), metode menetapkan ikon besar. Jika tidak, ini mengatur ikon kecil.
Tampilkan Nilai
Handel ke ikon sebelumnya.
Keterangan
SetIcon mengirim pesan WM_SETICON ke jendela.
CWindow::SetMenu
Mengubah menu jendela saat ini.
BOOL SetMenu(HMENU hMenu) throw();
Keterangan
Lihat SetMenu di Windows SDK.
CWindow::SetParent
Mengubah jendela induk.
HWND SetParent(HWND hWndNewParent) throw();
Keterangan
Lihat SetParent di Windows SDK.
Contoh
// The following example attaches a HWND to the CWindow object
// and sets the hWndParent as the parent window of the
// window wrapped by CWindow object using CWindow::SetParent.
CWindow myWindow;
myWindow.Attach(hWndChild);
HWND hWndPrevParent = myWindow.SetParent(hWndParent);
CWindow::SetRedraw
Mengatur atau menghapus bendera redraw dengan mengirim WM_SETREDRAW pesan ke jendela.
void SetRedraw(BOOL bRedraw = TRUE) throw();
Parameter
bRedraw
[di] Menentukan status bendera redraw. Jika TRUE (nilai default), bendera redraw diatur; jika FALSE, bendera dibersihkan.
Keterangan
Panggil SetRedraw untuk mengizinkan perubahan digambar ulang atau untuk mencegah perubahan digambar ulang.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::SetRedraw() to set and reset the redraw flag
CWindow myWindow;
myWindow.Attach(hWnd);
myWindow.SetRedraw(); //sets the redraw flag to TRUE
//
//
myWindow.SetRedraw(FALSE); //sets the redraw flag to FALSE
CWindow::SetScrollInfo
Mengatur parameter bilah gulir.
int SetScrollInfo(
int nBar,
LPSCROLLINFO lpScrollInfo,
BOOL bRedraw = TRUE) throw();
Keterangan
Lihat SetScrollInfo di Windows SDK.
CWindow::SetScrollPos
Mengubah posisi kotak gulir.
int SetScrollPos(
int nBar,
int nPos,
BOOL bRedraw = TRUE) throw();
Keterangan
Lihat SetScrollPos di Windows SDK.
CWindow::SetScrollRange
Mengubah rentang bilah gulir.
BOOL SetScrollRange(
int nBar,
int nMinPos,
int nMaxPos,
BOOL bRedraw = TRUE) throw();
Keterangan
Lihat SetScrollRange di Windows SDK.
CWindow::SetTimer
Membuat peristiwa timer.
UINT SetTimer(
UINT nIDEvent,
UINT nElapse,
void (CALLBACK* lpfnTimer)(HWND, UINT, UINT, DWORD) = NULL) throw();
Keterangan
Lihat SetTimer di Windows SDK.
CWindow::SetWindowContextHelpId
Mengatur pengidentifikasi konteks bantuan jendela.
BOOL SetWindowContextHelpId(DWORD dwContextHelpId) throw();
Keterangan
Lihat SetWindowContextHelpId di Windows SDK.
CWindow::SetWindowLong
Mengatur nilai 32-bit pada offset tertentu ke dalam memori jendela tambahan.
LONG SetWindowLong(int nIndex, LONG dwNewLong) throw();
Keterangan
Lihat SetWindowLong di Windows SDK.
Catatan
Untuk menulis kode yang kompatibel dengan Windows versi 32-bit dan 64-bit, gunakan CWindow::SetWindowLongPtr.
CWindow::SetWindowLongPtr
Mengubah atribut jendela yang ditentukan, dan juga menetapkan nilai pada offset yang ditentukan dalam memori jendela tambahan.
LONG_PTR SetWindowLongPtr(int nIndex, LONG_PTR dwNewLong) throw();
Keterangan
Lihat SetWindowLongPtr di Windows SDK.
Fungsi ini menggantikan CWindow::SetWindowLong metode . Untuk menulis kode yang kompatibel dengan Windows versi 32-bit dan 64-bit, gunakan CWindow::SetWindowLongPtr.
CWindow::SetWindowPlacement
Mengatur status dan posisi peragaan.
BOOL SetWindowPlacement(const WINDOWPLACEMENT FAR* lpwndpl);
Keterangan
Lihat SetWindowPlacement di Windows SDK.
CWindow::SetWindowPos
Mengatur ukuran, posisi, dan urutan Z.
BOOL SetWindowPos(
HWND hWndInsertAfter,
int x,
int y,
int cx,
int cy,
UINT nFlags) throw();
BOOL SetWindowPos(
HWND hWndInsertAfter,
LPCRECT lpRect,
UINT nFlags) throw();
Keterangan
Lihat SetWindowPos di Windows SDK.
Versi kedua metode ini menggunakan RECT struktur untuk mengatur posisi, lebar, dan tinggi baru jendela.
CWindow::SetWindowRgn
Mengatur wilayah jendela jendela.
int SetWindowRgn(HRGN hRgn, BOOL bRedraw = FALSE) throw();
Keterangan
Lihat SetWindowRgn di Windows SDK.
CWindow::SetWindowText
Mengubah teks jendela.
BOOL SetWindowText(LPCTSTR lpszString) throw();
Keterangan
Lihat SetWindowText di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::SetWindowText() to set the new title-text of the
//window
CWindow myWindow;
myWindow.Attach(hWnd);
myWindow.SetWindowText(_T("Hello ATL"));
CWindow::SetWindowWord
Mengatur nilai 16-bit pada offset tertentu ke dalam memori jendela tambahan.
WORD SetWindowWord(int nIndex, WORD wNewWord) throw();
Keterangan
Lihat SetWindowLong di Windows SDK.
CWindow::ShowCaret
Menampilkan tanda sisipan sistem.
BOOL ShowCaret() throw();
Keterangan
Lihat ShowCaret di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::ShowCaret() to show the caret
CWindow myWindow;
myWindow.Attach(hWnd);
myWindow.ShowCaret();
CWindow::ShowOwnedPopups
Memperlihatkan atau menyembunyikan jendela pop-up yang dimiliki oleh jendela.
BOOL ShowOwnedPopups(BOOL bShow = TRUE) throw();
Keterangan
Lihat ShowOwnedPopups di Windows SDK.
CWindow::ShowScrollBar
Memperlihatkan atau menyembunyikan bilah gulir.
BOOL ShowScrollBar(UINT nBar, BOOL bShow = TRUE) throw();
Keterangan
Lihat ShowScrollBar di Windows SDK.
CWindow::ShowWindow
Mengatur status peragaan jendela.
BOOL ShowWindow(int nCmdShow) throw();
Keterangan
Lihat ShowWindow di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::ShowWindow() to show the window in its maximized state
CWindow myWindow;
myWindow.Attach(hWnd);
myWindow.ShowWindow(SW_SHOWMAXIMIZED);
CWindow::ShowWindowAsync
Mengatur status peragaan jendela yang dibuat oleh utas yang berbeda.
BOOL ShowWindowAsync(int nCmdShow) throw();
Keterangan
Lihat ShowWindowAsync di Windows SDK.
CWindow::UpdateWindow
Memperbarui area klien.
BOOL UpdateWindow() throw();
Keterangan
Lihat UpdateWindow di Windows SDK.
Contoh
//The following example attaches an HWND to the CWindow object and
//calls CWindow::UpdateWindow() to update the window
CWindow myWindow;
myWindow.Attach(hWnd);
BOOL bUpdated = myWindow.UpdateWindow();
CWindow::ValidateRect
Memvalidasi area klien dalam persegi panjang yang ditentukan.
BOOL ValidateRect(LPCRECT lpRect) throw();
Keterangan
Lihat ValidateRect di Windows SDK.
CWindow::ValidateRgn
Memvalidasi area klien dalam wilayah yang ditentukan.
BOOL ValidateRgn(HRGN hRgn) throw();
Keterangan
Lihat ValidateRgn di Windows SDK.
CWindow::WinHelp
Memulai Bantuan Windows.
BOOL WinHelp(
LPCTSTR lpszHelp,
UINT nCmd = HELP_CONTEXT,
DWORD dwData = 0) throw();
Keterangan
Lihat WinHelp di Windows SDK.