View Javadoc

1   /**
2    * 
3    */
4   package org.sirius.server.win32.classes.controls;
5   
6   import javax.jws.WebService;
7   
8   import org.sirius.server.win32.classes.Common;
9   import org.sirius.server.win32.constants.IButtonConsts;
10  
11  import com.sun.jna.platform.win32.WinDef.HWND;
12  import com.sun.jna.platform.win32.WinDef.LPARAM;
13  import com.sun.jna.platform.win32.WinDef.WPARAM;
14  
15  /**
16   * @author Myk Kolisnyk
17   * .
18   */
19  @WebService
20  public class Button extends Common implements IButtonConsts {
21  
22      /**
23  	 * .
24  	 */
25      public Button() {
26          // TODO Auto-generated constructor stub
27      }
28  
29      /**
30       * .
31       * @param hwndCtl .
32       * @return .
33       */
34      public final int getCheck(final long hwndCtl) {
35          HWND handle = this.longToHwnd(hwndCtl);
36          return getUser32().SendMessage(handle, BM_GETCHECK, new WPARAM(0),
37                  new LPARAM(0));
38      }
39  
40      /**
41       * .
42       * @param hwndCtl .
43       * @return .
44       */
45      public final int getState(final long hwndCtl) {
46          HWND handle = this.longToHwnd(hwndCtl);
47          return getUser32().SendMessage(handle, BM_GETSTATE, new WPARAM(0),
48                  new LPARAM(0));
49      }
50  
51      /**
52       * .
53       * @param hwndCtl .
54       * @param check .
55       */
56      public final void setCheck(final long hwndCtl, final int check) {
57          HWND handle = this.longToHwnd(hwndCtl);
58          getUser32().SendMessage(handle, BM_SETCHECK, new WPARAM(check),
59                  new LPARAM(0));
60      }
61  
62      /**
63       * .
64       * @param hwndCtl .
65       * @param state .
66       */
67      public final void setState(final long hwndCtl, final int state) {
68          HWND handle = this.longToHwnd(hwndCtl);
69          getUser32().SendMessage(handle, BM_SETSTATE, new WPARAM(state),
70                  new LPARAM(0));
71      }
72  }