Changeset 77 for Include/windows/WindowHandle.sbp
- Timestamp:
- Jan 27, 2007, 12:04:09 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/windows/WindowHandle.sbp
r42 r77 1 1 #ifndef __WINDOWSHANDLE_SBP__ 2 2 #define __WINDOWSHANDLE_SBP__ 3 4 #ifdef _WIN64 5 Declare Function _System_GetWindowLongPtr Lib "user32" Alias "GetWindowLongPtrA" (hWnd As HWND, nIndex As Long) As LONG_PTR 6 Declare Function _System_SetWindowLongPtr Lib "user32" Alias "SetWindowLongPtrA" (hWnd As HWND, nIndex As Long, l As LONG_PTR) As LONG_PTR 7 #else 8 Declare Function _System_GetWindowLongPtr Lib "user32" Alias "GetWindowLongA" (hWnd As HWND, nIndex As Long) As LONG_PTR 9 Declare Function _System_SetWindowLongPtr Lib "user32" Alias "SetWindowLongA" (hWnd As HWND, nIndex As Long, l As LONG_PTR) As LONG_PTR 10 #endif 11 Declare Function _System_GetParent Lib "user32" Alias "GetParent" (hWnd As HWND) As HWND 12 Declare Function _System_SetParent Lib "user32" Alias "SetParent" (hWnd As HWND) As HWND 13 Declare Function _System_GetMenu Lib "user32" Alias "GetMenu" (hWnd As HWND) As HMENU 14 Declare Function _System_SetMenu Lib "user32" Alias "SetMenu" (hWnd As HWND) As HMENU 15 Declare Function _System_InvalidateRect Lib "user32" Alias "InvalidateRect" (hWnd As HWND, ByRef Rect As RECT, bErase As BOOL) As BOOL 16 Declare Function _System_InvalidateRgn Lib "user32" Alias "InvalidateRgn" (hWnd As HWND, hRgn As HRGN, bErase As BOOL) As BOOL 17 Declare Function _System_ValidateRect Lib "user32" Alias "ValidateRect" (hWnd As HWND, ByRef Rect As RECT) As BOOL 18 Declare Function _System_ValidateRgn Lib "user32" Alias "ValidateRgn" (hWnd As HWND, hRgn As HRGN) As BOOL 19 Declare Function _System_BeginPaint Lib "user32" Alias "BeginPaint" (hWnd As HWND, ByRef ps As PAINTSTRUCT) As HDC 20 Declare Function _System_EndPaint Lib "user32" Alias "EndPaint" (hWnd As HWND, ByRef lpPaint As PAINTSTRUCT) As HDC 21 Declare Function _System_ClientToScreen Lib "user32" Alias "ClientToScreen" (hWnd As HWND, ByRef lpPoint As POINTAPI) As BOOL 22 Declare Function _System_ScreenToClient Lib "user32" Alias "ScreenToClient" (hWnd As HWND, ByRef lpPoint As POINTAPI) As BOOL 23 Declare Function _System_CreateCaret Lib "user32" Alias "CreateCaret" (hWnd As HWND, hBitmap As HBITMAP, nWidth As Long, nHeight As Long) As BOOL 24 Declare Function _System_HideCaret Lib "user32" Alias "HideCaret" (hWnd As HWND) As BOOL 25 Declare Function _System_ShowCaret Lib "user32" Alias "ShowCaret" (hWnd As HWND) As BOOL 26 Declare Function _System_DrawMenuBar Lib "user32" Alias "DrawMenuBar" (hwnd As HWND) As BOOL 27 Declare Function _System_GetWindowRect Lib "user32" Alias "DrawMenuBar" (hWnd As HWND, ByRef Rect As RECT) As BOOL 28 Declare Function _System_IsWindow Lib "user32" Alias "IsWindow" (hWnd As HWND) As BOOL 29 Declare Function _System_Isiconic Lib "user32" Alias "Isiconic" (hWnd As HWND) As BOOL 30 Declare Function _System_GetClientRect Lib "user32" Alias "GetClientRect" (hWnd As HWND, ByRef lpRect As RECT) As BOOL 3 31 4 32 Class WindowHandle … … 21 49 End Sub 22 50 23 Function HWnd() As HWND51 Const Function HWnd() As HWND 24 52 Return hwnd 25 53 End Function 26 54 27 Function Operator() As HWND55 Const Function Operator() As HWND 28 56 Return hwnd 29 57 End Function 30 58 59 Function BringToTop() As BOOL 60 Return BringWindowToTop(hwnd) 61 End Function 62 31 63 Function BeginPaint(ByRef ps As PAINTSTRUCT) As HDC 32 Return BeginPaint(hwnd, ps)33 End Function 34 35 Function ChildFromPoint(x As Long, y As Long) As HWND64 Return _System_BeginPaint(hwnd, ps) 65 End Function 66 67 Const Function ChildFromPoint(x As Long, y As Long) As HWND 36 68 Return ChildWindowFromPoint(hwnd, x, y) 37 69 End Function 38 70 39 Function ChildFromPointEx(x As Long, y As Long, flags As DWord) As HWND71 Const Function ChildFromPointEx(x As Long, y As Long, flags As DWord) As HWND 40 72 Return ChildWindowFromPointEx(hwnd, x, y, flags) 41 73 End Function 42 74 43 Function ClientToScreen(ByRef pt As POINTAPI) As BOOL44 Return ClientToScreen(pt)75 Const Function ClientToScreen(ByRef pt As POINTAPI) As BOOL 76 Return _System_ClientToScreen(hwnd, pt) 45 77 End Function 46 78 47 79 Function Close() As BOOL 48 Return CloseWindow( )80 Return CloseWindow(hwnd) 49 81 End Function 50 82 51 83 Function CreateCaret(hbmp As HBITMAP, width As Long, height As Long) As BOOL 52 Return CreateCaret(hwnd, hbmp, width, hegiht)84 Return _System_CreateCaret(hwnd, hbmp, width, hegiht) 53 85 End Function 54 86 … … 58 90 59 91 Function DrawMenuBar() As BOOL 60 Return DrawMenuBar(hwnd)92 Return _System_DrawMenuBar(hwnd) 61 93 End Function 62 94 … … 70 102 71 103 Function EndPaint(ByRef ps As PAINTSTRUCT) As BOOL 72 Return EndPaint(hwnd, ps)73 End Function 74 75 Function EnumChilds(enumFunc As WNDENUMPROC, lp As LPARAM) As BOOL104 Return _System_EndPaint(hwnd, ps) 105 End Function 106 107 Const Function EnumChilds(enumFunc As WNDENUMPROC, lp As LPARAM) As BOOL 76 108 Return EnumChildWindows(hwnd, enumFunc, lp) 77 109 End Function … … 81 113 End Function 82 114 83 Function GetClassLongPtr(index As Long) As LONG_PTR115 Const Function GetClassLongPtr(index As Long) As LONG_PTR 84 116 Return GetClassLongPtr(hwnd, index) 85 117 End Function 86 118 87 Function GetClassName(className As PSTR, maxCount As Long) As Long119 Const Function GetClassName(className As PSTR, maxCount As Long) As Long 88 120 Return GetClassName(className, maxCount) 89 121 End Function 90 122 91 Function GetClientRect(ByRef rc As RECT) As BOOL 92 Return GetClientRect(hwnd, rc) 123 Const Function GetClientRect(ByRef rc As RECT) As BOOL 124 Return _System_GetClientRect(hwnd, rc) 125 End Function 126 127 Const Function GetContextHelpId() As DWord 128 Return GetWindowContextHelpId(hwnd) 93 129 End Function 94 130 … … 101 137 End Function 102 138 103 Function GetDlgCtrlID() As Long139 Const Function GetDlgCtrlID() As Long 104 140 Return GetDlgCtrlID(hwnd) 105 141 End Function 106 142 107 Function GetDlgItem(idDlgItem As Long) As WindowHandle143 Const Function GetDlgItem(idDlgItem As Long) As WindowHandle 108 144 Return GetDlgItem(hwnd, idDlgItem) 109 145 End Function 110 146 111 Function GetDlgItemText(idDlgItem As Long, ps As PSTR, maxCount As Long) As Long147 Const Function GetDlgItemText(idDlgItem As Long, ps As PSTR, maxCount As Long) As Long 112 148 Return GetDlgItemText(hwnd, idDlgItem, ps, maxCount) 113 149 End Function 114 150 115 Function GetMenu() As HMENU 116 Return GetMenu(hwnd) 117 End Function 118 119 Function GetParent() As WindowHandle 120 Return GetParent(hwnd) 121 End Function 122 123 Function GetProp(psz As PCSTR) As HANDLE 151 Const Function GetMenu() As HMENU 152 Return _System_GetMenu(hwnd) 153 End Function 154 155 Const Function GetParent() As WindowHandle 156 Dim w As WindowHandle(_System_GetParent(hwnd)) 157 Return w 158 End Function 159 160 Const Function GetProp(psz As PCSTR) As HANDLE 124 161 Return GetProp(hwnd, psz) 125 162 End Function 126 163 127 Function GetProp(atom As ATOM) As HANDLE164 Const Function GetProp(atom As ATOM) As HANDLE 128 165 Return GetProp(hwnd, atom As ULONG_PTR As PCSTR) 129 166 End Function 130 167 131 Function GetScrollInfo(fnBar As Long, ByRef si As SCROLLINFO) As BOOL168 Const Function GetScrollInfo(fnBar As Long, ByRef si As SCROLLINFO) As BOOL 132 169 Return GetScrollInfo(hwnd, fnBar, si) 133 170 End Function 134 171 135 Function GetSystemMenu(revert As BOOL) As HMENU172 Const Function GetSystemMenu(revert As BOOL) As HMENU 136 173 Return GetSystemMenu(hwnd, revert) 137 174 End Function 138 175 139 Function GetUpdateRect(ByRef rc As RECT, erase As BOOL) As BOOL176 Const Function GetUpdateRect(ByRef rc As RECT, erase As BOOL) As BOOL 140 177 Return GetUpdateRact(hwnd, rc, erase) 141 178 End Function 142 179 143 Function GetUpdateRgn(hrgn As HRGN, erase As BOOL) As BOOL180 Const Function GetUpdateRgn(hrgn As HRGN, erase As BOOL) As BOOL 144 181 Return GetUpdateRgn(hwnd, hrgn, erase) 145 182 End Function 146 183 147 Function GetWindow(cmd As DWord) As WindowHandle184 Const Function GetWindow(cmd As DWord) As WindowHandle 148 185 Return GetWindow(hwnd, cmd) 149 End Function150 151 Function GetWindowPlacement(ByRef wndpl As WINDOWPLACEMENT) As BOOL152 Return GetWindowPlacement(hwnd, wndpl)153 End Function154 155 Function GetContextHelpId() As DWord156 Return GetWindowContextHelpId(hwnd)157 186 End Function 158 187 … … 161 190 End Function 162 191 163 Function GetWindowLongPtr(index As Long) As LONG_PTR164 Return GetWindowLongPtr(hwnd, index)165 End Function 166 167 Function GetWindowPlasement(ByRef wndpl As WINDOWPLACEMENT) As BOOL192 Const Function GetWindowLongPtr(index As Long) As LONG_PTR 193 Return _System_GetWindowLongPtr(hwnd, index) 194 End Function 195 196 Const Function GetWindowPlasement(ByRef wndpl As WINDOWPLACEMENT) As BOOL 168 197 Return GetWindowPlasement(hwnd, wndpl) 169 198 End Function 170 199 171 Function GetWindowRect(ByRef rc As RECT) As BOOL172 Return GetWindowRect(rc)173 End Function 174 175 Function GetText(ps As PSTR, maxCount As Long) As BOOL200 Const Function GetWindowRect(ByRef rc As RECT) As BOOL 201 Return _System_GetWindowRect(rc) 202 End Function 203 204 Const Function GetText(ps As PSTR, maxCount As Long) As BOOL 176 205 Return GetWindowText(ps, maxCount) 177 206 End Function 178 207 179 Function GetTextLength() As Long208 Const Function GetTextLength() As Long 180 209 Return GetWindowTextLength(hwnd) 181 210 End Function 182 211 183 Function GetWindowThreadId() As DWord212 Const Function GetWindowThreadId() As DWord 184 213 Return GetWindowProcessThreadId(hwnd, 0) 185 214 End Function 186 215 187 Function GetWindowProcessThreadId(ByRef processId As DWord) As DWord216 Const Function GetWindowProcessThreadId(ByRef processId As DWord) As DWord 188 217 Return GetWindowProcessThreadId(hwnd, processId) 189 218 End Function 190 219 191 220 Function HideCaret() As BOOL 192 Return HideCaret(hwnd)221 Return _System_HideCaret(hwnd) 193 222 End Function 194 223 195 224 Function InvalidateRect(ByRef rc As RECT, erace As BOOL) As BOOL 196 Return InvalidateRect(hwnd, rc, erace)225 Return _System_InvalidateRect(hwnd, rc, erace) 197 226 End Function 198 227 199 228 Function InvalidateRect(ByRef rc As RECT) As BOOL 200 Return InvalidateRect(hwnd, rc, TRUE)229 Return _System_InvalidateRect(hwnd, rc, TRUE) 201 230 End Function 202 231 203 232 Function InvalidateRgn(hrgn As HRGN, erace As BOOL) As BOOL 204 Return InvalidateRgn(hwnd, hrgn, erace)233 Return _System_InvalidateRgn(hwnd, hrgn, erace) 205 234 End Function 206 235 207 236 Function InvalidateRgn(hrgn As HRGN) As BOOL 208 Return InvalidateRgn(hwnd, hrgn, TRUE)237 Return _System_InvalidateRgn(hwnd, hrgn, TRUE) 209 238 End Function 210 239 211 240 Function Invalidate(erace As BOOL) As BOOL 212 Return InvalidateRect(hwnd, ByVal 0, erace)241 Return _System_InvalidateRect(hwnd, ByVal 0, erace) 213 242 End Function 214 243 215 244 Function Invalidate() As BOOL 216 Return InvalidateRect(hwnd, ByVal 0, TRUE)217 End Function 218 219 Function IsChild(hwnd As HWND) As BOOL245 Return _System_InvalidateRect(hwnd, ByVal 0, TRUE) 246 End Function 247 248 Const Function IsChild(hwnd As HWND) As BOOL 220 249 Return IsChild(This.hwnd, hwnd) 221 250 End Function 222 251 223 Function IsDialogMessage(ByRef msg As MSG) As BOOL252 Const Function IsDialogMessage(ByRef msg As MSG) As BOOL 224 253 Return IsDialogMessage(hwnd, msg) 225 254 End Function 226 255 227 Function IsIconic() As BOOL228 Return IsIconic(hwnd)229 End Function 230 231 Function IsWindow() As BOOL232 Return IsWindow(hwnd)233 End Function 234 235 Function IsEnabled() As BOOL256 Const Function IsIconic() As BOOL 257 Return _System_IsIconic(hwnd) 258 End Function 259 260 Const Function IsWindow() As BOOL 261 Return _System_IsWindow(hwnd) 262 End Function 263 264 Const Function IsEnabled() As BOOL 236 265 Return IsWindowEnabled(hwnd) 237 266 End Function 238 267 239 Function IsUnicode() As BOOL268 Const Function IsUnicode() As BOOL 240 269 Return IsWindowUnicode(hwnd) 241 270 End Function 242 271 243 Function IsVisible() As BOOL272 Const Function IsVisible() As BOOL 244 273 Return IsWindowVisible(hwnd) 245 274 End Function 246 275 247 Function IsZoomed() As BOOL276 Const Function IsZoomed() As BOOL 248 277 Return IsZoomed(hwnd) 249 278 End Function … … 265 294 End Function 266 295 267 Function MessageBox(text As PCSTR, caption As PCSTR, uType As DWord) As Long296 Const Function MessageBox(text As PCSTR, caption As PCSTR, uType As DWord) As Long 268 297 Return MessageBox(hwnd, text, caption, uType) 269 298 End Function 270 299 271 Function MessageBox(text As PCSTR, caption As PCSTR) As Long300 Const Function MessageBox(text As PCSTR, caption As PCSTR) As Long 272 301 Return MessageBox(hwnd, text, caption, MB_OK) 273 302 End Function 274 303 275 Function MessageBox(text As PCSTR) As Long304 Const Function MessageBox(text As PCSTR) As Long 276 305 Return MessageBox(hwnd, text, 0, MB_OK) 277 306 End Function 278 307 279 Function Move Window(x As Long, y As Long, width As Long, height As Long, repaint As BOOL) As BOOL308 Function Move(x As Long, y As Long, width As Long, height As Long, repaint As BOOL) As BOOL 280 309 Return MoveWindow(hwnd, x, y, width, height, repaint) 281 310 End Function 282 311 283 Function Move Window(x As Long, y As Long, width As Long, height As Long) As BOOL312 Function Move(x As Long, y As Long, width As Long, height As Long) As BOOL 284 313 Return MoveWindow(hwnd, x, y, width, height, TRUE) 285 314 End Function 286 315 287 Function Move Window(ByRef rc As RECT, repeaint As BOOL) As BOOL316 Function Move(ByRef rc As RECT, repeaint As BOOL) As BOOL 288 317 With rc 289 318 Return MoveWindow(hwnd, .left, .top, .right - .left, .bottom - .top, repaint) … … 291 320 End Function 292 321 293 Function Move Window(ByRef rc As RECT) As BOOL322 Function Move(ByRef rc As RECT) As BOOL 294 323 With rc 295 324 Return MoveWindow(hwnd, .left, .top, .right - .left, .bottom - .top, TRUE) … … 329 358 End Function 330 359 331 Function ScreenToClient(ByRef pt As POINTAPI) As BOOL332 Return ScreenToClient(hwnd, pt)360 Const Function ScreenToClient(ByRef pt As POINTAPI) As BOOL 361 Return _System_ScreenToClient(hwnd, pt) 333 362 End Function 334 363 … … 378 407 379 408 Function SetMenu(hmenu As HMENU) As BOOL 380 Return SetMenu(hwnd, hmenu)409 Return _System_SetMenu(hwnd, hmenu) 381 410 End Function 382 411 383 412 Function SetParent(hwndNewParent As HWND) As HWND 384 Return SetParent(hwnd, hwndNewParent)413 Return _System_SetParent(hwnd, hwndNewParent) 385 414 End Function 386 415 … … 414 443 415 444 Function SetWindowLongPtr(index As Long, newLong As LONG_PTR) As LONG_PTR 416 Return SetWindowLongPtr(hwnd, index, newLong)445 Return _System_SetWindowLongPtr(hwnd, index, newLong) 417 446 End Function 418 447 … … 443 472 End Function 444 473 474 Function ShowCaret() As BOOL 475 Return _System_ShowCaret(hwnd) 476 End Function 477 445 478 Function ShowScrollBar(bar As DWord, show As BOOL) As BOOL 446 479 Return ShowScrollBar(hwnd, bar, show) … … 464 497 465 498 Function ValidateRect(ByRef rc As RECT) As BOOL 466 Return ValidateRect(hwnd, rc)499 Return _System_ValidateRect(hwnd, rc) 467 500 End Function 468 501 469 502 Function ValidateRgn(hrgn As HRGN) As BOOL 470 Return ValidateRgn(hwnd, hrgn)503 Return _System_ValidateRgn(hwnd, hrgn) 471 504 End Function 472 505 473 506 Function Validate() As BOOL 474 Return ValidateRect(hwnd, ByVal 0)507 Return _System_ValidateRect(hwnd, ByVal 0) 475 508 End Function 476 509 477 510 ' Get/SetWindowLongPtr Wrappers 478 511 479 Function GetExStyle() As DWord480 Return GetWindowLongPtr(hwnd, GWL_EXSTYLE) As DWord481 End Function 482 483 Function GetStyle() As DWord484 Return GetWindowLongPtr(hwnd, GWL_STYLE) As DWord485 End Function 486 487 Function GetWndProc() As WNDPROC488 Return GetWindowLongPtr(hwnd, GWLP_HINSTANCE) As WNDPROC489 End Function 490 491 Function GetInstance() As HINSTANCE492 Return GetWindowLongPtr(hwnd, GWLP_HINSTANCE) As HINSTANCE493 End Function 494 495 Function GetUserData() As LONG_PTR496 Return GetWindowLongPtr(hwnd, GWLP_USERDATA)512 Const Function GetExStyle() As DWord 513 Return _System_GetWindowLongPtr(hwnd, GWL_EXSTYLE) As DWord 514 End Function 515 516 Const Function GetStyle() As DWord 517 Return _System_GetWindowLongPtr(hwnd, GWL_STYLE) As DWord 518 End Function 519 520 Const Function GetWndProc() As WNDPROC 521 Return _System_GetWindowLongPtr(hwnd, GWLP_HINSTANCE) As WNDPROC 522 End Function 523 524 Const Function GetInstance() As HINSTANCE 525 Return _System_GetWindowLongPtr(hwnd, GWLP_HINSTANCE) As HINSTANCE 526 End Function 527 528 Const Function GetUserData() As LONG_PTR 529 Return _System_GetWindowLongPtr(hwnd, GWLP_USERDATA) 497 530 End Function 498 531 499 532 Function SetExStyle(style As DWord) As DWord 500 Return SetWindowLongPtr(hwnd, GWL_EXSTYLE, style) As DWord533 Return _System_SetWindowLongPtr(hwnd, GWL_EXSTYLE, style) As DWord 501 534 End Function 502 535 503 536 Function SetStyle(style As DWord) As DWord 504 Return SetWindowLongPtr(hwnd, GWL_STYLE, style) As DWord537 Return _System_SetWindowLongPtr(hwnd, GWL_STYLE, style) As DWord 505 538 End Function 506 539 507 540 Function SetWndProc(wndProc As WNDPROC) As WNDPROC 508 Return SetWindowLongPtR(hwnd, GWLP_WNDPROC, wndProc As WNDPROC) As WNDPROC541 Return _System_SetWindowLongPtR(hwnd, GWLP_WNDPROC, wndProc As WNDPROC) As WNDPROC 509 542 End Function 510 543 511 544 Function SetUserData(value As LONG_PTR) As LONG_PTR 512 Return SetWindowLongPtr(value As LONG_PTR)545 Return _System_SetWindowLongPtr(value As LONG_PTR) 513 546 End Function 514 547 515 548 ' Propaties 516 549 517 Function ClientRect() As RECT550 Const Function ClientRect() As RECT 518 551 Dim rc As RECT 519 GetClientRect(hwnd, rc)552 _System_GetClientRect(hwnd, rc) 520 553 Return rc 521 554 End Function … … 532 565 End Sub 533 566 534 Function WindowRect() As RECT567 Const Function WindowRect() As RECT 535 568 Dim rc As RECT 536 GetWindowRect(hwnd, rc)569 _System_GetWindowRect(hwnd, rc) 537 570 Return rc 538 571 End Function … … 542 575 End Sub 543 576 544 Function ContextHelpID() As DWord577 Const Function ContextHelpID() As DWord 545 578 Return GetContextHelpId(hwnd) 546 579 End Function 547 580 548 581 Sub ContextHelpID(newID As DWord) 549 SetContextHelpId(hwnd, newId)550 End Sub 551 552 Function DlgCtrlID() As Long582 _System_SetContextHelpId(hwnd, newId) 583 End Sub 584 585 Const Function DlgCtrlID() As Long 553 586 Return GetDlgCtrlID(hwnd) 554 587 End Function 555 588 556 589 Sub DlgCtrlId(newId As Long) 557 SetWindowLongPtr(hwnd, GWLP_ID, newId)590 _System_SetWindowLongPtr(hwnd, GWLP_ID, newId) 558 591 End Sub 559 592 560 593 Function DlgItem(idDlgItem As Long) As WindowHandle 561 Return GetDlgItem(hwnd, idDlgItem) 562 End Function 563 564 Function ExStyle() As DWord 565 Return GetWindowLongPtr(hwnd, GWL_EXSTYLE) As DWord 594 Dim w As WindowHandle(GetDlgItem(hwnd, idDlgItem)) 595 Return w 596 End Function 597 598 Const Function ExStyle() As DWord 599 Return _System_GetWindowLongPtr(hwnd, GWL_EXSTYLE) As DWord 566 600 End Function 567 601 568 602 Sub ExStyle(newExStyle As DWord) 569 SetWindowLongPtr(hwnd, GWL_EXSTYLE, newExStyle)570 End Sub 571 572 Function Style() As DWord573 Return GetWindowLongPtr(hwnd, GWL_STYLE) As DWord603 _System_SetWindowLongPtr(hwnd, GWLP_EXSTYLE, newExStyle) 604 End Sub 605 606 Const Function Style() As DWord 607 Return _System_GetWindowLongPtr(hwnd, GWL_STYLE) As DWord 574 608 End Function 575 609 576 610 Sub Style(newStyle As DWord) DWord 577 SetWindowLongPtr(hwnd, GWL_STYLE, newStyle)578 End Sub 579 580 Function Enabled() As BOOL611 _System_SetWindowLongPtr(hwnd, GWLP_STYLE, newStyle) 612 End Sub 613 614 Const Function Enabled() As BOOL 581 615 Return IsWindowEnabled(hwnd) 582 616 End Function … … 586 620 End Sub 587 621 588 Function Font() As HFONT622 Const Function Font() As HFONT 589 623 Return SendMessage(hwnd, WM_GETFONT, 0, 0) As HFONT 590 624 End Function … … 594 628 End Sub 595 629 596 Function Maximized() As BOOL630 Const Function Maximized() As BOOL 597 631 Return IsIconic(hwnd) 598 632 End Function … … 606 640 End Sub 607 641 608 Function Minimized() As BOOL642 Const Function Minimized() As BOOL 609 643 Return IsIconic(hwnd) 610 644 End Function … … 618 652 End Sub 619 653 620 Function Instance() As HINSTANCE621 Return GetWindowLongPtr(hwnd, GWLP_HINSTANCE) As HINSTANCE654 Const Function Instance() As HINSTANCE 655 Return _System_GetWindowLongPtr(hwnd, GWLP_HINSTANCE) As HINSTANCE 622 656 End Function 623 657 624 658 ' IsWindow, IsUnicodeはメソッドと同じ。 625 659 626 Function Parent() As WindowHandle627 Return GetParent(hwnd)660 Const Function Parent() As WindowHandle 661 Return _System_GetParent(hwnd) 628 662 End Function 629 663 630 664 Sub Parent(hwndNewParent As HWND) 631 SetParent(hwnd, hwndNewParent)632 End Sub 633 634 Function ProcessID() As DWord665 _System_SetParent(hwnd, hwndNewParent) 666 End Sub 667 668 Const Function ProcessID() As DWord 635 669 GetWindowProcessThreadId(ProcessID) 636 670 End Function 637 671 638 Function ThreadID() As DWord672 Const Function ThreadID() As DWord 639 673 Return GetWindowProcessThreadId(ByVal 0) 640 674 End Function 641 675 642 Function Menu() As HMENU643 Return GetMenu(hwnd)676 Const Function Menu() As HMENU 677 Return _System_GetMenu(hwnd) 644 678 End Function 645 679 646 680 Sub Menu(hmenuNew As HMENU) 647 SetMenu(hwnd, hmenuNew)648 End Sub 649 650 Function Text() As String681 _System_SetMenu(hwnd, hmenuNew) 682 End Sub 683 684 Const Function Text() As String 651 685 With Text 652 686 .ReSize(GetWindowTextLength(hwnd)) … … 659 693 End Sub 660 694 661 Function TextLength() As Long695 Const Function TextLength() As Long 662 696 Return GetWindowTextLength(hwnd) 663 697 End Function 664 698 665 Function UserData() As LONG_PTR666 Return GetWindowLongPtr(hwnd, GWLP_USERDATA)699 Const Function UserData() As LONG_PTR 700 Return _System_GetWindowLongPtr(hwnd, GWLP_USERDATA) 667 701 End Function 668 702 669 703 Sub UserData(newValue As LONG_PTR) 670 SetWindowLongPtr(hwnd, GWLP_USERDATA, newValue)671 End Sub 672 673 Function Visible() As BOOL704 _System_SetWindowLongPtr(hwnd, GWLP_USERDATA, newValue) 705 End Sub 706 707 Const Function Visible() As BOOL 674 708 Return IsVisible(hwnd) 675 709 End Function … … 683 717 End Sub 684 718 685 Function WindowPlacement() As WINDOWPLACEMENT719 Const Function WindowPlacement() As WINDOWPLACEMENT 686 720 WindowPlacement.length = Len(WindowPlacement) 687 721 GetWindowPlacement(hwnd, WindowPlacement) … … 692 726 End Sub 693 727 694 Function WndProc() As WNDPROC695 Return GetWindowLongPtr(hwnd, GWLP_HINSTANCE) As WNDPROC728 Const Function WndProc() As WNDPROC 729 Return _System_GetWindowLongPtr(hwnd, GWLP_HINSTANCE) As WNDPROC 696 730 End Function 697 731 698 732 Sub WndProc(newWndProc As WNDPROC) 699 SetWindowLongPtr(hwnd, GWLP_WNDPROC, newWndProc As LONG_PTR)733 _System_SetWindowLongPtr(hwnd, GWLP_WNDPROC, newWndProc As LONG_PTR) 700 734 End Sub 701 735
Note:
See TracChangeset
for help on using the changeset viewer.