Ignore:
Timestamp:
Oct 27, 2008, 12:29:33 AM (11 years ago)
Author:
gb
Message:

Disable #+debug (at least when checked in ...).
Don't ignore WM_CREATE.
Call #_ShowWindow with #$SW_SHOW, not #$true (= 1 and means something else.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/examples/mswin.lisp

    r11220 r11232  
    7474  ;; arguments to the default window procedure and return whatever it
    7575  ;; returns.
    76   #+debug 0 (format t "~& hwnd = ~s, msg = ~s, wparam = ~s, lparam = ~s"
     76  #+debug (format t "~& hwnd = ~s, msg = ~s, wparam = ~s, lparam = ~x"
    7777                  hwnd msg wparam lparam)
    7878  (cond ((eql msg #$WM_DESTROY)
     
    8383         (#_PostQuitMessage 0)          ; exit status 0: all is well.
    8484         0)                             ; and we'll return 0
    85         ((eql msg #$WM_CREATE)
    86          0)
    8785        (t
    8886         ;; In a more realistic example, we'd handle more cases here.
     
    150148        (when (%null-ptr-p hwnd)
    151149          (error "CreateWindow failed: ~a" (ccl::%windows-error-string (#_GetLastError))))
    152         (#_ShowWindow hwnd #$true)
     150        (#_ShowWindow hwnd #$SW_SHOW)
    153151        (#_UpdateWindow hwnd)
    154152        ;; Loop, fetching messages, translating virtual key events
     
    186184      (pref flags #>USEROBJECTFLAGS.dwFlags))))
    187185
     186;;; This only works on Vista or later.
    188187(defun get-desktop-info (desktop)
    189188  (rlet ((pbool #>BOOLEAN #$false))
    190189    (if (eql 0 (#_GetUserObjectInformationA desktop 6 pbool (ccl::record-length #>BOOLEAN) (%null-ptr)))
    191       (pref pbool #>BOOLEAN)
    192       (ccl::%windows-error-string (#_GetLastError)))))
     190      (ccl::%windows-error-string (#_GetLastError))
     191      (pref pbool #>BOOLEAN))))
     192
     193(defun get-ui-object-name (handle)
     194  (%stack-block ((name 1000))
     195    (unless (eql 0 (#_GetUserObjectInformationA handle #$UOI_NAME name 1000 (%null-ptr)))
     196      (%get-cstring name))))
    193197||#
Note: See TracChangeset for help on using the changeset viewer.